Skip to content

manager: Add unique workers batches and task report handling#101

Open
MiggySmallz wants to merge 2 commits into
mainfrom
manager-task-fix
Open

manager: Add unique workers batches and task report handling#101
MiggySmallz wants to merge 2 commits into
mainfrom
manager-task-fix

Conversation

@MiggySmallz
Copy link
Copy Markdown
Member

Unique Workers & Report Flow

Overview

This PR adds a Unique Workers mode to CSV task steps and fixes how reported tasks are handled throughout the system.


Changes

Unique Workers

A new "Unique workers" toggle on the task step settings form. When enabled, each worker can only complete one task per import batch. Once they finish a task, they're locked out of the remaining tasks in that batch. Rejecting or reporting a task does not count; the worker stays eligible and will receive another task.

This ensures data quality for tasks where you want a different person answering each row.

  • Works with CSV data sources only. The toggle disables and unchecks itself automatically when a different data source is selected.
  • Each batch is scoped to a single import run. A worker locked out of batch 1 is fully eligible again in batch 2.

Files: core/protobufs/src/task/task.proto, core/protobufs/src/effect.ts, apps/task-poster/src/fetcher.ts, modules/manager/src/modules/createWorkerManager.ts, modules/manager/src/modules/createTaskManager.ts


Report Flow Fix

Previously, when a worker clicked Report on a task (flagging it as broken or unsuitable), they were permanently locked out of the rest of that batch, the same as if they had completed a task. This was a bug.

Now:

  • The reporting worker stays eligible and receives the next available task from the batch.
  • The reported task is filed as done so the task poster clears it from the active count.
  • The reported task's content (issue type and message) appears in the results table alongside normal submissions.

Files: modules/manager/src/stores/managerTaskStore.ts, modules/manager/src/modules/createTaskManager.ts, modules/manager/src/main.ts, apps/task-poster/src/fetcher.ts


Task List Refresh Fix

Workers sometimes had to manually refresh the page to see a newly assigned task. This was a timing issue.. the app was only starting to listen for new tasks after the page finished loading, so tasks assigned during that window were missed.

The app now starts listening as soon as the connection to the manager is ready.

Files: apps/worker-app/app/composables/useTasks.ts

@MiggySmallz MiggySmallz requested a review from jeisses June 3, 2026 02:48
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worker-app Ready Ready Preview, Comment Jun 4, 2026 3:12pm
3 Skipped Deployments
Project Deployment Actions Updated (UTC)
migration-app Skipped Skipped Jun 4, 2026 3:12pm
staking-app Skipped Skipped Jun 4, 2026 3:12pm
website-frontend Skipped Skipped Jun 4, 2026 3:12pm

Request Review

@jeisses
Copy link
Copy Markdown
Member

jeisses commented Jun 3, 2026

I think this mostly works @MiggySmallz . I left a couple of comments / questions

There is 1 major addition I'd like to add to this code, as this would be the right time to do that:

Instead of having a boolean "uniqueWorker", we might as well implement the concept of "repetitions":

  • repetitions define how many times a worker may do a task in a batch (unique(boolean) = only once, repetition(int) = a worker may do max 3 tasks in this batch).
  • So a reptition of 1 is the same functionality as implemented in this MR. A repetition of 0 means no limit (false)
  • I believe it basically means flipping the boolean to an int and renaming the field.

fit's a minor adjustment, but it does impact the data layout which means it's hard to add later. And it allows for a important feature

Does that make sense?

Otherwise nice MR. Thanks!

@vercel vercel Bot temporarily deployed to Preview – migration-app June 4, 2026 15:11 Inactive
@vercel vercel Bot temporarily deployed to Preview – website-frontend June 4, 2026 15:11 Inactive
@vercel vercel Bot temporarily deployed to Preview – staking-app June 4, 2026 15:11 Inactive
@MiggySmallz
Copy link
Copy Markdown
Member Author

@jeisses The latest commit changes the uniqueWorkers flag from binary to a numeric repetitions field where worker repetitions are as follows:

0 = Can complete Unlimited tasks per batch
1 = Can ONLY complete 1 task per batch (Used for surveys and other tasks of similar nature)
n = Can complete n number of tasks per batch

Anything besides 0 or 1 will most likely be rarely used, but the infrastructure is there now anyway.

Also, I added a --repetitions <count> option (default 0) to the task post command in the CLI which fixes a build error introduced by the proto change.

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