Skip to content

MVP P0/P1: pending-run execution, auth, and operator workflow - #4

Merged
cursor[bot] merged 6 commits into
mainfrom
cursor/mvp-p0-p1-722a
Jul 21, 2026
Merged

cursor[bot] merged 6 commits into
mainfrom
cursor/mvp-p0-p1-722a

Conversation

@suporterfid

@suporterfid suporterfid commented Jul 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

Implements the P0/P1 MVP hardening plan so TaskConnect can meet acceptance criteria in docs/http-task-scheduler-spec.md §28 for core workflow and operability.

P0

  • Claim and execute pending manual/test/retry runs via cron (PendingRunClaimer)
  • Fix task/run authorization for roles and API keys (tasks:read|write|operate)
  • Wire failure emails on terminal dead runs
  • Block writes in archived environments
  • Complete retention pruning; keep StaleClaimRecovery as the authoritative stale-claim path

P1

  • Align SPA types/error parsing with API contracts; tenant-scoped data reload
  • Secrets UI, expanded task wizard/detail lifecycle actions
  • Run diagnostics + dashboard operability + platform-health gating
  • Password reset pages
  • User preferences API (PATCH /me/preferences) + settings UI
  • Audit log read API + settings/audit pages

Plan

  • Spec: docs/superpowers/specs/2026-07-21-mvp-p0-p1-design.md
  • Plan: docs/superpowers/plans/2026-07-21-mvp-p0-p1.md

Verification

  • PHPUnit Feature+Unit: 99 passed
  • Vitest: 12 passed
  • Frontend production build (vue-tsc + Vite): passed
  • Docker/tc unavailable in this environment (host PHPUnit used)

Test plan

  • Manual: login → secret → profile → task → activate → run-now → cron/pending claim → inspect attempts
  • Confirm read-only viewer cannot operate tasks/runs
  • Confirm archived environment rejects task create
  • Confirm dead-run failure email when enabled
  • Confirm settings locale/timezone sync and audit log listing
Open in Web Open in Cursor 

Capture the pending-run execution gap, auth fixes, failure
notifications, archived-env guards, and operator SPA work needed
for v1 MVP acceptance.

Co-authored-by: suporterfid <suporterfid@gmail.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the MVP P0/P1 implementation plan and design specifications for TaskConnect, outlining the roadmap for pending run execution, authorization, failure notifications, archived environments, and frontend operator workflows. The feedback suggests decoupling scheduled task execution from manual/test/retry run execution by defining a dedicated executePending() method in SchedulerCycleRunner instead of invoking PendingRunClaimer directly inside executeDue(), ensuring that metrics, logging, and heartbeat counts remain distinct and easier to monitor.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.


### 1. Pending run execution

Add `PendingRunClaimer` that claims `task_runs` in `run_state=pending` with a pending attempt (manual, test, and manual-retry paths). Invoke it from `SchedulerCycleRunner::executeDue()` after due-task claiming so one cron minute drains both scheduled and pending work.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Invoking PendingRunClaimer directly inside SchedulerCycleRunner::executeDue() couples scheduled task execution with manual/test/retry run execution. This can make monitoring, logging, and heartbeat metrics (such as scheduler.execute_due) confusing or inaccurate, as they will conflate scheduled runs with manual/test runs. Consider defining a separate method (such as executePending()) in SchedulerCycleRunner and calling both sequentially from the cron/console command. This keeps the execution statistics, heartbeats, and responsibilities clearly separated.

Suggested change
Add `PendingRunClaimer` that claims `task_runs` in `run_state=pending` with a pending attempt (manual, test, and manual-retry paths). Invoke it from `SchedulerCycleRunner::executeDue()` after due-task claiming so one cron minute drains both scheduled and pending work.
Add PendingRunClaimer that claims task_runs in run_state=pending with a pending attempt (manual, test, and manual-retry paths). Invoke it via a dedicated method (e.g., executePending()) in SchedulerCycleRunner called sequentially from the cron runner so one cron minute drains both scheduled and pending work while keeping metrics and heartbeats distinct.

**Steps:**
1. Write failing feature test: `queueManualRun` → `PendingRunClaimer::claim` → `AttemptExecutor` → `run_state=succeeded`.
2. Implement claimer (lock pending runs, claim pending attempt, return `ClaimedAttempt`).
3. Call claimer from `executeDue()` after due tasks; record heartbeat counts.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Instead of calling the claimer inside executeDue(), consider keeping scheduled and pending run execution separate by defining a dedicated method (such as executePending()) in SchedulerCycleRunner. This ensures that heartbeat counts and execution metrics remain distinct and easier to monitor.

Suggested change
3. Call claimer from `executeDue()` after due tasks; record heartbeat counts.
3. Call claimer from a new executePending() method in SchedulerCycleRunner called sequentially after executeDue(); record distinct heartbeat counts.

cursoragent and others added 5 commits July 21, 2026 18:23
Pending runs created by queueManualRun, queueTestRun, and manualRetry
never executed because the cycle only claimed due tasks and retry_wait.
Add PendingRunClaimer, wire it into executeDue after due-task execution,
and notify admins via FailureNotifier when a run becomes dead.

Co-authored-by: suporterfid <suporterfid@gmail.com>
Refactor TaskPolicy/TaskRunPolicy onto Authenticatable + tenant access
helpers. Cancel/retry require operate (admin/member or tasks:operate),
closing the read_only_viewer hole. Allow tasks:read|write|operate on API keys.

Co-authored-by: suporterfid <suporterfid@gmail.com>
Guard task/secret/profile/api-key creates (and task activate/resume/run/
test) against archived environments. Extend RetentionCleaner to prune
attempt metadata, run summaries, and audit logs; drop duplicate stale
attempt interruption. Fix TaskResource schedule_human to use fromConfig.

Co-authored-by: suporterfid <suporterfid@gmail.com>
Align frontend types and error parsing with API resources, reload data
on tenant/environment change, and fill operator workflow pages (secrets,
task lifecycle/wizard schedules, run diagnostics, dashboard heartbeat,
platform health for admins, password reset, and locale settings).

Co-authored-by: suporterfid <suporterfid@gmail.com>
Expose PATCH /me/preferences and tenant audit-log listing, wire the
settings/audit SPA surfaces, and sync locale from /me on login.

Co-authored-by: suporterfid <suporterfid@gmail.com>
@suporterfid
suporterfid marked this pull request as ready for review July 21, 2026 18:37
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@cursor

cursor Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

CI failure investigation

The failing CI / verify check is not a code failure.

GitHub Actions annotation on the job:

The job was not started because recent account payments have failed or your spending limit needs to be increased. Please check the 'Billing & plans' section in your settings

Evidence:

  • Job completed in ~19s with zero steps executed
  • Same billing block also affected earlier runs on this branch (and previously on main)
  • No test/build logs exist because the runner never started

Local verification on the PR head (c21463f) is green:

  • PHPUnit: 99 passed
  • Vitest: 12 passed
  • Frontend production build (vue-tsc + Vite): passed

Action needed: restore GitHub Actions billing / raise the spending limit on the suporterfid account (or org), then re-run the workflow. No application code change can unblock this check.

@cursor
cursor Bot merged commit cac3a1b into main Jul 21, 2026
1 check failed
@cursor
cursor Bot deleted the cursor/mvp-p0-p1-722a branch July 21, 2026 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants