Skip to content

fix(fs-storage)!: only probe bare INPUT and INPUT.json for run input - #4120

Open
vladfrangu wants to merge 2 commits into
masterfrom
worktree-kvs-input-ladder
Open

fix(fs-storage)!: only probe bare INPUT and INPUT.json for run input#4120
vladfrangu wants to merge 2 commits into
masterfrom
worktree-kvs-input-ladder

Conversation

@vladfrangu

Copy link
Copy Markdown
Member

The out-of-band fallback ladder for run input shrinks to the extensionless key and .json. A v3-style INPUT.txt or INPUT.bin is no longer readable (under INPUT or its literal name), is not listed, and is no longer exempt from the default-store purge on start.

  • BARE_FILE_FALLBACKS drops .txt/.bin; purge keep-list, listKeys, and literal-key resolution follow from it.
  • Tests: .txt/.bin removed from the reachability matrix; new block asserts they are unreadable and purged while INPUT.json survives.
  • Upgrading guide gets a bullet describing the shrink and the purge consequence.

[🤖] Claude Code using Fable 5.1

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.
@github-actions github-actions Bot added this to the 149th sprint - Tooling team milestone Sep 10, 2026
@github-actions github-actions Bot added t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics. labels Sep 10, 2026

@janbuchar janbuchar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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']);
});
});

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants