fix(fs-storage)!: only probe bare INPUT and INPUT.json for run input - #4120
Open
vladfrangu wants to merge 2 commits into
Open
fix(fs-storage)!: only probe bare INPUT and INPUT.json for run input#4120vladfrangu wants to merge 2 commits into
vladfrangu wants to merge 2 commits into
Conversation
The out-of-band fallback ladder shrinks to the extensionless key and .json. A v3-style INPUT.txt or INPUT.bin is no longer readable, listed, or exempt from the default-store purge on start.
janbuchar
approved these changes
Sep 10, 2026
janbuchar
left a comment
Contributor
There was a problem hiding this comment.
LGTM but let's delete some tests
Comment on lines
+316
to
+356
| // v3 also probed `INPUT.txt` and `INPUT.bin`. The ladder is now `''`/`.json` only: those files are | ||
| // neither resolved by the logical `INPUT` nor by their literal name, are not listed, and are not exempt | ||
| // from the default-store purge. | ||
| describe('legacy INPUT.txt / INPUT.bin bare files', () => { | ||
| const tmpLocation = resolve(import.meta.dirname, './tmp/fs-legacy-input-variants'); | ||
| const legacyFiles = ['INPUT.txt', 'INPUT.bin']; | ||
|
|
||
| afterEach(async () => { | ||
| await rm(tmpLocation, { force: true, recursive: true }); | ||
| }); | ||
|
|
||
| test.each(legacyFiles)('a bare %s is not readable', async (file) => { | ||
| const storage = new FileSystemStorageBackend({ localDataDirectory: tmpLocation }); | ||
| const dir = resolve(storage.keyValueStoresDirectory, 'default'); | ||
| await mkdir(dir, { recursive: true }); | ||
| await writeFile(resolve(dir, file), `payload of ${file}`); | ||
|
|
||
| const store = await storage.createKeyValueStoreBackend(); | ||
|
|
||
| expect(await store.getValue('INPUT')).toBeUndefined(); | ||
| expect(await store.recordExists('INPUT')).toBe(false); | ||
| expect(await store.getValue(file)).toBeUndefined(); | ||
| expect(await store.recordExists(file)).toBe(false); | ||
| expect((await store.listKeys()).items).toEqual([]); | ||
| }); | ||
|
|
||
| test('purge removes them from the default store', async () => { | ||
| const storage = new FileSystemStorageBackend({ localDataDirectory: tmpLocation }); | ||
| const dir = resolve(storage.keyValueStoresDirectory, 'default'); | ||
| await mkdir(dir, { recursive: true }); | ||
| await writeFile(resolve(dir, 'INPUT.json'), '{}'); | ||
| for (const file of legacyFiles) { | ||
| await writeFile(resolve(dir, file), `payload of ${file}`); | ||
| } | ||
|
|
||
| await storage.purge(); | ||
|
|
||
| const remaining = await readdir(dir); | ||
| expect(remaining.filter((file) => !file.startsWith('__metadata__'))).toEqual(['INPUT.json']); | ||
| }); | ||
| }); |
Contributor
There was a problem hiding this comment.
This pins the constant, not behaviour — the only way .txt/.bin come back is someone editing BARE_FILE_FALLBACKS on purpose. Probe scoping is already covered by the non-INPUT bare file is ignored test and the cross-talk block; the purge keep-list by default-storage-layout.test.ts and configured-input-key.test.ts. The BARE_VARIANTS shrink plus the upgrading bullet document the removal.
I'd drop this block.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The out-of-band fallback ladder for run input shrinks to the extensionless key and
.json. A v3-styleINPUT.txtorINPUT.binis no longer readable (underINPUTor its literal name), is not listed, and is no longer exempt from the default-store purge on start.BARE_FILE_FALLBACKSdrops.txt/.bin; purge keep-list,listKeys, and literal-key resolution follow from it..txt/.binremoved from the reachability matrix; new block asserts they are unreadable and purged whileINPUT.jsonsurvives.[🤖] Claude Code using Fable 5.1