Public: anyone can read this; the crew can change it.

sitemap.xml and llms.txt are built at most once a minute, never once per stranger's request #3146

Parked opened this
Closed without merging

/sitemap.xml and /llms.txt now each read their repository list from the database at most once a minute per forge. bun test test/standards.test.ts passes (10 tests). I couldn't run bun x tsc --noEmit here: bun fails with "unable to write files to tempdir: ReadOnlyFileSystem", so the type check is unrun.

Notes

stopped parked by the crew deploy 51c5263

opened this

/sitemap.xml and /llms.txt now each read their repository list from the database at most once a minute per forge. bun test test/standards.test.ts passes (10 tests). I couldn't run bun x tsc --noEmit here: bun fails with "unable to write files to tempdir: ReadOnlyFileSystem", so the type check is unrun.

  • Sitemap already cached: it already used the WeakMap<App, Fresh<…>> pattern with a 60-second window. What was missing was the /llms.txt cache, the clearing, and the test seam.
  • /llms.txt: it now keeps only the repository names, not the origin, so a caller who varies Host can't force a rebuild. Both listings share one 60-second window. The cache is filled synchronously, so concurrent requests share one build.
  • Clearing on private: forgetListings(app) in src/web/standards.ts empties both caches. updateRepoSettings (src/actions/repos.ts) calls it whenever visibility changes. The origin sync (src/origins/sync.ts) calls it when it closes a mirror because the origin went private. A repository going private is gone from the next response, not within a minute.
  • Seam: listingBuilds counts database reads per listing.
  • Tests: test/standards.test.ts has one new test. It makes 50 requests to each file and expects zero extra builds. It then makes a repository private and expects it gone from both files at once, with the public one still listed.

I did not add clearing for a repository deleted or transferred; those can stay listed for up to a minute.

A new public repository appears within a minute (the cache window). The new src/actions/repos.ts → src/web/standards.ts import goes from actions into web, so check whether you want that direction.

To try it, hit /sitemap.xml and /llms.txt repeatedly, then make a public repository private in its settings and fetch them again.

🤖 Generated with Claude Code

Closes #3142

commented

/sitemap.xml and /llms.txt now each read their repository list from the database at most once a minute per forge. bun test test/standards.test.ts passes (10 tests). I couldn't run bun x tsc --noEmit here: bun fails with "unable to write files to tempdir: ReadOnlyFileSystem", so the type check is unrun.

  • Sitemap already cached: it already used the WeakMap<App, Fresh<…>> pattern with a 60-second window. What was missing was the /llms.txt cache, the clearing, and the test seam.
  • /llms.txt: it now keeps only the repository names, not the origin, so a caller who varies Host can't force a rebuild. Both listings share one 60-second window. The cache is filled synchronously, so concurrent requests share one build.
  • Clearing on private: forgetListings(app) in src/web/standards.ts empties both caches. updateRepoSettings (src/actions/repos.ts) calls it whenever visibility changes. The origin sync (src/origins/sync.ts) calls it when it closes a mirror because the origin went private. A repository going private is gone from the next response, not within a minute.
  • Seam: listingBuilds counts database reads per listing.
  • Tests: test/standards.test.ts has one new test. It makes 50 requests to each file and expects zero extra builds. It then makes a repository private and expects it gone from both files at once, with the public one still listed.

I did not add clearing for a repository deleted or transferred; those can stay listed for up to a minute.

A new public repository appears within a minute (the cache window). The new src/actions/repos.ts → src/web/standards.ts import goes from actions into web, so check whether you want that direction.

To try it, hit /sitemap.xml and /llms.txt repeatedly, then make a public repository private in its settings and fetch them again.

🤖 Generated with Claude Code

commented

Parked by the crew: the check failed ("a suspended account's repositories leave every list > suspended: a stranger and a reader find them nowhere") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs