feat(TaskManager v5): post-claim edit perms + deploy-time perm bootstrap#169
Merged
Conversation
…bootstrap
TaskManager v5: adds TaskPerm.EDIT_META (1<<6) and TaskPerm.EDIT_FULL (1<<7)
bits, status-aware updateTask gate that allows post-claim editing for EDIT_FULL
holders (PMs/executor bypass preserved; terminal COMPLETED/CANCELLED states stay
immutable), and a new updateTaskMetadata(id, title, hash) function for the
metadata-only path. uint8 mask is now saturated (documented).
OrgDeployer v13: new DeploymentParams.taskManagerPerms field
({ roleIndices[], masks[] }) wired to a deployer-only
TaskManager.bootstrapGlobalPerms(hatIds[], masks[]) so new orgs can grant
org-wide TaskPerm bits (EDIT_META/EDIT_FULL/BUDGET/...) at deploy time.
Guard enters the block when EITHER array is non-empty so malformed configs
revert ArrayLengthMismatch instead of silently dropping masks.
Tests: 1370/1370 passing. Adds 18 tests for the new edit gates (post-claim
EDIT_FULL succeeds, EDIT_META holders use updateTaskMetadata, PM/executor
bypass, terminal-state revert, bounty token swap, per-project mask shadows
global, edit→complete payout flow-through), 12 tests for bootstrapGlobalPerms
(deployer-only, length mismatch, dup hat last-wins, mask=0 removes hat,
equivalence with setConfig, ordering with project bootstrap), and 7 tests for
the OrgDeployer integration including a regression-pin for the
silent-skip bug.
Upgrade scripts (TaskManager v5 / OrgDeployer v13), simmed against live
Gnosis + Arbitrum forks under FOUNDRY_PROFILE=production per CLAUDE.md
(prank Hudson directly, no hub.owner() reads). New governance grant scripts
for Test6 + Decentral Park EDIT_FULL, Decentral Park paymaster ops handover
+ budget bumps, Decentral Park Agent role creation (vouching-only mint),
and Decentral Park Neighbor default-eligibility fix. Every grant/fix script
has a Sim contract that runs the full proposal-pass-execute path on a fork
and asserts post-state.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hudsonhrh
added a commit
that referenced
this pull request
Jun 1, 2026
… wins Reconciles main's TaskManager v4/v5 + EligibilityModule lockdown (#159, #167, #169) with the capability-hat refactor. Per direction, the capability-hat model is canonical and main's new features were re-expressed in it. Resolution highlights: - TaskManager Layout: kept main's foldersRoot/organizerHatIds in their on-chain slots (live-org upgrade safety), appended cap-hat gate fields after, plus new budgetHat/editMetaHat/editFullHat. Append-only vs deployed v5 layout. - v4 editable budgets: BOUNTY_CAP/PROJECT_CAP now gated by _requireBudgetEditor -> BUDGET capability hat (executor OR cap-hat), not the bitmask. - v5 post-claim edits: updateTask (EDIT_FULL) + updateTaskMetadata (EDIT_META) gate via _hasCap, not _permMask. - Folders kept verbatim (orthogonal; organizerHatIds stays a HatManager array gate). - bootstrapGlobalPerms re-expressed as a deployer-time bulk global gate-hat setter (expands each mask into per-gate cap-hat assignments); deleted the dead bitmask helpers (_permMask, _syncPermissionHat, refcount machinery). - setConfig(ROLE_PERM)/setProjectRolePerm extended to BUDGET/EDIT_META/EDIT_FULL, kept strict single-bit (InvalidCapMask). - EligibilityModule: kept #167 superAdmin-only lockdown; the sole exception is setWearerEligibility via onlySuperAdminOrRevoker (RoleBundleHatter cascade). - OrgDeployer: DeploymentParams keeps both capabilityHats/roleBundles and taskManagerPerms (complementary). Re-added _resolveRoleIndicesToHatIds. - Added lens variant 12 ([budgetHat, editMetaHat, editFullHat]) for the new gates. Security fix surfaced by the merge (pre-existing on the branch; DeployerTest was previously excluded from verification): RoleBundleHatter.mintRole's pre-mint eligibility reset unconditionally set wearers eligible, bypassing the vouching gate (defaults.eligible=false) on self-service QuickJoin. Now gated on hasSpecificWearerRules so it only re-enables previously-revoked wearers (preserves re-mint-after-revoke) and never overrides a default-driven gate for fresh wearers. Tests: 1423 passing / 0 failing / 16 skipped (obsolete bitmask tests). Main-era bitmask tests adapted to capability-hat behavioral assertions. forge build/fmt clean. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Summary
Test plan
🤖 Generated with Claude Code