Fix pull/issue records: repo fields are bare DIDs, not AT-URIs; pulls use rounds
Refreshed the vendored lexicons from tangled.org/tangled.org/core (bun run
update-lexicons && bun run codegen). This turned up two real bugs, both
of which meant records created by this CLI were invisible on tangled.org
even though they wrote successfully and this CLI's own read paths (via
constellation) could see them fine:
- sh.tangled.repo.pull's target.repo/source.repo and sh.tangled.repo.issue's
repo are all lexicon format "did" โ a bare DID, never an AT-URI. Every
record this CLI wrote populated them with an AT-URI instead (built via
the old buildRepoAtUri, which for owner/name remotes resolved a full
at://did/sh.tangled.repo/rkey and for the common Tangled stable-DID-remote
case fetched https://tangled.org/<did> and regex-scraped an AT-URI out of
the page HTML โ fragile, and observed to sometimes pick up an unrelated
AT-URI embedded on the page, e.g. the viewer's own account).
- sh.tangled.repo.pull replaced its flat patchBlob field with a required
rounds: [{createdAt, patchBlob}] array at some point; this CLI still
wrote the old flat shape.
Fixes, in src/utils/at-uri.ts and src/lib/{pulls,issues}-api.ts:
- buildRepoAtUri -> resolveRepoDid: for stable-DID remotes, the DID in the
remote URL already *is* the repo's own DID, returned directly with no
network call; for owner/name remotes, resolves owner to a DID, lists
their sh.tangled.repo records, and prefers that record's own repoDid
field ("DID of the repo itself, if assigned") over the owner DID.
Deletes the HTML-scraping fallback entirely.
- createPull writes rounds: [{createdAt, patchBlob}] and target.repo as
the resolved DID; also sets target.repoDid (not in the published
lexicon, but present on every appview-indexed record observed in the
wild โ the appview's ingestion pipeline appears to key off it).
- source.repo/source.sha dropped from what gets written: source.repo is
for cross-repo (fork) pulls this CLI doesn't create; sha was never in
the lexicon and wasn't read back anywhere.
- issues-api.ts's repo field gets the same bare-DID fix.
Also adds `tang pr delete <pr-id>`: there was no way to remove a botched
pull request record via the CLI at all, which is exactly what surfaced
this bug (bad records had to be deleted and recreated to verify the fix).
Author-only, confirms unless --yes.
Checks: bun run typecheck, bun run test (329 passing), bun run lint:fix,
bun run build all clean.