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

An origin's reconnect and storage-limit sentences live in one module, read by credentials, sync, storage and mirror #5640

Parked opened this
Closed without merging

The two sentences are now defined once, in a new src/origins/words.ts.

Notes

stopped parked by the crew deploy d119844

opened this

The two sentences are now defined once, in a new src/origins/words.ts. #5586 hasn't landed, so the module is new:

  • NEEDS_RECONNECT = "this origin needs to be reconnected"
  • AT_STORAGE_LIMIT = "this account is at the forge's storage limit"

What moved:

  • src/origins/credential.ts (two places) and src/origins/sync.ts now use NEEDS_RECONNECT.
  • src/origins/mirror.ts and src/core/storage.ts now use AT_STORAGE_LIMIT, in storage both alone and in the : ${sentence} form.
  • The issue didn't name src/origins/push-through.ts (${webUrl}: …, twice) or src/actions/migrate.ts ("Not made: … Delete a repository or app data first."), but both had the sentences too. They now build the same strings from the constants, so grep -rn for either sentence under src/ finds only words.ts.

Every string comes out byte-for-byte the same, and only the lines holding the sentences and their imports changed. src/core/storage.ts now imports from src/origins/, but words.ts imports nothing, so there is no import cycle. The new test/origin-state-words.test.ts checks that the constants read as before, and that each of the six files imports words.ts and contains neither sentence as text.

Why the last check failed (#5633): the check machine ran out of disk, not this change. The run's log shows ENOSPC: no space left on device in openDb, and explore-rank's setup failed with git_init_failed while creating its 500 repositories. The other 28 failures are tests that crashed while setting up a temporary app, and two shards were killed (exit 143). Nothing here writes to disk. This push adds only an empty commit to get a fresh check run.

Checked here: bun x tsc --noEmit passes. These pass: origin-state-words, explore-rank, quotas and mirror-out (26 tests). The first push also ran origins-reconnect, origins-sync, origins, push-through, quotas-storage, migrate, crew-mirror, credentials, origins-security-auth and mcp-migrate (141 tests), all passing. src/web is untouched, so design-lint wasn't needed.

To try it: run bun test test/origin-state-words.test.ts, then type "this origin needs to be reconnected" back into src/origins/sync.ts and run it again: it fails.

🤖 Generated with Claude Code

Closes #5623

commented

The two sentences are now defined once, in a new src/origins/words.ts. #5586 hasn't landed, so the module is new:

  • NEEDS_RECONNECT = "this origin needs to be reconnected"
  • AT_STORAGE_LIMIT = "this account is at the forge's storage limit"

What moved:

  • src/origins/credential.ts (two places) and src/origins/sync.ts now use NEEDS_RECONNECT.
  • src/origins/mirror.ts and src/core/storage.ts now use AT_STORAGE_LIMIT, in storage both alone and in the : ${sentence} form.
  • The issue didn't name src/origins/push-through.ts (${webUrl}: …, twice) or src/actions/migrate.ts ("Not made: … Delete a repository or app data first."), but both had the sentences too. They now build the same strings from the constants, so grep -rn for either sentence under src/ finds only words.ts.

Every string comes out byte-for-byte the same, and only the lines holding the sentences and their imports changed. src/core/storage.ts now imports from src/origins/, but words.ts imports nothing, so there is no import cycle. The new test/origin-state-words.test.ts checks that the constants read as before, and that each of the six files imports words.ts and contains neither sentence as text.

Why the last check failed (#5633): the check machine ran out of disk, not this change. The run's log shows ENOSPC: no space left on device in openDb, and explore-rank's setup failed with git_init_failed while creating its 500 repositories. The other 28 failures are tests that crashed while setting up a temporary app, and two shards were killed (exit 143). Nothing here writes to disk. This push adds only an empty commit to get a fresh check run.

Checked here: bun x tsc --noEmit passes. These pass: origin-state-words, explore-rank, quotas and mirror-out (26 tests). The first push also ran origins-reconnect, origins-sync, origins, push-through, quotas-storage, migrate, crew-mirror, credentials, origins-security-auth and mcp-migrate (141 tests), all passing. src/web is untouched, so design-lint wasn't needed.

To try it: run bun test test/origin-state-words.test.ts, then type "this origin needs to be reconnected" back into src/origins/sync.ts and run it again: it fails.

🤖 Generated with Claude Code

commented

Parked by the crew: the check failed ("test/explore-rank.test.ts > (unnamed)") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs