Repository navigation
fix(node)!: gate agent-task reads behind visibility rules - #553
Merged
Merged
Conversation
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
Re-homes #464 (
fix(node)!: gate agent-task reads behind visibility rules) onto an upstream branch so the upstream-only Code Quality check can run. Task reads now return null/404 for callers who cannot see the backing repo or task, closing an existence-and-content leak across REST, GraphQL, and WebSocket task surfaces.Motivation & context
Before this, any caller could enumerate and read every agent task on a node regardless of repo visibility: private and quarantined repos' tasks, their assignees, payloads, and UCAN tokens were readable by anyone, and a failed claim revealed that a task existed and was reserved. Contributor PR #464 was approved at an earlier head; this branch carries the same commits on current
mainso the required check can run.Kind of change
What changed
gitlawb-node: every task read surface (REST list/get, GraphQL task/tasks/taskById, WS task query) gates throughget_visible_task; claim/complete/fail gate throughget_claimable_task. Ineligible callers get the same 404/not-found as a missing task, so denials never leak existence or reservations.gitlawb-node: sealed opaque task cursors for keyset pagination, bound to position, filter, and caller; anonymous cursors cannot resume an authenticated scan.gitlawb-node: per-request task scan budget and an IP rate limiter on task read routes, shared by REST and GraphQL.gitlawb-node: UCAN tokens never appear in read responses or GraphQL errors.gl: task client and MCP surface updates matching the gated contract.Merge detail: 52 contributor commits preserved author-identical from
1514f3d8; one maintainer merge commit bringsmainata4026e84. Conflicts resolved by union: both error helpers kept inapi/tasks.rs, the PR's GraphQLcomplete_task/fail_taskmutations (which ort had dropped) restored againstfinish_task's newactor_didsignature, stored-assigneeby_did(#550 contract) on all task event broadcasts, and two stale test oracles updated for the merged contract (ineligible claim is 404,list_tasks_keysetnormalizes the assignee filter).How a reviewer can verify
On main, a permissionless caller gets task rows back:
On this branch the same call returns
count: 0and a per-id GET returns 404. Locally:cargo test -p gitlawb-node --bin gitlawb-node taskexercises the gate on list, get, claim, complete, fail, GraphQL, WS, cursors, deny windows, and the mirror-row case.Before you request review
cargo test --workspacepasses locallycargo fmt --allandcargo clippy --workspace --all-targets -- -D warningsare cleanfeat(...),fix(...),docs(...)).env.exampleupdated if behavior or config changed (or N/A)Protocol & signing impact
did:key, Ed25519 / RFC 9421 signatures, UCAN, ref certs, or P2P wire formatsDID-matching and UCAN handling change (assignee normalization, UCAN redaction); signed artifacts and wire formats are untouched. The breaking item is the read contract, called out in the title: callers that could previously read gated tasks now get 404/not-found.
Notes for reviewers
main, so fresh review is requested.is_public/visibility_rulespair is hardcoded empty/true), so every gate fails closed on it;mirror_only_repo_task_is_hidden_from_anonymous_readscovers the no-canonical-twin case.Summary by CodeRabbit