~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

A copy of a repository shows its commits' authors as the original does

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:serve/commit-authors

What changes

Commits in other repositories. A copy of a repository shows its commits' authors as the original does. This covers a fork, a mirror, or a history pushed as a repository of its own. Where a page's own repository believes no claim for an address in a commit, the page asks which accounts other repositories with that commit believe there:

  • Exactly one: it shows that account.
  • More than one: it shows none.
  • None: the address stays unlinked.

The walk. As a repository's pages show commits, its default branch is walked in the background. The accounts it vouches for go into a new index table, commit_author, by commit and hashed address. Each walk goes on from the tip the last one stopped at. It starts over when the people the repository believes change, or their claims do. Only public repositories the index knows count, and not those taken down. A private repository vouches for nothing outside itself. The table outlives a rebuild of the index, as pushes do.

Why

A copy of knotless pushed as its own repository, not forked, showed every commit by its original authors as no one's. Each repository believed only its own owner, collaborators and merged pulls' authors. Even a real fork didn't inherit its parent's.

Commit IDs survive a copy, so the link follows the commit rather than the repository. Disagreement shows no one rather than whoever was seen first. Someone who copies your commits and claims your address is believed only in their own repository: they can hide the cross-repository link, but not take it. Verifying addresses by email was the other way. It would mean knotless sending mail and deciding who owns an address, for what commit IDs already give.

How it was checked

a_copy_shows_whom_the_original_vouched_for in crates/knotless-serve/tests/web.rs covers four things:

  • A copy pushed by an account claiming another address shows the owner's commits as the owner's once the original's pages walk them.
  • A commit pushed later is walked on from the last tip.
  • A third account that copies the commits and claims the owner's address is shown only in its own repository.
  • The copy then shows no one.

Only cargo check and clippy for knotless-serve were run here. The test and the plans gate are left to CI.

Shortcomings

  • Links appear only once the original's commits have been shown on one of its pages, and only for its default branch.
  • The walk starts over whenever a repository's people or their claims change, which reads its whole history again.
  • A repository deleted keeps its rows until the index forgets it. They stop counting at once, as the lookup joins the repository table.

🤖 Generated with Claude Code

Approved

This pull adds a background walk of each public repository's default branch. The walk records, in a new commit_author table, which account the repository vouches for at each commit and hashed address. Where a page's own repository believes no claim, author asks authors_elsewhere and shows an account only when exactly one is found. I found no bugs.

  • Rebuild: commit_author and authors_walked are left out of CACHE, so they survive an index rebuild as the pull says.
  • Joins: the repo join and the down filter in authors_elsewhere mean deleted or taken-down repositories stop counting at once.
  • Resume: believed leaves out merged pulls on purpose. The walk resumes from the last tip because a pull merged later brings new commits that the next walk reads.
  • Docs and plans: the identity and serve docs are updated, and commit_author is added to GROWING.
  • Checks: I did not read them. The pull says the new test and the plans gate were left to CI, so watch that the plan for authors_elsewhere uses the primary key rather than a scan. Its leading sha, address columns should serve it.

I read every file the diff changes.

Approved

The only change since my last review is the second commit, which edits a_copy_shows_whom_the_original_vouched_for so it compares against the owner's handle once that exists. I had no findings before and the rest of the pull is unchanged. The test now exercises the same four cases the body lists. I did not read the checks. The pull is already queued and running them, and the new test and plans gate are what they cover.

Approved

The only change since my last review is the third commit. It restructures walk_authors in web.rs to drop its early returns. I checked that it behaves as before. It still takes the WALKING lock only when an index exists and the repository is public, and it still spawns the walk and removes the entry afterward. I had no findings before and have none now. I did not read the checks, because the pull is queued and running them.

Merged as 27f774a