Skip to content

feat(TaskManager v5): post-claim edit perms + deploy-time perm bootstrap#169

Merged
hudsonhrh merged 1 commit into
mainfrom
hudsonhrh/editable-assigned-tasks
May 28, 2026
Merged

feat(TaskManager v5): post-claim edit perms + deploy-time perm bootstrap#169
hudsonhrh merged 1 commit into
mainfrom
hudsonhrh/editable-assigned-tasks

Conversation

@hudsonhrh
Copy link
Copy Markdown
Member

Summary

  • TaskManager v5: adds `TaskPerm.EDIT_META` (1<<6) and `EDIT_FULL` (1<<7) bits, a status-aware `updateTask` gate (EDIT_FULL allows post-claim edits; terminal COMPLETED/CANCELLED stay immutable), and `updateTaskMetadata(id, title, hash)` for metadata-only edits. uint8 mask is now saturated (documented).
  • OrgDeployer v13: new `DeploymentParams.taskManagerPerms` field wired to a deployer-only `TaskManager.bootstrapGlobalPerms` so new orgs can grant org-wide TaskPerm bits 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 — 18 edit-gate tests, 12 `bootstrapGlobalPerms` tests, 7 OrgDeployer integration tests including a silent-skip-bug regression pin, plus updates to existing post-claim assertions.
  • Upgrade scripts (`UpgradeTaskManagerEditPerms` / `UpgradeOrgDeployerTaskManagerPerms`), each with a Sim sibling that runs end-to-end under `FOUNDRY_PROFILE=production` against live Gnosis + Arbitrum forks, pranking Hudson directly per CLAUDE.md.
  • Governance grant/fix 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 script ships with a sim that validates the full proposal-pass-execute path against real on-chain state.

Test plan

🤖 Generated with Claude Code

…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 hudsonhrh merged commit b59590e into main May 28, 2026
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>
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.

1 participant