fix(board): async searchParams; drop project filter; agent docs - #45

Merged
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs
May 14, 2026
Merged

fix(board): async searchParams; drop project filter; agent docs#45
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs

Conversation

@joryirving

Copy link
Copy Markdown
Contributor

Summary

Closes#42, #35, #33, #32. (#36 split out per discussion — schema change deserves its own PR.)

  • Fix Board filters resetting and remove stale project-label filtering #42 — Board filter dropdowns reset because searchParams is read synchronously in src/app/board/page.tsx, which is invalid under Next 16. Type searchParams as Promise<...> and await it. Remove the stale Project name text filter (repos are the project boundary, project/* labels aren't required). Rename Agent/Owner dropdowns to All agent labels / All owner labels with aria-label/title so the label-only filter behavior is explicit. Keep /api/issues API surface unchanged (zero blast radius outside the board UI).
  • Add regression tests for issue move validation and audit behavior #35route.test.ts already covers validation, label mutation shape, and success-path AuditLog. Adds the one missing case: AuditLog row written with success: false and the captured errorMessage when the GitHub mutation throws.
  • Define openclaw agent workflow contract for Mission Control #33 — New "OpenClaw Agent Workflow Contract" section in AGENTS.md: heartbeat lifecycle (best-effort /api/sync at start, /api/agent-runs at end), read path (/api/issues, prefer agent/* label assignment, treat no-status as backlog), source-of-truth rules (GitHub authoritative, Projects deprecated, no auto-close), failure modes (Mission Control failures don't fail the heartbeat, tokens are secrets), and auditability.
  • Add pre-openclaw agent migration runtime smoke checklist #32 — New "Pre-migration Smoke Checklist" section in README.md with a 10-step checklist (health, automation sync, repos, issue sync, issue read, board render, projects render, agent heartbeat visible, label-change audit row, no Prisma/BigInt/FK errors).
  • Adds a regression test (src/app/board/page.test.tsx) that calls BoardPage with Promise.resolve({...}) and asserts the Prisma query receives the resolved filter values. Catches sync-access reverts.

Test plan

  • npm run lint — clean
  • npm run typecheck — clean (after npx prisma generate, matching CI)
  • npm test — 53/53 passing (9 files)
  • CI green on PR
  • Manual: open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards
  • Manual: open /board?project=foo from an old bookmark, confirm nothing breaks (param is ignored silently)

🤖 Generated with Claude Code

…t docs
Closes#42, #35, #33, #32.
- #42: Board filters reset under Next 16 — type `searchParams` as a
Promise and `await` it before reading. Drop the stale `Project name`
text input since repos are the project boundary. Rename Agent/Owner
dropdowns to "All agent labels" / "All owner labels" with aria/title
text so the label-only behavior is obvious.
- #35: Add the one missing test for `/api/issues/move` — AuditLog row
written with success=false when the GitHub mutation throws.
- #33: Document the OpenClaw agent workflow contract in AGENTS.md
(heartbeat lifecycle, read path, source-of-truth rules, failure modes,
auditability).
- #32: Add a pre-migration smoke checklist to README.md so operators
can verify Mission Control end-to-end before flipping an agent's
workflow over.
Also adds a regression test for BoardPage searchParams handling so
sync-access reverts get caught.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@its-miso

its-misoBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Automated recommendation: APPROVE

Analysis engine: anthropic/MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic)

PR Review: fix(board): async searchParams; drop project filter; agent docs

Recommendation

Approve. This PR cleanly addresses all four linked issues (#42, #35, #33, #32) with correct implementation, appropriate test coverage, and documentation that follows repository conventions.


Change-by-Change Findings

1. src/app/board/page.tsx — Core fix for #42

  • searchParams type change: Changed from searchParams: { ... } to searchParams: Promise<{ ... }>
  • await usage: Added const params = await searchParams before accessing any params ✓
  • project filter removal: Removed project parameter from getIssues() and removed if (project) where.labels = { has: 'project/${project}' }
  • activeFilters: Removed project from the filter object passed to FilterBar ✓

This matches the Next 16 pattern shown in issue #42's "Likely fix direction" section.

2. src/components/filter-bar.tsx — UX improvements for #42

  • Project Input removed: The Input component for "Project name" was removed ✓
  • aria-label and title added: Agent dropdown gets "Filter by agent label" + "Filters by agent/* label only"; Owner dropdown gets equivalent ✓
  • Option text renamed: "All Agents" → "All agent labels", "All Owners" → "All owner labels" ✓

This addresses the acceptance criterion "Decide and document Agent/Owner filter behavior: either label-only by design, with clear UI text."

3. src/app/board/page.test.tsx — Regression test for #42 (NEW FILE)

  • 5 test cases covering repo, agent, owner, priority filters, and empty params
  • Mocks Prisma queries and verifies the where clause passed to findMany
  • Uses Promise.resolve({...}) to simulate Next 16 async searchParams ✓

4. src/app/api/issues/move/route.test.ts — AuditLog test for #35

  • Adds test case: it("writes an AuditLog entry with success=false when the GitHub mutation fails")
  • Mocks removeIssueLabel.mockRejectedValueOnce(new Error("github 500"))
  • Verifies createAuditLog called with success: false and errorMessage: "github 500"

5. AGENTS.md — OpenClaw Agent Workflow Contract for #33

  • 11-point contract covering heartbeat lifecycle, read path, source of truth, failure modes, and auditability
  • Language is generic (uses agent/*, not specific agent names) per AGENTS.md Code Standards ✓
  • Consistent with existing codebase patterns (e.g., token names MISSION_CONTROL_AGENT_TOKEN, /api/sync, /api/agent-runs)

6. README.md — Pre-migration Smoke Checklist for #32

  • 10-step checklist using curl commands and browser/manual steps
  • Ends with: "Only flip the agent's workflow over once all ten steps pass." ✓

Standards Compliance

StandardStatus
Next 16 async searchParams pattern✓ Correctly implemented with Promise<...> type and await
Generic agent names in docs (AGENTS.md Code Standard #1)✓ Uses agent/* pattern, not specific names
Error handling (error instanceof Error)✓ PR body and tests use new Error() pattern
Test coverage for acceptance criteria✓ Regression tests added for board filters
No commit of secrets✓ No .env or secrets in changes

Linked Issue Fit

#42 — Board filters resetting (Primary)

Acceptance CriterionStatus
Uses Next-compatible async searchParamsPromise<{...}> + await
Selecting a repo keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Selecting a priority keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Filtering changes the issue set✓ Prisma where clause built from params; test verifies
Clear filter with "All *" option"All agent labels" / "All owner labels" remain valid clear options
Regression tests for board search params✓ New 78-line test file with 5 cases
Agent/Owner filter behavior documented in UIaria-label + title attributes + renamed options
Remove stale Project filter✓ Removed from page.tsx, getIssues(), FilterBar

#35 — AuditLog on GitHub mutation failure

  • Test added: "writes an AuditLog entry with success=false when the GitHub mutation fails"
  • Verifies createAuditLog called with success: false and errorMessage
  • ✓ Matches the gap identified in the issue

#33 — Agent Workflow Contract

  • New "OpenClaw Agent Workflow Contract" section in AGENTS.md
  • Covers heartbeat lifecycle, read path, source of truth, failure modes, auditability
  • ✓ Addresses the missing documentation

#32 — Pre-migration Smoke Checklist

  • New 10-step checklist in README.md
  • Covers health, sync, issues, board render, projects render, agents page, audit log, logs
  • ✓ Addresses the checklist requirement

Evidence Provider Findings

No evidence providers configured — no findings to report.


Tool Harness Findings

No tool requests were executed. The PR description states npm test passes 53/53 tests (9 files), which includes the 5 new board tests and 1 new AuditLog test added by this PR.


Unknowns / Needs Verification

  1. CI green: The PR body shows - [ ] CI green on PR as a pending checklist item. This review assumes CI will pass based on local test results and the clean diff.

  2. Manual browser testing: Two manual items remain unchecked in the PR body:

    • "Open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards"
    • "Open /board?project=foo from an old bookmark, confirm nothing breaks"
  3. No breaking API change: The /api/issues route is unchanged (PR body states "zero blast radius outside the board UI"). Old ?project=foo URLs will silently ignore the project param — this is the intended behavior per issue Fix Board filters resetting and remove stale project-label filtering #42.


Summary

The PR correctly implements the Next 16 async searchParams fix for issue #42, removes the stale project filter, adds appropriate regression tests, fills the AuditLog test gap for #35, and documents the agent contract (#33) and migration checklist (#32). Code changes are minimal and focused. No violations of repository standards detected.

@joryirving
joryirving merged commit 590b529 into mainMay 14, 2026
3 checks passed
@joryirving
joryirving deleted the fix/board-filters-tests-docs branch May 14, 2026 22:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant

@joryirving
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

fix(board): async searchParams; drop project filter; agent docs - #45

Merged
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs
May 14, 2026
Merged

fix(board): async searchParams; drop project filter; agent docs#45
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs

Conversation

@joryirving

Copy link
Copy Markdown
Contributor

Summary

Closes#42, #35, #33, #32. (#36 split out per discussion — schema change deserves its own PR.)

  • Fix Board filters resetting and remove stale project-label filtering #42 — Board filter dropdowns reset because searchParams is read synchronously in src/app/board/page.tsx, which is invalid under Next 16. Type searchParams as Promise<...> and await it. Remove the stale Project name text filter (repos are the project boundary, project/* labels aren't required). Rename Agent/Owner dropdowns to All agent labels / All owner labels with aria-label/title so the label-only filter behavior is explicit. Keep /api/issues API surface unchanged (zero blast radius outside the board UI).
  • Add regression tests for issue move validation and audit behavior #35route.test.ts already covers validation, label mutation shape, and success-path AuditLog. Adds the one missing case: AuditLog row written with success: false and the captured errorMessage when the GitHub mutation throws.
  • Define openclaw agent workflow contract for Mission Control #33 — New "OpenClaw Agent Workflow Contract" section in AGENTS.md: heartbeat lifecycle (best-effort /api/sync at start, /api/agent-runs at end), read path (/api/issues, prefer agent/* label assignment, treat no-status as backlog), source-of-truth rules (GitHub authoritative, Projects deprecated, no auto-close), failure modes (Mission Control failures don't fail the heartbeat, tokens are secrets), and auditability.
  • Add pre-openclaw agent migration runtime smoke checklist #32 — New "Pre-migration Smoke Checklist" section in README.md with a 10-step checklist (health, automation sync, repos, issue sync, issue read, board render, projects render, agent heartbeat visible, label-change audit row, no Prisma/BigInt/FK errors).
  • Adds a regression test (src/app/board/page.test.tsx) that calls BoardPage with Promise.resolve({...}) and asserts the Prisma query receives the resolved filter values. Catches sync-access reverts.

Test plan

  • npm run lint — clean
  • npm run typecheck — clean (after npx prisma generate, matching CI)
  • npm test — 53/53 passing (9 files)
  • CI green on PR
  • Manual: open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards
  • Manual: open /board?project=foo from an old bookmark, confirm nothing breaks (param is ignored silently)

🤖 Generated with Claude Code

…t docs
Closes#42, #35, #33, #32.
- #42: Board filters reset under Next 16 — type `searchParams` as a
Promise and `await` it before reading. Drop the stale `Project name`
text input since repos are the project boundary. Rename Agent/Owner
dropdowns to "All agent labels" / "All owner labels" with aria/title
text so the label-only behavior is obvious.
- #35: Add the one missing test for `/api/issues/move` — AuditLog row
written with success=false when the GitHub mutation throws.
- #33: Document the OpenClaw agent workflow contract in AGENTS.md
(heartbeat lifecycle, read path, source-of-truth rules, failure modes,
auditability).
- #32: Add a pre-migration smoke checklist to README.md so operators
can verify Mission Control end-to-end before flipping an agent's
workflow over.
Also adds a regression test for BoardPage searchParams handling so
sync-access reverts get caught.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@its-miso

its-misoBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Automated recommendation: APPROVE

Analysis engine: anthropic/MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic)

PR Review: fix(board): async searchParams; drop project filter; agent docs

Recommendation

Approve. This PR cleanly addresses all four linked issues (#42, #35, #33, #32) with correct implementation, appropriate test coverage, and documentation that follows repository conventions.


Change-by-Change Findings

1. src/app/board/page.tsx — Core fix for #42

  • searchParams type change: Changed from searchParams: { ... } to searchParams: Promise<{ ... }>
  • await usage: Added const params = await searchParams before accessing any params ✓
  • project filter removal: Removed project parameter from getIssues() and removed if (project) where.labels = { has: 'project/${project}' }
  • activeFilters: Removed project from the filter object passed to FilterBar ✓

This matches the Next 16 pattern shown in issue #42's "Likely fix direction" section.

2. src/components/filter-bar.tsx — UX improvements for #42

  • Project Input removed: The Input component for "Project name" was removed ✓
  • aria-label and title added: Agent dropdown gets "Filter by agent label" + "Filters by agent/* label only"; Owner dropdown gets equivalent ✓
  • Option text renamed: "All Agents" → "All agent labels", "All Owners" → "All owner labels" ✓

This addresses the acceptance criterion "Decide and document Agent/Owner filter behavior: either label-only by design, with clear UI text."

3. src/app/board/page.test.tsx — Regression test for #42 (NEW FILE)

  • 5 test cases covering repo, agent, owner, priority filters, and empty params
  • Mocks Prisma queries and verifies the where clause passed to findMany
  • Uses Promise.resolve({...}) to simulate Next 16 async searchParams ✓

4. src/app/api/issues/move/route.test.ts — AuditLog test for #35

  • Adds test case: it("writes an AuditLog entry with success=false when the GitHub mutation fails")
  • Mocks removeIssueLabel.mockRejectedValueOnce(new Error("github 500"))
  • Verifies createAuditLog called with success: false and errorMessage: "github 500"

5. AGENTS.md — OpenClaw Agent Workflow Contract for #33

  • 11-point contract covering heartbeat lifecycle, read path, source of truth, failure modes, and auditability
  • Language is generic (uses agent/*, not specific agent names) per AGENTS.md Code Standards ✓
  • Consistent with existing codebase patterns (e.g., token names MISSION_CONTROL_AGENT_TOKEN, /api/sync, /api/agent-runs)

6. README.md — Pre-migration Smoke Checklist for #32

  • 10-step checklist using curl commands and browser/manual steps
  • Ends with: "Only flip the agent's workflow over once all ten steps pass." ✓

Standards Compliance

StandardStatus
Next 16 async searchParams pattern✓ Correctly implemented with Promise<...> type and await
Generic agent names in docs (AGENTS.md Code Standard #1)✓ Uses agent/* pattern, not specific names
Error handling (error instanceof Error)✓ PR body and tests use new Error() pattern
Test coverage for acceptance criteria✓ Regression tests added for board filters
No commit of secrets✓ No .env or secrets in changes

Linked Issue Fit

#42 — Board filters resetting (Primary)

Acceptance CriterionStatus
Uses Next-compatible async searchParamsPromise<{...}> + await
Selecting a repo keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Selecting a priority keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Filtering changes the issue set✓ Prisma where clause built from params; test verifies
Clear filter with "All *" option"All agent labels" / "All owner labels" remain valid clear options
Regression tests for board search params✓ New 78-line test file with 5 cases
Agent/Owner filter behavior documented in UIaria-label + title attributes + renamed options
Remove stale Project filter✓ Removed from page.tsx, getIssues(), FilterBar

#35 — AuditLog on GitHub mutation failure

  • Test added: "writes an AuditLog entry with success=false when the GitHub mutation fails"
  • Verifies createAuditLog called with success: false and errorMessage
  • ✓ Matches the gap identified in the issue

#33 — Agent Workflow Contract

  • New "OpenClaw Agent Workflow Contract" section in AGENTS.md
  • Covers heartbeat lifecycle, read path, source of truth, failure modes, auditability
  • ✓ Addresses the missing documentation

#32 — Pre-migration Smoke Checklist

  • New 10-step checklist in README.md
  • Covers health, sync, issues, board render, projects render, agents page, audit log, logs
  • ✓ Addresses the checklist requirement

Evidence Provider Findings

No evidence providers configured — no findings to report.


Tool Harness Findings

No tool requests were executed. The PR description states npm test passes 53/53 tests (9 files), which includes the 5 new board tests and 1 new AuditLog test added by this PR.


Unknowns / Needs Verification

  1. CI green: The PR body shows - [ ] CI green on PR as a pending checklist item. This review assumes CI will pass based on local test results and the clean diff.

  2. Manual browser testing: Two manual items remain unchecked in the PR body:

    • "Open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards"
    • "Open /board?project=foo from an old bookmark, confirm nothing breaks"
  3. No breaking API change: The /api/issues route is unchanged (PR body states "zero blast radius outside the board UI"). Old ?project=foo URLs will silently ignore the project param — this is the intended behavior per issue Fix Board filters resetting and remove stale project-label filtering #42.


Summary

The PR correctly implements the Next 16 async searchParams fix for issue #42, removes the stale project filter, adds appropriate regression tests, fills the AuditLog test gap for #35, and documents the agent contract (#33) and migration checklist (#32). Code changes are minimal and focused. No violations of repository standards detected.

@joryirving
joryirving merged commit 590b529 into mainMay 14, 2026
3 checks passed
@joryirving
joryirving deleted the fix/board-filters-tests-docs branch May 14, 2026 22:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant

@joryirving
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(board): async searchParams; drop project filter; agent docs - #45

Merged
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs
May 14, 2026
Merged

fix(board): async searchParams; drop project filter; agent docs#45
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs

Conversation

@joryirving

Copy link
Copy Markdown
Contributor

Summary

Closes#42, #35, #33, #32. (#36 split out per discussion — schema change deserves its own PR.)

  • Fix Board filters resetting and remove stale project-label filtering #42 — Board filter dropdowns reset because searchParams is read synchronously in src/app/board/page.tsx, which is invalid under Next 16. Type searchParams as Promise<...> and await it. Remove the stale Project name text filter (repos are the project boundary, project/* labels aren't required). Rename Agent/Owner dropdowns to All agent labels / All owner labels with aria-label/title so the label-only filter behavior is explicit. Keep /api/issues API surface unchanged (zero blast radius outside the board UI).
  • Add regression tests for issue move validation and audit behavior #35route.test.ts already covers validation, label mutation shape, and success-path AuditLog. Adds the one missing case: AuditLog row written with success: false and the captured errorMessage when the GitHub mutation throws.
  • Define openclaw agent workflow contract for Mission Control #33 — New "OpenClaw Agent Workflow Contract" section in AGENTS.md: heartbeat lifecycle (best-effort /api/sync at start, /api/agent-runs at end), read path (/api/issues, prefer agent/* label assignment, treat no-status as backlog), source-of-truth rules (GitHub authoritative, Projects deprecated, no auto-close), failure modes (Mission Control failures don't fail the heartbeat, tokens are secrets), and auditability.
  • Add pre-openclaw agent migration runtime smoke checklist #32 — New "Pre-migration Smoke Checklist" section in README.md with a 10-step checklist (health, automation sync, repos, issue sync, issue read, board render, projects render, agent heartbeat visible, label-change audit row, no Prisma/BigInt/FK errors).
  • Adds a regression test (src/app/board/page.test.tsx) that calls BoardPage with Promise.resolve({...}) and asserts the Prisma query receives the resolved filter values. Catches sync-access reverts.

Test plan

  • npm run lint — clean
  • npm run typecheck — clean (after npx prisma generate, matching CI)
  • npm test — 53/53 passing (9 files)
  • CI green on PR
  • Manual: open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards
  • Manual: open /board?project=foo from an old bookmark, confirm nothing breaks (param is ignored silently)

🤖 Generated with Claude Code

…t docs
Closes#42, #35, #33, #32.
- #42: Board filters reset under Next 16 — type `searchParams` as a
Promise and `await` it before reading. Drop the stale `Project name`
text input since repos are the project boundary. Rename Agent/Owner
dropdowns to "All agent labels" / "All owner labels" with aria/title
text so the label-only behavior is obvious.
- #35: Add the one missing test for `/api/issues/move` — AuditLog row
written with success=false when the GitHub mutation throws.
- #33: Document the OpenClaw agent workflow contract in AGENTS.md
(heartbeat lifecycle, read path, source-of-truth rules, failure modes,
auditability).
- #32: Add a pre-migration smoke checklist to README.md so operators
can verify Mission Control end-to-end before flipping an agent's
workflow over.
Also adds a regression test for BoardPage searchParams handling so
sync-access reverts get caught.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@its-miso

its-misoBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Automated recommendation: APPROVE

Analysis engine: anthropic/MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic)

PR Review: fix(board): async searchParams; drop project filter; agent docs

Recommendation

Approve. This PR cleanly addresses all four linked issues (#42, #35, #33, #32) with correct implementation, appropriate test coverage, and documentation that follows repository conventions.


Change-by-Change Findings

1. src/app/board/page.tsx — Core fix for #42

  • searchParams type change: Changed from searchParams: { ... } to searchParams: Promise<{ ... }>
  • await usage: Added const params = await searchParams before accessing any params ✓
  • project filter removal: Removed project parameter from getIssues() and removed if (project) where.labels = { has: 'project/${project}' }
  • activeFilters: Removed project from the filter object passed to FilterBar ✓

This matches the Next 16 pattern shown in issue #42's "Likely fix direction" section.

2. src/components/filter-bar.tsx — UX improvements for #42

  • Project Input removed: The Input component for "Project name" was removed ✓
  • aria-label and title added: Agent dropdown gets "Filter by agent label" + "Filters by agent/* label only"; Owner dropdown gets equivalent ✓
  • Option text renamed: "All Agents" → "All agent labels", "All Owners" → "All owner labels" ✓

This addresses the acceptance criterion "Decide and document Agent/Owner filter behavior: either label-only by design, with clear UI text."

3. src/app/board/page.test.tsx — Regression test for #42 (NEW FILE)

  • 5 test cases covering repo, agent, owner, priority filters, and empty params
  • Mocks Prisma queries and verifies the where clause passed to findMany
  • Uses Promise.resolve({...}) to simulate Next 16 async searchParams ✓

4. src/app/api/issues/move/route.test.ts — AuditLog test for #35

  • Adds test case: it("writes an AuditLog entry with success=false when the GitHub mutation fails")
  • Mocks removeIssueLabel.mockRejectedValueOnce(new Error("github 500"))
  • Verifies createAuditLog called with success: false and errorMessage: "github 500"

5. AGENTS.md — OpenClaw Agent Workflow Contract for #33

  • 11-point contract covering heartbeat lifecycle, read path, source of truth, failure modes, and auditability
  • Language is generic (uses agent/*, not specific agent names) per AGENTS.md Code Standards ✓
  • Consistent with existing codebase patterns (e.g., token names MISSION_CONTROL_AGENT_TOKEN, /api/sync, /api/agent-runs)

6. README.md — Pre-migration Smoke Checklist for #32

  • 10-step checklist using curl commands and browser/manual steps
  • Ends with: "Only flip the agent's workflow over once all ten steps pass." ✓

Standards Compliance

StandardStatus
Next 16 async searchParams pattern✓ Correctly implemented with Promise<...> type and await
Generic agent names in docs (AGENTS.md Code Standard #1)✓ Uses agent/* pattern, not specific names
Error handling (error instanceof Error)✓ PR body and tests use new Error() pattern
Test coverage for acceptance criteria✓ Regression tests added for board filters
No commit of secrets✓ No .env or secrets in changes

Linked Issue Fit

#42 — Board filters resetting (Primary)

Acceptance CriterionStatus
Uses Next-compatible async searchParamsPromise<{...}> + await
Selecting a repo keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Selecting a priority keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Filtering changes the issue set✓ Prisma where clause built from params; test verifies
Clear filter with "All *" option"All agent labels" / "All owner labels" remain valid clear options
Regression tests for board search params✓ New 78-line test file with 5 cases
Agent/Owner filter behavior documented in UIaria-label + title attributes + renamed options
Remove stale Project filter✓ Removed from page.tsx, getIssues(), FilterBar

#35 — AuditLog on GitHub mutation failure

  • Test added: "writes an AuditLog entry with success=false when the GitHub mutation fails"
  • Verifies createAuditLog called with success: false and errorMessage
  • ✓ Matches the gap identified in the issue

#33 — Agent Workflow Contract

  • New "OpenClaw Agent Workflow Contract" section in AGENTS.md
  • Covers heartbeat lifecycle, read path, source of truth, failure modes, auditability
  • ✓ Addresses the missing documentation

#32 — Pre-migration Smoke Checklist

  • New 10-step checklist in README.md
  • Covers health, sync, issues, board render, projects render, agents page, audit log, logs
  • ✓ Addresses the checklist requirement

Evidence Provider Findings

No evidence providers configured — no findings to report.


Tool Harness Findings

No tool requests were executed. The PR description states npm test passes 53/53 tests (9 files), which includes the 5 new board tests and 1 new AuditLog test added by this PR.


Unknowns / Needs Verification

  1. CI green: The PR body shows - [ ] CI green on PR as a pending checklist item. This review assumes CI will pass based on local test results and the clean diff.

  2. Manual browser testing: Two manual items remain unchecked in the PR body:

    • "Open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards"
    • "Open /board?project=foo from an old bookmark, confirm nothing breaks"
  3. No breaking API change: The /api/issues route is unchanged (PR body states "zero blast radius outside the board UI"). Old ?project=foo URLs will silently ignore the project param — this is the intended behavior per issue Fix Board filters resetting and remove stale project-label filtering #42.


Summary

The PR correctly implements the Next 16 async searchParams fix for issue #42, removes the stale project filter, adds appropriate regression tests, fills the AuditLog test gap for #35, and documents the agent contract (#33) and migration checklist (#32). Code changes are minimal and focused. No violations of repository standards detected.

@joryirving
joryirving merged commit 590b529 into mainMay 14, 2026
3 checks passed
@joryirving
joryirving deleted the fix/board-filters-tests-docs branch May 14, 2026 22:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant

@joryirving
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(board): async searchParams; drop project filter; agent docs - #45

Merged
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs
May 14, 2026
Merged

fix(board): async searchParams; drop project filter; agent docs#45
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs

Conversation

@joryirving

Copy link
Copy Markdown
Contributor

Summary

Closes#42, #35, #33, #32. (#36 split out per discussion — schema change deserves its own PR.)

  • Fix Board filters resetting and remove stale project-label filtering #42 — Board filter dropdowns reset because searchParams is read synchronously in src/app/board/page.tsx, which is invalid under Next 16. Type searchParams as Promise<...> and await it. Remove the stale Project name text filter (repos are the project boundary, project/* labels aren't required). Rename Agent/Owner dropdowns to All agent labels / All owner labels with aria-label/title so the label-only filter behavior is explicit. Keep /api/issues API surface unchanged (zero blast radius outside the board UI).
  • Add regression tests for issue move validation and audit behavior #35route.test.ts already covers validation, label mutation shape, and success-path AuditLog. Adds the one missing case: AuditLog row written with success: false and the captured errorMessage when the GitHub mutation throws.
  • Define openclaw agent workflow contract for Mission Control #33 — New "OpenClaw Agent Workflow Contract" section in AGENTS.md: heartbeat lifecycle (best-effort /api/sync at start, /api/agent-runs at end), read path (/api/issues, prefer agent/* label assignment, treat no-status as backlog), source-of-truth rules (GitHub authoritative, Projects deprecated, no auto-close), failure modes (Mission Control failures don't fail the heartbeat, tokens are secrets), and auditability.
  • Add pre-openclaw agent migration runtime smoke checklist #32 — New "Pre-migration Smoke Checklist" section in README.md with a 10-step checklist (health, automation sync, repos, issue sync, issue read, board render, projects render, agent heartbeat visible, label-change audit row, no Prisma/BigInt/FK errors).
  • Adds a regression test (src/app/board/page.test.tsx) that calls BoardPage with Promise.resolve({...}) and asserts the Prisma query receives the resolved filter values. Catches sync-access reverts.

Test plan

  • npm run lint — clean
  • npm run typecheck — clean (after npx prisma generate, matching CI)
  • npm test — 53/53 passing (9 files)
  • CI green on PR
  • Manual: open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards
  • Manual: open /board?project=foo from an old bookmark, confirm nothing breaks (param is ignored silently)

🤖 Generated with Claude Code

…t docs
Closes#42, #35, #33, #32.
- #42: Board filters reset under Next 16 — type `searchParams` as a
Promise and `await` it before reading. Drop the stale `Project name`
text input since repos are the project boundary. Rename Agent/Owner
dropdowns to "All agent labels" / "All owner labels" with aria/title
text so the label-only behavior is obvious.
- #35: Add the one missing test for `/api/issues/move` — AuditLog row
written with success=false when the GitHub mutation throws.
- #33: Document the OpenClaw agent workflow contract in AGENTS.md
(heartbeat lifecycle, read path, source-of-truth rules, failure modes,
auditability).
- #32: Add a pre-migration smoke checklist to README.md so operators
can verify Mission Control end-to-end before flipping an agent's
workflow over.
Also adds a regression test for BoardPage searchParams handling so
sync-access reverts get caught.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@its-miso

its-misoBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Automated recommendation: APPROVE

Analysis engine: anthropic/MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic)

PR Review: fix(board): async searchParams; drop project filter; agent docs

Recommendation

Approve. This PR cleanly addresses all four linked issues (#42, #35, #33, #32) with correct implementation, appropriate test coverage, and documentation that follows repository conventions.


Change-by-Change Findings

1. src/app/board/page.tsx — Core fix for #42

  • searchParams type change: Changed from searchParams: { ... } to searchParams: Promise<{ ... }>
  • await usage: Added const params = await searchParams before accessing any params ✓
  • project filter removal: Removed project parameter from getIssues() and removed if (project) where.labels = { has: 'project/${project}' }
  • activeFilters: Removed project from the filter object passed to FilterBar ✓

This matches the Next 16 pattern shown in issue #42's "Likely fix direction" section.

2. src/components/filter-bar.tsx — UX improvements for #42

  • Project Input removed: The Input component for "Project name" was removed ✓
  • aria-label and title added: Agent dropdown gets "Filter by agent label" + "Filters by agent/* label only"; Owner dropdown gets equivalent ✓
  • Option text renamed: "All Agents" → "All agent labels", "All Owners" → "All owner labels" ✓

This addresses the acceptance criterion "Decide and document Agent/Owner filter behavior: either label-only by design, with clear UI text."

3. src/app/board/page.test.tsx — Regression test for #42 (NEW FILE)

  • 5 test cases covering repo, agent, owner, priority filters, and empty params
  • Mocks Prisma queries and verifies the where clause passed to findMany
  • Uses Promise.resolve({...}) to simulate Next 16 async searchParams ✓

4. src/app/api/issues/move/route.test.ts — AuditLog test for #35

  • Adds test case: it("writes an AuditLog entry with success=false when the GitHub mutation fails")
  • Mocks removeIssueLabel.mockRejectedValueOnce(new Error("github 500"))
  • Verifies createAuditLog called with success: false and errorMessage: "github 500"

5. AGENTS.md — OpenClaw Agent Workflow Contract for #33

  • 11-point contract covering heartbeat lifecycle, read path, source of truth, failure modes, and auditability
  • Language is generic (uses agent/*, not specific agent names) per AGENTS.md Code Standards ✓
  • Consistent with existing codebase patterns (e.g., token names MISSION_CONTROL_AGENT_TOKEN, /api/sync, /api/agent-runs)

6. README.md — Pre-migration Smoke Checklist for #32

  • 10-step checklist using curl commands and browser/manual steps
  • Ends with: "Only flip the agent's workflow over once all ten steps pass." ✓

Standards Compliance

StandardStatus
Next 16 async searchParams pattern✓ Correctly implemented with Promise<...> type and await
Generic agent names in docs (AGENTS.md Code Standard #1)✓ Uses agent/* pattern, not specific names
Error handling (error instanceof Error)✓ PR body and tests use new Error() pattern
Test coverage for acceptance criteria✓ Regression tests added for board filters
No commit of secrets✓ No .env or secrets in changes

Linked Issue Fit

#42 — Board filters resetting (Primary)

Acceptance CriterionStatus
Uses Next-compatible async searchParamsPromise<{...}> + await
Selecting a repo keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Selecting a priority keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Filtering changes the issue set✓ Prisma where clause built from params; test verifies
Clear filter with "All *" option"All agent labels" / "All owner labels" remain valid clear options
Regression tests for board search params✓ New 78-line test file with 5 cases
Agent/Owner filter behavior documented in UIaria-label + title attributes + renamed options
Remove stale Project filter✓ Removed from page.tsx, getIssues(), FilterBar

#35 — AuditLog on GitHub mutation failure

  • Test added: "writes an AuditLog entry with success=false when the GitHub mutation fails"
  • Verifies createAuditLog called with success: false and errorMessage
  • ✓ Matches the gap identified in the issue

#33 — Agent Workflow Contract

  • New "OpenClaw Agent Workflow Contract" section in AGENTS.md
  • Covers heartbeat lifecycle, read path, source of truth, failure modes, auditability
  • ✓ Addresses the missing documentation

#32 — Pre-migration Smoke Checklist

  • New 10-step checklist in README.md
  • Covers health, sync, issues, board render, projects render, agents page, audit log, logs
  • ✓ Addresses the checklist requirement

Evidence Provider Findings

No evidence providers configured — no findings to report.


Tool Harness Findings

No tool requests were executed. The PR description states npm test passes 53/53 tests (9 files), which includes the 5 new board tests and 1 new AuditLog test added by this PR.


Unknowns / Needs Verification

  1. CI green: The PR body shows - [ ] CI green on PR as a pending checklist item. This review assumes CI will pass based on local test results and the clean diff.

  2. Manual browser testing: Two manual items remain unchecked in the PR body:

    • "Open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards"
    • "Open /board?project=foo from an old bookmark, confirm nothing breaks"
  3. No breaking API change: The /api/issues route is unchanged (PR body states "zero blast radius outside the board UI"). Old ?project=foo URLs will silently ignore the project param — this is the intended behavior per issue Fix Board filters resetting and remove stale project-label filtering #42.


Summary

The PR correctly implements the Next 16 async searchParams fix for issue #42, removes the stale project filter, adds appropriate regression tests, fills the AuditLog test gap for #35, and documents the agent contract (#33) and migration checklist (#32). Code changes are minimal and focused. No violations of repository standards detected.

@joryirving
joryirving merged commit 590b529 into mainMay 14, 2026
3 checks passed
@joryirving
joryirving deleted the fix/board-filters-tests-docs branch May 14, 2026 22:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant

@joryirving
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

fix(board): async searchParams; drop project filter; agent docs - #45

Merged
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs
May 14, 2026
Merged

fix(board): async searchParams; drop project filter; agent docs#45
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs

Conversation

@joryirving

Copy link
Copy Markdown
Contributor

Summary

Closes#42, #35, #33, #32. (#36 split out per discussion — schema change deserves its own PR.)

  • Fix Board filters resetting and remove stale project-label filtering #42 — Board filter dropdowns reset because searchParams is read synchronously in src/app/board/page.tsx, which is invalid under Next 16. Type searchParams as Promise<...> and await it. Remove the stale Project name text filter (repos are the project boundary, project/* labels aren't required). Rename Agent/Owner dropdowns to All agent labels / All owner labels with aria-label/title so the label-only filter behavior is explicit. Keep /api/issues API surface unchanged (zero blast radius outside the board UI).
  • Add regression tests for issue move validation and audit behavior #35route.test.ts already covers validation, label mutation shape, and success-path AuditLog. Adds the one missing case: AuditLog row written with success: false and the captured errorMessage when the GitHub mutation throws.
  • Define openclaw agent workflow contract for Mission Control #33 — New "OpenClaw Agent Workflow Contract" section in AGENTS.md: heartbeat lifecycle (best-effort /api/sync at start, /api/agent-runs at end), read path (/api/issues, prefer agent/* label assignment, treat no-status as backlog), source-of-truth rules (GitHub authoritative, Projects deprecated, no auto-close), failure modes (Mission Control failures don't fail the heartbeat, tokens are secrets), and auditability.
  • Add pre-openclaw agent migration runtime smoke checklist #32 — New "Pre-migration Smoke Checklist" section in README.md with a 10-step checklist (health, automation sync, repos, issue sync, issue read, board render, projects render, agent heartbeat visible, label-change audit row, no Prisma/BigInt/FK errors).
  • Adds a regression test (src/app/board/page.test.tsx) that calls BoardPage with Promise.resolve({...}) and asserts the Prisma query receives the resolved filter values. Catches sync-access reverts.

Test plan

  • npm run lint — clean
  • npm run typecheck — clean (after npx prisma generate, matching CI)
  • npm test — 53/53 passing (9 files)
  • CI green on PR
  • Manual: open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards
  • Manual: open /board?project=foo from an old bookmark, confirm nothing breaks (param is ignored silently)

🤖 Generated with Claude Code

…t docs
Closes#42, #35, #33, #32.
- #42: Board filters reset under Next 16 — type `searchParams` as a
Promise and `await` it before reading. Drop the stale `Project name`
text input since repos are the project boundary. Rename Agent/Owner
dropdowns to "All agent labels" / "All owner labels" with aria/title
text so the label-only behavior is obvious.
- #35: Add the one missing test for `/api/issues/move` — AuditLog row
written with success=false when the GitHub mutation throws.
- #33: Document the OpenClaw agent workflow contract in AGENTS.md
(heartbeat lifecycle, read path, source-of-truth rules, failure modes,
auditability).
- #32: Add a pre-migration smoke checklist to README.md so operators
can verify Mission Control end-to-end before flipping an agent's
workflow over.
Also adds a regression test for BoardPage searchParams handling so
sync-access reverts get caught.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@its-miso

its-misoBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Automated recommendation: APPROVE

Analysis engine: anthropic/MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic)

PR Review: fix(board): async searchParams; drop project filter; agent docs

Recommendation

Approve. This PR cleanly addresses all four linked issues (#42, #35, #33, #32) with correct implementation, appropriate test coverage, and documentation that follows repository conventions.


Change-by-Change Findings

1. src/app/board/page.tsx — Core fix for #42

  • searchParams type change: Changed from searchParams: { ... } to searchParams: Promise<{ ... }>
  • await usage: Added const params = await searchParams before accessing any params ✓
  • project filter removal: Removed project parameter from getIssues() and removed if (project) where.labels = { has: 'project/${project}' }
  • activeFilters: Removed project from the filter object passed to FilterBar ✓

This matches the Next 16 pattern shown in issue #42's "Likely fix direction" section.

2. src/components/filter-bar.tsx — UX improvements for #42

  • Project Input removed: The Input component for "Project name" was removed ✓
  • aria-label and title added: Agent dropdown gets "Filter by agent label" + "Filters by agent/* label only"; Owner dropdown gets equivalent ✓
  • Option text renamed: "All Agents" → "All agent labels", "All Owners" → "All owner labels" ✓

This addresses the acceptance criterion "Decide and document Agent/Owner filter behavior: either label-only by design, with clear UI text."

3. src/app/board/page.test.tsx — Regression test for #42 (NEW FILE)

  • 5 test cases covering repo, agent, owner, priority filters, and empty params
  • Mocks Prisma queries and verifies the where clause passed to findMany
  • Uses Promise.resolve({...}) to simulate Next 16 async searchParams ✓

4. src/app/api/issues/move/route.test.ts — AuditLog test for #35

  • Adds test case: it("writes an AuditLog entry with success=false when the GitHub mutation fails")
  • Mocks removeIssueLabel.mockRejectedValueOnce(new Error("github 500"))
  • Verifies createAuditLog called with success: false and errorMessage: "github 500"

5. AGENTS.md — OpenClaw Agent Workflow Contract for #33

  • 11-point contract covering heartbeat lifecycle, read path, source of truth, failure modes, and auditability
  • Language is generic (uses agent/*, not specific agent names) per AGENTS.md Code Standards ✓
  • Consistent with existing codebase patterns (e.g., token names MISSION_CONTROL_AGENT_TOKEN, /api/sync, /api/agent-runs)

6. README.md — Pre-migration Smoke Checklist for #32

  • 10-step checklist using curl commands and browser/manual steps
  • Ends with: "Only flip the agent's workflow over once all ten steps pass." ✓

Standards Compliance

StandardStatus
Next 16 async searchParams pattern✓ Correctly implemented with Promise<...> type and await
Generic agent names in docs (AGENTS.md Code Standard #1)✓ Uses agent/* pattern, not specific names
Error handling (error instanceof Error)✓ PR body and tests use new Error() pattern
Test coverage for acceptance criteria✓ Regression tests added for board filters
No commit of secrets✓ No .env or secrets in changes

Linked Issue Fit

#42 — Board filters resetting (Primary)

Acceptance CriterionStatus
Uses Next-compatible async searchParamsPromise<{...}> + await
Selecting a repo keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Selecting a priority keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Filtering changes the issue set✓ Prisma where clause built from params; test verifies
Clear filter with "All *" option"All agent labels" / "All owner labels" remain valid clear options
Regression tests for board search params✓ New 78-line test file with 5 cases
Agent/Owner filter behavior documented in UIaria-label + title attributes + renamed options
Remove stale Project filter✓ Removed from page.tsx, getIssues(), FilterBar

#35 — AuditLog on GitHub mutation failure

  • Test added: "writes an AuditLog entry with success=false when the GitHub mutation fails"
  • Verifies createAuditLog called with success: false and errorMessage
  • ✓ Matches the gap identified in the issue

#33 — Agent Workflow Contract

  • New "OpenClaw Agent Workflow Contract" section in AGENTS.md
  • Covers heartbeat lifecycle, read path, source of truth, failure modes, auditability
  • ✓ Addresses the missing documentation

#32 — Pre-migration Smoke Checklist

  • New 10-step checklist in README.md
  • Covers health, sync, issues, board render, projects render, agents page, audit log, logs
  • ✓ Addresses the checklist requirement

Evidence Provider Findings

No evidence providers configured — no findings to report.


Tool Harness Findings

No tool requests were executed. The PR description states npm test passes 53/53 tests (9 files), which includes the 5 new board tests and 1 new AuditLog test added by this PR.


Unknowns / Needs Verification

  1. CI green: The PR body shows - [ ] CI green on PR as a pending checklist item. This review assumes CI will pass based on local test results and the clean diff.

  2. Manual browser testing: Two manual items remain unchecked in the PR body:

    • "Open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards"
    • "Open /board?project=foo from an old bookmark, confirm nothing breaks"
  3. No breaking API change: The /api/issues route is unchanged (PR body states "zero blast radius outside the board UI"). Old ?project=foo URLs will silently ignore the project param — this is the intended behavior per issue Fix Board filters resetting and remove stale project-label filtering #42.


Summary

The PR correctly implements the Next 16 async searchParams fix for issue #42, removes the stale project filter, adds appropriate regression tests, fills the AuditLog test gap for #35, and documents the agent contract (#33) and migration checklist (#32). Code changes are minimal and focused. No violations of repository standards detected.

@joryirving
joryirving merged commit 590b529 into mainMay 14, 2026
3 checks passed
@joryirving
joryirving deleted the fix/board-filters-tests-docs branch May 14, 2026 22:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant

@joryirving
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(board): async searchParams; drop project filter; agent docs - #45

Merged
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs
May 14, 2026
Merged

fix(board): async searchParams; drop project filter; agent docs#45
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs

Conversation

@joryirving

Copy link
Copy Markdown
Contributor

Summary

Closes#42, #35, #33, #32. (#36 split out per discussion — schema change deserves its own PR.)

  • Fix Board filters resetting and remove stale project-label filtering #42 — Board filter dropdowns reset because searchParams is read synchronously in src/app/board/page.tsx, which is invalid under Next 16. Type searchParams as Promise<...> and await it. Remove the stale Project name text filter (repos are the project boundary, project/* labels aren't required). Rename Agent/Owner dropdowns to All agent labels / All owner labels with aria-label/title so the label-only filter behavior is explicit. Keep /api/issues API surface unchanged (zero blast radius outside the board UI).
  • Add regression tests for issue move validation and audit behavior #35route.test.ts already covers validation, label mutation shape, and success-path AuditLog. Adds the one missing case: AuditLog row written with success: false and the captured errorMessage when the GitHub mutation throws.
  • Define openclaw agent workflow contract for Mission Control #33 — New "OpenClaw Agent Workflow Contract" section in AGENTS.md: heartbeat lifecycle (best-effort /api/sync at start, /api/agent-runs at end), read path (/api/issues, prefer agent/* label assignment, treat no-status as backlog), source-of-truth rules (GitHub authoritative, Projects deprecated, no auto-close), failure modes (Mission Control failures don't fail the heartbeat, tokens are secrets), and auditability.
  • Add pre-openclaw agent migration runtime smoke checklist #32 — New "Pre-migration Smoke Checklist" section in README.md with a 10-step checklist (health, automation sync, repos, issue sync, issue read, board render, projects render, agent heartbeat visible, label-change audit row, no Prisma/BigInt/FK errors).
  • Adds a regression test (src/app/board/page.test.tsx) that calls BoardPage with Promise.resolve({...}) and asserts the Prisma query receives the resolved filter values. Catches sync-access reverts.

Test plan

  • npm run lint — clean
  • npm run typecheck — clean (after npx prisma generate, matching CI)
  • npm test — 53/53 passing (9 files)
  • CI green on PR
  • Manual: open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards
  • Manual: open /board?project=foo from an old bookmark, confirm nothing breaks (param is ignored silently)

🤖 Generated with Claude Code

…t docs
Closes#42, #35, #33, #32.
- #42: Board filters reset under Next 16 — type `searchParams` as a
Promise and `await` it before reading. Drop the stale `Project name`
text input since repos are the project boundary. Rename Agent/Owner
dropdowns to "All agent labels" / "All owner labels" with aria/title
text so the label-only behavior is obvious.
- #35: Add the one missing test for `/api/issues/move` — AuditLog row
written with success=false when the GitHub mutation throws.
- #33: Document the OpenClaw agent workflow contract in AGENTS.md
(heartbeat lifecycle, read path, source-of-truth rules, failure modes,
auditability).
- #32: Add a pre-migration smoke checklist to README.md so operators
can verify Mission Control end-to-end before flipping an agent's
workflow over.
Also adds a regression test for BoardPage searchParams handling so
sync-access reverts get caught.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@its-miso

its-misoBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Automated recommendation: APPROVE

Analysis engine: anthropic/MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic)

PR Review: fix(board): async searchParams; drop project filter; agent docs

Recommendation

Approve. This PR cleanly addresses all four linked issues (#42, #35, #33, #32) with correct implementation, appropriate test coverage, and documentation that follows repository conventions.


Change-by-Change Findings

1. src/app/board/page.tsx — Core fix for #42

  • searchParams type change: Changed from searchParams: { ... } to searchParams: Promise<{ ... }>
  • await usage: Added const params = await searchParams before accessing any params ✓
  • project filter removal: Removed project parameter from getIssues() and removed if (project) where.labels = { has: 'project/${project}' }
  • activeFilters: Removed project from the filter object passed to FilterBar ✓

This matches the Next 16 pattern shown in issue #42's "Likely fix direction" section.

2. src/components/filter-bar.tsx — UX improvements for #42

  • Project Input removed: The Input component for "Project name" was removed ✓
  • aria-label and title added: Agent dropdown gets "Filter by agent label" + "Filters by agent/* label only"; Owner dropdown gets equivalent ✓
  • Option text renamed: "All Agents" → "All agent labels", "All Owners" → "All owner labels" ✓

This addresses the acceptance criterion "Decide and document Agent/Owner filter behavior: either label-only by design, with clear UI text."

3. src/app/board/page.test.tsx — Regression test for #42 (NEW FILE)

  • 5 test cases covering repo, agent, owner, priority filters, and empty params
  • Mocks Prisma queries and verifies the where clause passed to findMany
  • Uses Promise.resolve({...}) to simulate Next 16 async searchParams ✓

4. src/app/api/issues/move/route.test.ts — AuditLog test for #35

  • Adds test case: it("writes an AuditLog entry with success=false when the GitHub mutation fails")
  • Mocks removeIssueLabel.mockRejectedValueOnce(new Error("github 500"))
  • Verifies createAuditLog called with success: false and errorMessage: "github 500"

5. AGENTS.md — OpenClaw Agent Workflow Contract for #33

  • 11-point contract covering heartbeat lifecycle, read path, source of truth, failure modes, and auditability
  • Language is generic (uses agent/*, not specific agent names) per AGENTS.md Code Standards ✓
  • Consistent with existing codebase patterns (e.g., token names MISSION_CONTROL_AGENT_TOKEN, /api/sync, /api/agent-runs)

6. README.md — Pre-migration Smoke Checklist for #32

  • 10-step checklist using curl commands and browser/manual steps
  • Ends with: "Only flip the agent's workflow over once all ten steps pass." ✓

Standards Compliance

StandardStatus
Next 16 async searchParams pattern✓ Correctly implemented with Promise<...> type and await
Generic agent names in docs (AGENTS.md Code Standard #1)✓ Uses agent/* pattern, not specific names
Error handling (error instanceof Error)✓ PR body and tests use new Error() pattern
Test coverage for acceptance criteria✓ Regression tests added for board filters
No commit of secrets✓ No .env or secrets in changes

Linked Issue Fit

#42 — Board filters resetting (Primary)

Acceptance CriterionStatus
Uses Next-compatible async searchParamsPromise<{...}> + await
Selecting a repo keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Selecting a priority keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Filtering changes the issue set✓ Prisma where clause built from params; test verifies
Clear filter with "All *" option"All agent labels" / "All owner labels" remain valid clear options
Regression tests for board search params✓ New 78-line test file with 5 cases
Agent/Owner filter behavior documented in UIaria-label + title attributes + renamed options
Remove stale Project filter✓ Removed from page.tsx, getIssues(), FilterBar

#35 — AuditLog on GitHub mutation failure

  • Test added: "writes an AuditLog entry with success=false when the GitHub mutation fails"
  • Verifies createAuditLog called with success: false and errorMessage
  • ✓ Matches the gap identified in the issue

#33 — Agent Workflow Contract

  • New "OpenClaw Agent Workflow Contract" section in AGENTS.md
  • Covers heartbeat lifecycle, read path, source of truth, failure modes, auditability
  • ✓ Addresses the missing documentation

#32 — Pre-migration Smoke Checklist

  • New 10-step checklist in README.md
  • Covers health, sync, issues, board render, projects render, agents page, audit log, logs
  • ✓ Addresses the checklist requirement

Evidence Provider Findings

No evidence providers configured — no findings to report.


Tool Harness Findings

No tool requests were executed. The PR description states npm test passes 53/53 tests (9 files), which includes the 5 new board tests and 1 new AuditLog test added by this PR.


Unknowns / Needs Verification

  1. CI green: The PR body shows - [ ] CI green on PR as a pending checklist item. This review assumes CI will pass based on local test results and the clean diff.

  2. Manual browser testing: Two manual items remain unchecked in the PR body:

    • "Open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards"
    • "Open /board?project=foo from an old bookmark, confirm nothing breaks"
  3. No breaking API change: The /api/issues route is unchanged (PR body states "zero blast radius outside the board UI"). Old ?project=foo URLs will silently ignore the project param — this is the intended behavior per issue Fix Board filters resetting and remove stale project-label filtering #42.


Summary

The PR correctly implements the Next 16 async searchParams fix for issue #42, removes the stale project filter, adds appropriate regression tests, fills the AuditLog test gap for #35, and documents the agent contract (#33) and migration checklist (#32). Code changes are minimal and focused. No violations of repository standards detected.

@joryirving
joryirving merged commit 590b529 into mainMay 14, 2026
3 checks passed
@joryirving
joryirving deleted the fix/board-filters-tests-docs branch May 14, 2026 22:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant

@joryirving
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

fix(board): async searchParams; drop project filter; agent docs - #45

Merged
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs
May 14, 2026
Merged

fix(board): async searchParams; drop project filter; agent docs#45
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs

Conversation

@joryirving

Copy link
Copy Markdown
Contributor

Summary

Closes#42, #35, #33, #32. (#36 split out per discussion — schema change deserves its own PR.)

  • Fix Board filters resetting and remove stale project-label filtering #42 — Board filter dropdowns reset because searchParams is read synchronously in src/app/board/page.tsx, which is invalid under Next 16. Type searchParams as Promise<...> and await it. Remove the stale Project name text filter (repos are the project boundary, project/* labels aren't required). Rename Agent/Owner dropdowns to All agent labels / All owner labels with aria-label/title so the label-only filter behavior is explicit. Keep /api/issues API surface unchanged (zero blast radius outside the board UI).
  • Add regression tests for issue move validation and audit behavior #35route.test.ts already covers validation, label mutation shape, and success-path AuditLog. Adds the one missing case: AuditLog row written with success: false and the captured errorMessage when the GitHub mutation throws.
  • Define openclaw agent workflow contract for Mission Control #33 — New "OpenClaw Agent Workflow Contract" section in AGENTS.md: heartbeat lifecycle (best-effort /api/sync at start, /api/agent-runs at end), read path (/api/issues, prefer agent/* label assignment, treat no-status as backlog), source-of-truth rules (GitHub authoritative, Projects deprecated, no auto-close), failure modes (Mission Control failures don't fail the heartbeat, tokens are secrets), and auditability.
  • Add pre-openclaw agent migration runtime smoke checklist #32 — New "Pre-migration Smoke Checklist" section in README.md with a 10-step checklist (health, automation sync, repos, issue sync, issue read, board render, projects render, agent heartbeat visible, label-change audit row, no Prisma/BigInt/FK errors).
  • Adds a regression test (src/app/board/page.test.tsx) that calls BoardPage with Promise.resolve({...}) and asserts the Prisma query receives the resolved filter values. Catches sync-access reverts.

Test plan

  • npm run lint — clean
  • npm run typecheck — clean (after npx prisma generate, matching CI)
  • npm test — 53/53 passing (9 files)
  • CI green on PR
  • Manual: open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards
  • Manual: open /board?project=foo from an old bookmark, confirm nothing breaks (param is ignored silently)

🤖 Generated with Claude Code

…t docs
Closes#42, #35, #33, #32.
- #42: Board filters reset under Next 16 — type `searchParams` as a
Promise and `await` it before reading. Drop the stale `Project name`
text input since repos are the project boundary. Rename Agent/Owner
dropdowns to "All agent labels" / "All owner labels" with aria/title
text so the label-only behavior is obvious.
- #35: Add the one missing test for `/api/issues/move` — AuditLog row
written with success=false when the GitHub mutation throws.
- #33: Document the OpenClaw agent workflow contract in AGENTS.md
(heartbeat lifecycle, read path, source-of-truth rules, failure modes,
auditability).
- #32: Add a pre-migration smoke checklist to README.md so operators
can verify Mission Control end-to-end before flipping an agent's
workflow over.
Also adds a regression test for BoardPage searchParams handling so
sync-access reverts get caught.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@its-miso

its-misoBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Automated recommendation: APPROVE

Analysis engine: anthropic/MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic)

PR Review: fix(board): async searchParams; drop project filter; agent docs

Recommendation

Approve. This PR cleanly addresses all four linked issues (#42, #35, #33, #32) with correct implementation, appropriate test coverage, and documentation that follows repository conventions.


Change-by-Change Findings

1. src/app/board/page.tsx — Core fix for #42

  • searchParams type change: Changed from searchParams: { ... } to searchParams: Promise<{ ... }>
  • await usage: Added const params = await searchParams before accessing any params ✓
  • project filter removal: Removed project parameter from getIssues() and removed if (project) where.labels = { has: 'project/${project}' }
  • activeFilters: Removed project from the filter object passed to FilterBar ✓

This matches the Next 16 pattern shown in issue #42's "Likely fix direction" section.

2. src/components/filter-bar.tsx — UX improvements for #42

  • Project Input removed: The Input component for "Project name" was removed ✓
  • aria-label and title added: Agent dropdown gets "Filter by agent label" + "Filters by agent/* label only"; Owner dropdown gets equivalent ✓
  • Option text renamed: "All Agents" → "All agent labels", "All Owners" → "All owner labels" ✓

This addresses the acceptance criterion "Decide and document Agent/Owner filter behavior: either label-only by design, with clear UI text."

3. src/app/board/page.test.tsx — Regression test for #42 (NEW FILE)

  • 5 test cases covering repo, agent, owner, priority filters, and empty params
  • Mocks Prisma queries and verifies the where clause passed to findMany
  • Uses Promise.resolve({...}) to simulate Next 16 async searchParams ✓

4. src/app/api/issues/move/route.test.ts — AuditLog test for #35

  • Adds test case: it("writes an AuditLog entry with success=false when the GitHub mutation fails")
  • Mocks removeIssueLabel.mockRejectedValueOnce(new Error("github 500"))
  • Verifies createAuditLog called with success: false and errorMessage: "github 500"

5. AGENTS.md — OpenClaw Agent Workflow Contract for #33

  • 11-point contract covering heartbeat lifecycle, read path, source of truth, failure modes, and auditability
  • Language is generic (uses agent/*, not specific agent names) per AGENTS.md Code Standards ✓
  • Consistent with existing codebase patterns (e.g., token names MISSION_CONTROL_AGENT_TOKEN, /api/sync, /api/agent-runs)

6. README.md — Pre-migration Smoke Checklist for #32

  • 10-step checklist using curl commands and browser/manual steps
  • Ends with: "Only flip the agent's workflow over once all ten steps pass." ✓

Standards Compliance

StandardStatus
Next 16 async searchParams pattern✓ Correctly implemented with Promise<...> type and await
Generic agent names in docs (AGENTS.md Code Standard #1)✓ Uses agent/* pattern, not specific names
Error handling (error instanceof Error)✓ PR body and tests use new Error() pattern
Test coverage for acceptance criteria✓ Regression tests added for board filters
No commit of secrets✓ No .env or secrets in changes

Linked Issue Fit

#42 — Board filters resetting (Primary)

Acceptance CriterionStatus
Uses Next-compatible async searchParamsPromise<{...}> + await
Selecting a repo keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Selecting a priority keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Filtering changes the issue set✓ Prisma where clause built from params; test verifies
Clear filter with "All *" option"All agent labels" / "All owner labels" remain valid clear options
Regression tests for board search params✓ New 78-line test file with 5 cases
Agent/Owner filter behavior documented in UIaria-label + title attributes + renamed options
Remove stale Project filter✓ Removed from page.tsx, getIssues(), FilterBar

#35 — AuditLog on GitHub mutation failure

  • Test added: "writes an AuditLog entry with success=false when the GitHub mutation fails"
  • Verifies createAuditLog called with success: false and errorMessage
  • ✓ Matches the gap identified in the issue

#33 — Agent Workflow Contract

  • New "OpenClaw Agent Workflow Contract" section in AGENTS.md
  • Covers heartbeat lifecycle, read path, source of truth, failure modes, auditability
  • ✓ Addresses the missing documentation

#32 — Pre-migration Smoke Checklist

  • New 10-step checklist in README.md
  • Covers health, sync, issues, board render, projects render, agents page, audit log, logs
  • ✓ Addresses the checklist requirement

Evidence Provider Findings

No evidence providers configured — no findings to report.


Tool Harness Findings

No tool requests were executed. The PR description states npm test passes 53/53 tests (9 files), which includes the 5 new board tests and 1 new AuditLog test added by this PR.


Unknowns / Needs Verification

  1. CI green: The PR body shows - [ ] CI green on PR as a pending checklist item. This review assumes CI will pass based on local test results and the clean diff.

  2. Manual browser testing: Two manual items remain unchecked in the PR body:

    • "Open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards"
    • "Open /board?project=foo from an old bookmark, confirm nothing breaks"
  3. No breaking API change: The /api/issues route is unchanged (PR body states "zero blast radius outside the board UI"). Old ?project=foo URLs will silently ignore the project param — this is the intended behavior per issue Fix Board filters resetting and remove stale project-label filtering #42.


Summary

The PR correctly implements the Next 16 async searchParams fix for issue #42, removes the stale project filter, adds appropriate regression tests, fills the AuditLog test gap for #35, and documents the agent contract (#33) and migration checklist (#32). Code changes are minimal and focused. No violations of repository standards detected.

@joryirving
joryirving merged commit 590b529 into mainMay 14, 2026
3 checks passed
@joryirving
joryirving deleted the fix/board-filters-tests-docs branch May 14, 2026 22:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant

@joryirving
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

fix(board): async searchParams; drop project filter; agent docs - #45

Merged
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs
May 14, 2026
Merged

fix(board): async searchParams; drop project filter; agent docs#45
joryirving merged 1 commit into
mainfrom
fix/board-filters-tests-docs

Conversation

@joryirving

Copy link
Copy Markdown
Contributor

Summary

Closes#42, #35, #33, #32. (#36 split out per discussion — schema change deserves its own PR.)

  • Fix Board filters resetting and remove stale project-label filtering #42 — Board filter dropdowns reset because searchParams is read synchronously in src/app/board/page.tsx, which is invalid under Next 16. Type searchParams as Promise<...> and await it. Remove the stale Project name text filter (repos are the project boundary, project/* labels aren't required). Rename Agent/Owner dropdowns to All agent labels / All owner labels with aria-label/title so the label-only filter behavior is explicit. Keep /api/issues API surface unchanged (zero blast radius outside the board UI).
  • Add regression tests for issue move validation and audit behavior #35route.test.ts already covers validation, label mutation shape, and success-path AuditLog. Adds the one missing case: AuditLog row written with success: false and the captured errorMessage when the GitHub mutation throws.
  • Define openclaw agent workflow contract for Mission Control #33 — New "OpenClaw Agent Workflow Contract" section in AGENTS.md: heartbeat lifecycle (best-effort /api/sync at start, /api/agent-runs at end), read path (/api/issues, prefer agent/* label assignment, treat no-status as backlog), source-of-truth rules (GitHub authoritative, Projects deprecated, no auto-close), failure modes (Mission Control failures don't fail the heartbeat, tokens are secrets), and auditability.
  • Add pre-openclaw agent migration runtime smoke checklist #32 — New "Pre-migration Smoke Checklist" section in README.md with a 10-step checklist (health, automation sync, repos, issue sync, issue read, board render, projects render, agent heartbeat visible, label-change audit row, no Prisma/BigInt/FK errors).
  • Adds a regression test (src/app/board/page.test.tsx) that calls BoardPage with Promise.resolve({...}) and asserts the Prisma query receives the resolved filter values. Catches sync-access reverts.

Test plan

  • npm run lint — clean
  • npm run typecheck — clean (after npx prisma generate, matching CI)
  • npm test — 53/53 passing (9 files)
  • CI green on PR
  • Manual: open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards
  • Manual: open /board?project=foo from an old bookmark, confirm nothing breaks (param is ignored silently)

🤖 Generated with Claude Code

…t docs
Closes#42, #35, #33, #32.
- #42: Board filters reset under Next 16 — type `searchParams` as a
Promise and `await` it before reading. Drop the stale `Project name`
text input since repos are the project boundary. Rename Agent/Owner
dropdowns to "All agent labels" / "All owner labels" with aria/title
text so the label-only behavior is obvious.
- #35: Add the one missing test for `/api/issues/move` — AuditLog row
written with success=false when the GitHub mutation throws.
- #33: Document the OpenClaw agent workflow contract in AGENTS.md
(heartbeat lifecycle, read path, source-of-truth rules, failure modes,
auditability).
- #32: Add a pre-migration smoke checklist to README.md so operators
can verify Mission Control end-to-end before flipping an agent's
workflow over.
Also adds a regression test for BoardPage searchParams handling so
sync-access reverts get caught.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@its-miso

its-misoBot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Automated recommendation: APPROVE

Analysis engine: anthropic/MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic)

PR Review: fix(board): async searchParams; drop project filter; agent docs

Recommendation

Approve. This PR cleanly addresses all four linked issues (#42, #35, #33, #32) with correct implementation, appropriate test coverage, and documentation that follows repository conventions.


Change-by-Change Findings

1. src/app/board/page.tsx — Core fix for #42

  • searchParams type change: Changed from searchParams: { ... } to searchParams: Promise<{ ... }>
  • await usage: Added const params = await searchParams before accessing any params ✓
  • project filter removal: Removed project parameter from getIssues() and removed if (project) where.labels = { has: 'project/${project}' }
  • activeFilters: Removed project from the filter object passed to FilterBar ✓

This matches the Next 16 pattern shown in issue #42's "Likely fix direction" section.

2. src/components/filter-bar.tsx — UX improvements for #42

  • Project Input removed: The Input component for "Project name" was removed ✓
  • aria-label and title added: Agent dropdown gets "Filter by agent label" + "Filters by agent/* label only"; Owner dropdown gets equivalent ✓
  • Option text renamed: "All Agents" → "All agent labels", "All Owners" → "All owner labels" ✓

This addresses the acceptance criterion "Decide and document Agent/Owner filter behavior: either label-only by design, with clear UI text."

3. src/app/board/page.test.tsx — Regression test for #42 (NEW FILE)

  • 5 test cases covering repo, agent, owner, priority filters, and empty params
  • Mocks Prisma queries and verifies the where clause passed to findMany
  • Uses Promise.resolve({...}) to simulate Next 16 async searchParams ✓

4. src/app/api/issues/move/route.test.ts — AuditLog test for #35

  • Adds test case: it("writes an AuditLog entry with success=false when the GitHub mutation fails")
  • Mocks removeIssueLabel.mockRejectedValueOnce(new Error("github 500"))
  • Verifies createAuditLog called with success: false and errorMessage: "github 500"

5. AGENTS.md — OpenClaw Agent Workflow Contract for #33

  • 11-point contract covering heartbeat lifecycle, read path, source of truth, failure modes, and auditability
  • Language is generic (uses agent/*, not specific agent names) per AGENTS.md Code Standards ✓
  • Consistent with existing codebase patterns (e.g., token names MISSION_CONTROL_AGENT_TOKEN, /api/sync, /api/agent-runs)

6. README.md — Pre-migration Smoke Checklist for #32

  • 10-step checklist using curl commands and browser/manual steps
  • Ends with: "Only flip the agent's workflow over once all ten steps pass." ✓

Standards Compliance

StandardStatus
Next 16 async searchParams pattern✓ Correctly implemented with Promise<...> type and await
Generic agent names in docs (AGENTS.md Code Standard #1)✓ Uses agent/* pattern, not specific names
Error handling (error instanceof Error)✓ PR body and tests use new Error() pattern
Test coverage for acceptance criteria✓ Regression tests added for board filters
No commit of secrets✓ No .env or secrets in changes

Linked Issue Fit

#42 — Board filters resetting (Primary)

Acceptance CriterionStatus
Uses Next-compatible async searchParamsPromise<{...}> + await
Selecting a repo keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Selecting a priority keeps selection after navigation✓ Fixed by async params; regression test verifies Prisma query
Filtering changes the issue set✓ Prisma where clause built from params; test verifies
Clear filter with "All *" option"All agent labels" / "All owner labels" remain valid clear options
Regression tests for board search params✓ New 78-line test file with 5 cases
Agent/Owner filter behavior documented in UIaria-label + title attributes + renamed options
Remove stale Project filter✓ Removed from page.tsx, getIssues(), FilterBar

#35 — AuditLog on GitHub mutation failure

  • Test added: "writes an AuditLog entry with success=false when the GitHub mutation fails"
  • Verifies createAuditLog called with success: false and errorMessage
  • ✓ Matches the gap identified in the issue

#33 — Agent Workflow Contract

  • New "OpenClaw Agent Workflow Contract" section in AGENTS.md
  • Covers heartbeat lifecycle, read path, source of truth, failure modes, auditability
  • ✓ Addresses the missing documentation

#32 — Pre-migration Smoke Checklist

  • New 10-step checklist in README.md
  • Covers health, sync, issues, board render, projects render, agents page, audit log, logs
  • ✓ Addresses the checklist requirement

Evidence Provider Findings

No evidence providers configured — no findings to report.


Tool Harness Findings

No tool requests were executed. The PR description states npm test passes 53/53 tests (9 files), which includes the 5 new board tests and 1 new AuditLog test added by this PR.


Unknowns / Needs Verification

  1. CI green: The PR body shows - [ ] CI green on PR as a pending checklist item. This review assumes CI will pass based on local test results and the clean diff.

  2. Manual browser testing: Two manual items remain unchecked in the PR body:

    • "Open /board, pick a repo from the dropdown, confirm it sticks across reload and filters the cards"
    • "Open /board?project=foo from an old bookmark, confirm nothing breaks"
  3. No breaking API change: The /api/issues route is unchanged (PR body states "zero blast radius outside the board UI"). Old ?project=foo URLs will silently ignore the project param — this is the intended behavior per issue Fix Board filters resetting and remove stale project-label filtering #42.


Summary

The PR correctly implements the Next 16 async searchParams fix for issue #42, removes the stale project filter, adds appropriate regression tests, fills the AuditLog test gap for #35, and documents the agent contract (#33) and migration checklist (#32). Code changes are minimal and focused. No violations of repository standards detected.

@joryirving
joryirving merged commit 590b529 into mainMay 14, 2026
3 checks passed
@joryirving
joryirving deleted the fix/board-filters-tests-docs branch May 14, 2026 22:21
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant

@joryirving