feat(TaskManager v6): task deadlines + expired-claim takeover#174
Open
hudsonhrh wants to merge 1 commit into
Open
feat(TaskManager v6): task deadlines + expired-claim takeover#174hudsonhrh wants to merge 1 commit into
hudsonhrh wants to merge 1 commit into
Conversation
Core (append-only Task fields; pre-v6 tasks read zeros = no deadlines):
- absoluteDeadline (uint48) + completionWindow (uint32) packed into the
bountyToken slot; claimDeadline (uint48) derived per claim in slot 5.
- Lenient enforcement: submitTask is never deadline-blocked. An expired
claim (claimDeadline or absoluteDeadline strictly past while CLAIMED)
loses protection - claimTask/assignTask/approveApplication take the task
over in one tx (TaskClaimExpired + lifecycle event + fresh window).
applyForTask accepts applications on expired claims; rejectTask restarts
the window; updateTask edits both knobs (past absoluteDeadline allowed on
update: the admin unstick lever for abandoned claims, incl. pre-v6 ones;
create paths revert InvalidDeadline on non-future values).
- New events: TaskDeadlinesSet, TaskClaimDeadlineSet, TaskClaimExpired.
Existing event signatures untouched; emission ordering documented in
docs/TASK_MANAGER.md for the subgraph.
- Selector replacements (paymaster + frontend ship in lockstep):
createTask 0x22fa79bc->0x4d0265d4, createTasksBatch 0xc18aa1c9->0xf31d148f,
createAndAssignTask 0xaf425951->0x98e30e89, updateTask 0x48db6f65->0xb7c288e8
- OrgDeployer: v6 selector strings in _appendTaskManagerRules (count 43).
- TaskManagerLens: 10-field task tuple, new TASK_DEADLINES key, version v2.
Tests: new TaskManagerDeadlineTest (37 cases incl. fuzz expiry boundary and
claim-start-preserving window arithmetic); DeployerTest asserts the v6
selectors in the deploy-time whitelist. Full suite: 1419 passed.
Scripts (sim-first per CLAUDE.md; all 7 sims fork-run to PASS under
FOUNDRY_PROFILE=production):
- upgrades/UpgradeTaskManagerDeadlines: 3-step cross-chain upgrade; v6
probed FREE (registry + CREATE2) on Gnosis AND Arbitrum; DryRuns on both
chains exercise live proxies end-to-end (pre-v6 zero-state, born-expired
revert, window start, expiry boundary, takeover, lenient late submit,
window arithmetic, deadline-less protection).
- upgrades/UpgradeOrgDeployerDeadlineRules: OrgDeployer v15 (probed FREE).
- fixes/WhitelistTaskDeadlineRules{Poa,Test6Kubi,DecentralPark}ViaGovernance:
per-org proposals allowing the 4 v6 selectors and disallowing the 4 dead
v5 ones; sims run create->vote->warp->announceWinner and assert getRule.
Known limitation: FOUNDRY_PROFILE=production forge build (with tests) hits
a YulException stack-too-deep in test/DeployerTest.t.sol from optimizer-on
inlining pressure in that giant test contract. The CI gate (default
profile) is green; src + scripts compile clean under production; sims run
with --skip test. Not load-bearing for broadcast artifacts.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
TaskManager v6 adds task deadlines with a lenient takeover model — part 1 of a 3-repo feature (contracts → subgraph → frontend).
Three deadline fields per task (all optional,
0= unset; append-only — pre-v6 tasks read zeros, no migration):absoluteDeadlineuint48unixcompletionWindowuint32secclaimDeadlineuint48unixclaimTime + window, recomputed at claim/assign/approve/rejectA fourth, soft due date lives only in IPFS task metadata (
dueDate) — display-only, no contract involvement (frontend/subgraph PRs).Lenient enforcement
submitTaskis never deadline-blocked — late work can be submitted (and paid) until someone actually takes the task over.claimTask/assignTask/approveApplication— emitsTaskClaimExpired(id, previousClaimer, newClaimer)then the usual lifecycle event; new claimer gets a fresh window. No separate unclaim function.applyForTasknow also accepts applications while CLAIMED-and-expired (otherwise application-gated tasks could only be taken over by the original applicant pool).rejectTaskrestarts the window (fresh allowance for rework). SUBMITTED tasks are never takeover-able.updateTaskedits both knobs; window edits preserve the original claim start. A pastabsoluteDeadlineis deliberately accepted on update — the only unstick lever for abandoned CLAIMED tasks (cancelTaskis UNCLAIMED-only), incl. all pre-v6 ones. Create paths revertInvalidDeadlinefor non-future values.Selector replacements (paymaster + frontend ship in lockstep)
0x22fa79bc0x4d0265d40xc18aa1c90xf31d148f0xaf4259510x98e30e890x48db6f650xb7c288e8New events (existing signatures untouched; ordering documented in
docs/TASK_MANAGER.mdas the subgraph contract):TaskDeadlinesSet,TaskClaimDeadlineSet(only-on-change),TaskClaimExpired.Also: OrgDeployer
_appendTaskManagerRulesswapped to the v6 strings (count stays 43); Lens decodes the 10-field tuple + newTASK_DEADLINESkey.Testing
TaskManagerDeadlineTest: 37 cases — create combos + born-expired reverts (all 3 paths), window lifecycle (claim/assign/approve/reject), lenient late submit+complete, takeover happy/sad paths (boundary: deadline second protected, +1s expired), application-flow takeover, self-reclaim refresh, updateTask arithmetic (claim-start preservation, 0→W, W→0, past-absolute unstick, perm parity), fuzz (window-edit invariant + expiry boundary).forge fmtclean.Ops scripts — all 7 sims fork-run to PASS under
FOUNDRY_PROFILE=production(--skip test)script/upgrades/UpgradeTaskManagerDeadlines.s.sol— 3-step cross-chain upgrade. v6 probed FREE (registry + CREATE2) on Gnosis AND Arbitrum (predicted impl0x7833c4670C42dbCe1a7aB1BAB7e7Baf0A982ff57). DryRuns on both chains exercise the live proxies: pre-v6 task zero-state (real Poa tasks on Arbitrum), born-expired revert, window start, expiry boundary, takeover with fresh window, lenient late submit + complete, window-edit arithmetic, deadline-less claims stay protected, executor storage preserved.script/upgrades/UpgradeOrgDeployerDeadlineRules.s.sol— OrgDeployer v15 (probed FREE both chains, predicted0xFa5Bc9343631489094e68a6059E93994C33127A3).script/fixes/WhitelistTaskDeadlineRules{Poa,Test6Kubi,DecentralPark}ViaGovernance.s.sol— per-org proposals: 4 v6 selectors allowed + 4 dead v5 selectors disallowed (griefing hygiene). Sims execute create → vote → warp → announceWinner and assertgetRuleflips on the real fork.Broadcast runbook (Hudson)
announceWinnerper org → TaskManager Step1 (Gnosis) → Step2 (Arbitrum + cross-chain) → Step3 verify → OrgDeployer v15 Step1/Step2/Step3.Known limitation
FOUNDRY_PROFILE=production forge buildwith tests now hits a YulException (stack-too-deep) inside the giantDeployerTestcontract — optimizer-on inlining pressure; it persists even with all v6-touched functions stubbed, i.e. marginal-budget instability of that compilation unit, not a specific new function (also repros on solc 0.8.30). The CI gate (default profile) is green, src + scripts compile clean under production, and sims run with--skip test. Not load-bearing for broadcast artifacts.Cross-repo
Binding spec (events, param order
..., absoluteDeadline, completionWindow,CreateTaskInputfield names, zero→null indexing semantics) is mirrored by the subgraph PR (poa-box/subgraph-pop) and frontend PR (poa-frontend) — linked once opened.🤖 Generated with Claude Code