PublicTxt Index Repository
Part of PublicTxt Web.
A public Git repo that holds an index snapshot of many content repos, in the discovery-index format. It is the durable discovery layer: clone it and you can find PublicTxt repos, resources and tags with no server running.
Usually written by a PublicTxt Aggregator. Anything that writes valid files can produce one: a script, a CI job, or a person.
Many index repos, by design
Yes, there can be any number of them. There is no central registry.
- Each publisher (person, community, aggregator instance) has its own index repo. It reflects that publisher’s inclusion and trust choices.
- Index repos can follow each other through their trust lists. Discovery spreads peer to peer.
- Consumers merge several index repos by key: repo URL for repos,
resource_idfor resources. When two disagree, the record with the newer source commit wins (see the format spec). - Different index repos may cover different scopes: a topic index (
#dotnet), a community index, or a personal “repos I follow” index.
A node, in federation talk, is just one publisher: an index repo plus its trust list.
Index repo vs content repo
| Content repo | Index repo | |
|---|---|---|
| Holds | Authored documents | Derived records about other repos |
| Author | One person (spec §2) | A publisher, usually automated |
| Derived data | Not allowed (ADR-0003) | Its whole purpose |
| Identified by | publictxt.yaml | publictxt-index.yaml |
| Edited by hand | Yes | Normally no; regenerated |
ADR-0003 resolution (proposed): ADR-0003’s ban on committed derived data applies to content repos only. An index repo is a separate repo whose only content is derived data, marked by its own manifest. This keeps content repos clean while allowing a persistent index. Record it as an amendment to ADR-0003.
Lifecycle
- The publisher creates an empty repo with
publictxt-index.yamlandtrust.yaml. - The aggregator writes a deterministic snapshot on a timer. An unchanged index produces no diff and no commit.
- Each commit records the generation time and the source commits it reflects (staleness stamps).
- On aggregator restart, the in-memory index is rebuilt from the latest commit, then followers catch up.
Consent consequences
- Removing an opted-out repo deletes its records from the next snapshot. Git history still holds them. State this in the opt-in terms. Rewriting history is possible but breaks everyone who cloned.
- Index repos carry metadata, links and tags, not full text. That keeps the consent and licence risk low.
Open questions
- Branch policy: a single default branch, or orphan snapshot branches to cap history growth?
- History growth: periodic squash or a new repo per epoch, vs keeping history as an audit trail.
- Should index repos be signed (signed commits or tags) so consumers can verify the publisher?
- Discovery of index repos themselves: only via trust lists, or also a well-known file in content repos (“indexed by”)?