Skip to content

Commit 7dfe91b

Browse files
committed
test(runtime): main 新增的 #5079 ARTIFACT-backed 用例改走 OS_METADATA_WRITABLE 逃生门
合并 origin/main 后的 jointly-wrong 破坏(AGENTS.md §10):两侧各自正确、 合起来红。main 在 meta-overlay-read-your-writes.test.ts 新增了整个 `#5079 — list / get / dispatch agree immediately after deleteMeta` describe 块, 其中 `an ARTIFACT-backed delete resets to the shipped value` 用例对一个 PACKAGED action 做 overlay 写;本 PR 把 `action` 的 allowOrgOverride 回滚为 false(#6483 裁决),该写点遂抛 NOT_OVERRIDABLE。文本合并干净,故 git 无冲突。 对齐方式沿用本 PR 已提交的同类处置(#4521 块中的同形用例):打开 `OS_METADATA_WRITABLE` 运营逃生门并重置两处 memoised 缓存,配 afterEach 清理, 避免 action 可写性泄漏到相邻用例。该 describe 块其余用例写的都是全新名字, 走 allowRuntimeCreate,不受回滚影响,故只此一处需要逃生门。 pnpm --filter @objectstack/runtime test: 115 files / 1733 tests 全绿。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011sGk4SKHqGRgmmqUok1P8M
1 parent 698fae3 commit 7dfe91b

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

packages/runtime/src/meta-overlay-read-your-writes.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,31 @@ describe('#5079 — list / get / dispatch agree immediately after deleteMeta', (
346346
expect((await surfaces('only_one')).listedNames).toEqual([]);
347347
});
348348

349+
afterEach(() => {
350+
// The escape-hatch case below must not leak `action` writability into
351+
// its neighbours — both memoised caches, or the next case lies.
352+
delete process.env.OS_METADATA_WRITABLE;
353+
(ObjectStackProtocolImplementation as any).resetEnvWritableCache();
354+
resetEnvWritableMetadataTypes();
355+
});
356+
349357
it('an ARTIFACT-backed delete resets to the shipped value — it does not retire the name', async () => {
350358
// The boundary the #5079 fix must not cross. `removeRuntimeShadow`
351359
// still owns this case; `removeOverlayEntry` must never reach it, or a
352360
// "reset to artifact default" would delete the artifact instead of
353361
// revealing it.
362+
//
363+
// #6483 rolled `action`'s `allowOrgOverride` back to `false`
364+
// (ADR-0005: page/app/action are ❌ in the amendment table), so
365+
// overriding this PACKAGED action needs the one documented door that
366+
// remains — the `OS_METADATA_WRITABLE` operator escape hatch, exactly
367+
// as the sibling `#4521` case above does. (Every other case in this
368+
// block writes brand-new names, which ride `allowRuntimeCreate`
369+
// untouched, so only this one needs the hatch.)
370+
process.env.OS_METADATA_WRITABLE = 'action';
371+
(ObjectStackProtocolImplementation as any).resetEnvWritableCache();
372+
resetEnvWritableMetadataTypes();
373+
354374
registry.registerItem(
355375
'action',
356376
{ name: 'shipped_probe', label: 'Shipped', type: 'script', target: 'showcase.shipped' },

0 commit comments

Comments
 (0)