the following cli verbs are a bit shit:…
- User
the following cli verbs are a bit shit:
https://linear.app/entirehq/issue/COR-699/cant-repo-grant-with-entire-cli has all details. new branch, go!
Assistant· claude-opus-4-8
I'll pull the Linear issue details first, and set up the branch in parallel.
Assistant· claude-opus-4-8
Now let me explore the relevant command code.
Assistant· claude-opus-4-8
Now let me look at the resolve helpers and the runCore helpers.
Assistant· claude-opus-4-8
The infrastructure (
resolveRepoRef,resolveAccountRefforgithub:alicehandles) already exists. Let me check the coreapi client surface and how account/handle resolution works in both directions.Assistant· claude-opus-4-8
BatchLookuplooks promising for reverse-resolving account IDs. Let me check it andResolveHandle's wire shape.Assistant· claude-opus-4-8
Let me check whether
BatchLookupenrichesaccountrefs (for friendly grantee display) by inspecting the OpenAPI spec.Assistant· claude-opus-4-8
Let me look at existing grant tests and the project.go pattern before writing.
Assistant· claude-opus-4-8
I have the full picture. Let me set up task tracking and verify the remaining helper signatures.
Assistant· claude-opus-4-8
I have everything I need. Let me create tasks and start implementing.
Assistant· claude-opus-4-8
Now let me add the
resolveGranteeProviderhelper to resolveref.go:Assistant· claude-opus-4-8
Now the clone URL in repo.go:
Assistant· claude-opus-4-8
Now the main rewrite of grant.go. Let me write it fresh:
Assistant· claude-opus-4-8
Now update the tests. First remove the obsolete
TestParseGranteeMode:Assistant· claude-opus-4-8
Now rewrite the wiring test for the new positional grantee surface (by-provider now needs a ResolveHandle round-trip):
Assistant· claude-opus-4-8
Now let me check repo_test.go and add a resolveGranteeProvider test:
Assistant· claude-opus-4-8
Let me add a test for
repoDetailRowand aresolveGranteeProvidertest:Assistant· claude-opus-4-8
Good. Now add a
resolveGranteeProvidertest:Assistant· claude-opus-4-8
Now let me build and run fmt/lint/test:
Assistant· claude-opus-4-8
Build clean. Let me check for other references to the removed flags (docs, integration/e2e tests):
Assistant· claude-opus-4-8
No external docs reference the old flags. Let me run fmt, lint, and the relevant tests:
Assistant· claude-opus-4-8
Now fix the goconst issue in resolveref_test.go:
Assistant· claude-opus-4-8
Lint clean. Now run the relevant tests:
Assistant· claude-opus-4-8
All passing. Now addressing your note — you're right,
checkpointProviderGitHubis the checkpoint-setup provider, unrelated to identity/grant resolution. Let me introduce a proper provider constant in resolveref.go (the home of handle/provider resolution) and use that instead.Assistant· claude-opus-4-8
Good call — let me scrub the real handle/GH id from everything and use fakes.
Assistant· claude-opus-4-8
I'll use the canonical fakes already in the tests (
alice,12345,web/acme). Let me update grant.go examples and resolveref.go doc:Assistant· claude-opus-4-8
Now the test fakes — replace
con-cat→alice,1000323→12345:Assistant· claude-opus-4-8
Let me run the full unit test suite and confirm no leftover references to removed symbols:
Assistant· claude-opus-4-8
Let me update tasks and check whether any docs reference the grant CLI surface:
Assistant· claude-opus-4-8
No docs to update. Let me mark all tasks complete:
Assistant· claude-opus-4-8
Bottom line: Reworked the
grant/repoCLI per COR-699 — grantees are now positionalgithub:alicehandles, repo grants resolve by name, andrepo getshows the clone URL. All unit tests + lint pass. Not committed (yours to push).What changed (
cmd/entire/cli/):- Positional grantee —
grant {org,project,repo} add/removenow take<target> <grantee>where grantee isprovider:handle(e.g. ). The CLI resolves the handle → provider user id behind the scenes (new via ), killing the /// flag soup that caused the original "provider identity not found". also accepts an account ULID (typed-id revoke route).
- Positional grantee —
- User
commit yes.
Assistant· claude-opus-4-8
Committed as
7ec1e0fe0onpaul/cor-699-cant-repo-grant-with-entire-cli. Not pushed — yours to push.- User
$ entire grant repo list dogbark --project paul no repo named "dogbark" in that project (run
entire repo list <project>to see names, or pass a ULID) Assistant· claude-opus-4-8
The CLI resolves correctly in tests, so this points at the server-side
name=filter on the repo list endpoint. Let me verify what the spec says that endpoint supports.Assistant· claude-opus-4-8
The client provably sends
name=(my test asserts it), the spec declares exact-match support, yet the real server returns nothing for a repo that exists. So the server's reponamefilter is the broken link — note that yourrepo list paulworks because it sends no name filter. Project name resolution works server-side; only repos are affected.Robust fix: resolve repos client-side (list the project's repos and match by name), exactly how
repo listalready works. Let me changeresolveRepoRef:Assistant· claude-opus-4-8
Now update the
TestResolveRepoRefto reflect client-side matching:- User
[Request interrupted by user]
- User
that's a terrible idea. don't do that, let's investigate the server-side code in ~/src/entirehq/entiredb. If we need to make changes there, make a NEW git worktree first.
Assistant· claude-opus-4-8
You're right — workaround masks the real bug. Let me revert the client-side change and investigate the server.
Assistant· claude-opus-4-8
Reverted. Now let me investigate the server. First, find the repo list handler in entiredb.
Assistant· claude-opus-4-8
Found it. When
nameis set, the server returns the match in a singularrepofield (line 629:out.Body.Repo = &single[0]), not thereposarray — mirroring the org/project endpoints. But the CLI'sresolveRepoRefreadsout.Repos(the plural array), which is empty. Let me confirm the wire contract on both sides.Assistant· claude-opus-4-8
Confirmed — this is a CLI bug, not a server bug. The server contract (entiredb
api/corev1/repos.go:179) returns the name match in a singularrepofield (like org/project do); the CLI reads the pluralreposarray. Let me check whether the CLI's generated client even has the singular field:Assistant· claude-opus-4-8
The CLI's generated client already has the singular
Repo OptRepofield (spec is current) — the only bug isresolveRepoRefreading the wrong field. The fix mirrorsresolveProjectRef. No server change needed; the test even mocked the plural array, which is why the bug slipped through.Assistant· claude-opus-4-8
Now fix the test to mock the real server contract (singular
repofield):Assistant· claude-opus-4-8
All green. The fix is a one-field change reading
out.Repo(singular) instead ofout.Repos— matching howresolveProjectRef/resolveOrgRefalready work, and what the server actually returns. No server change needed. Let me verify the diff and commit:Assistant· claude-opus-4-8
Bottom line: It was a CLI bug, not a server bug — no entiredb change needed. Fixed and committed as
71e6e4c9a.Root cause: The server (entiredb
api/corev1/repos.go:179,core/coreapi/repos.go:629) returns a?name=-filtered repo list under the singularrepofield — exactly like the org/project endpoints.resolveRepoRefread the pluralreposarray, which is empty on a filtered query, so everygrant repo … <name> --project <p>404'd with "no repo named" even though the repo existed. Yourrepo list paulworked precisely because it sends nonamefilter and reads the plural array.The fix: one field —
out.Repo.Get()instead ofout.Repos[0], mirroringresolveProjectRef. The old test had mocked the plural array, which is why the bug shipped; the fixture now matches the real server's singular field so the regression stays covered.No new worktree was needed since the change is entirely in the CLI. Both commits are on
paul/cor-699-cant-repo-grant-with-entire-cli, unpushed. Worth a quick live retest of on your end to confirm against the real server.