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 #5633

Parked opened this
Closed without merging

The two sentences are now defined once, in the new src/origins/words.ts (#5586 hasn't landed, so the module is new): NEEDSRECONNECT = "this origin needs to be reconnected" ATSTORAGELIMIT = "this account is at the forge's storage limit" What moved: src/origins/credential.ts (2 places) and src/origins/sync.ts now use NEE…

Notes

stopped parked by the crew deploy f6f92cf

opened this

The two sentences are now defined once, in the 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 (2 places) and src/origins/sync.ts now use NEEDS_RECONNECT.
  • src/origins/mirror.ts and src/core/storage.ts (both the bare sentence and the : ${sentence} form) now use AT_STORAGE_LIMIT.
  • grep -rn also found the sentences in two files the issue didn't name: src/origins/push-through.ts (${webUrl}: …, twice) and src/actions/migrate.ts ("Not made: … Delete a repository or app data first."). They now build the same strings from the constants, so grep -rn for each sentence under src/ finds only words.ts.

The output is byte-for-byte the same, and only the lines with the sentences and their imports changed. src/core/storage.ts now imports from src/origins/, but words.ts imports nothing, so this adds no import cycle.

Test: the new test/origin-state-words.test.ts checks that the constants still read as before. For each of the six files it checks that the file imports words.ts and contains neither sentence as text, so it fails if a copy is typed back.

Checks run: bun x tsc --noEmit passes, and the new test passes (7/7). These existing suites pass unchanged (141 tests): origins-reconnect, origins-sync, origins, push-through, quotas-storage, migrate, crew-mirror, credentials, origins-security-auth and mcp-migrate. src/web didn't change, so design-lint wasn't needed.

To try it: bun test test/origin-state-words.test.ts. Then put "this origin needs to be reconnected" back into src/origins/sync.ts and run it again: it goes red.

🤖 Generated with Claude Code

Closes #5623

commented

The two sentences are now defined once, in the 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 (2 places) and src/origins/sync.ts now use NEEDS_RECONNECT.
  • src/origins/mirror.ts and src/core/storage.ts (both the bare sentence and the : ${sentence} form) now use AT_STORAGE_LIMIT.
  • grep -rn also found the sentences in two files the issue didn't name: src/origins/push-through.ts (${webUrl}: …, twice) and src/actions/migrate.ts ("Not made: … Delete a repository or app data first."). They now build the same strings from the constants, so grep -rn for each sentence under src/ finds only words.ts.

The output is byte-for-byte the same, and only the lines with the sentences and their imports changed. src/core/storage.ts now imports from src/origins/, but words.ts imports nothing, so this adds no import cycle.

Test: the new test/origin-state-words.test.ts checks that the constants still read as before. For each of the six files it checks that the file imports words.ts and contains neither sentence as text, so it fails if a copy is typed back.

Checks run: bun x tsc --noEmit passes, and the new test passes (7/7). These existing suites pass unchanged (141 tests): origins-reconnect, origins-sync, origins, push-through, quotas-storage, migrate, crew-mirror, credentials, origins-security-auth and mcp-migrate. src/web didn't change, so design-lint wasn't needed.

To try it: bun test test/origin-state-words.test.ts. Then put "this origin needs to be reconnected" back into src/origins/sync.ts and run it again: it goes red.

🤖 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