671ebfb5 ยท zzmq.dev@gmail.com/zz
Commit
671ebfb563aa12c3de8fa3c1755df12bddf539f8
Fix three real security/correctness issues before release - package.json's engines.node said ">=20", but the CLI loads node:sqlite at startup (engine/store.ts) -- that module needs Node 22.13+, so every command would fail on a Node 20 install. Now says ">=22.13.0", matching what the docs already say. - The remote tools endpoint (handleApiCallTool) only checked that the caller was logged in, never the repo's own visibility or the caller's actual Role -- any authenticated account could read a private repo's Lane/Ladder/file content, or call any write tool on it, through this one JSON layer, even though every OTHER read surface (the web repo page, git clone/fetch, canReadRepo) already required a real Role grant for a private repo. Fixed: a private repo now requires an actual grant (new getRepoRoleForPrincipal, reading the existing D1 repo_roles cache rather than a live Artifacts round-trip per call, since this runs on the hot path of every single tool call). - commit_changeset and ladder_write_rung write committed content directly, with no further per-call authority check of their own (unlike claim/answer, which engine/lane.ts's own answer() already checks lane.coordinators/maintainers for) -- they were only withheld from non-coordinators by zz work's own choice of which tools to hand a model (COORDINATOR_ONLY_TOOLS). A direct API call bypassed that entirely. Fixed: both now require Maintainer+ on the target repo, server-side, regardless of visibility -- the same bar canPushRepo already holds a raw git push to. Verified live against the deployed Worker: a logged-in account with no role on a repo can still read its public Lane/Ladder content (the "public = open to anyone" model is unchanged) but is now correctly rejected calling commit_changeset on it; the normal contributor flow (committing to one's own task shard, where ensureShard already grants Owner) still works end to end, unaffected. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q8tksS4bucUkJguqksSVYR
Troy Howard <thoward37@gmail.com> -- 2026-10-13T22:15:12.000Z