Skip to content

Commit 7ab2d91

Browse files
committed
test(metadata-protocol): the projector and signal censuses count the move-in door's two replays (#38150)
Claude-Session: https://claude.ai/code/session_01L9qibyHmxFV4bTFZ5BKnUz Co-authored-by: Claude <noreply@anthropic.com>
1 parent 61d7ebc commit 7ab2d91

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

‎packages/metadata-protocol/src/protocol.recovery-doors-emit-mutation.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,17 +671,20 @@ describe('[#14179] every announcing door goes through the choke point', () => {
671671
/** Every match of `pattern` in `protocol.ts` and every split module. */
672672
const sitesOf = (pattern: RegExp) => [source, ...splitSources].flatMap((text) => text.match(pattern) ?? []);
673673

674-
it('has exactly seven `emitMetadataMutation` call sites — three original, three doors, four limbs', () => {
674+
it('has exactly nine `emitMetadataMutation` call sites — three original, three doors, four limbs, two move-in replays', () => {
675675
// saveMetaItem · runPublishSideEffects · deleteMetaItem (repository)
676676
// + rollbackMetaItem
677677
// + revertCommit restore limb + revertCommit soft-remove limb
678678
// + deleteMetaItem (legacy raw-engine)
679+
// + moveIntoPackage's replay of a stopped move, twice: the target's
680+
// address as deleted, the package-less one as restored
681+
// (`protocol-package-move-in.ts` `replayRestored`) [#38150]
679682
// A new door that reaches for the LOCAL-only fan-out instead would
680683
// leave this count untouched and lose the cluster half in silence, so
681684
// §5's second case counts that method's callers too.
682685
// [#29985] `host.` in a moved body is the same call (ruling E's rewrite set).
683686
const callSites = sitesOf(/\b(?:this|host)\.emitMetadataMutation\(/g);
684-
expect(callSites).toHaveLength(7);
687+
expect(callSites).toHaveLength(9);
685688
// Non-vacuity: the declaration is not one of them.
686689
expect(source.match(/private emitMetadataMutation\(/g) ?? []).toHaveLength(1);
687690
});

‎packages/metadata-protocol/src/protocol.recovery-doors-mutation-projector.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,14 +508,17 @@ describe('every projecting door goes through runMutationProjector', () => {
508508
/** Every match of `pattern` in `protocol.ts` and every split module. */
509509
const sitesOf = (pattern: RegExp) => [source, ...splitSources].flatMap((text) => text.match(pattern) ?? []);
510510

511-
it('has exactly seven `this.runMutationProjector(` call sites — three original, four recovery-door sites', () => {
511+
it('has exactly nine `this.runMutationProjector(` call sites — three original, four recovery-door sites, two move-in replays', () => {
512512
// saveMetaItem · runPublishSideEffects · deleteMetaItem (repository)
513513
// + rollbackMetaItem
514514
// + revertCommit restore limb + revertCommit soft-remove limb
515515
// + deleteMetaItem (legacy raw-engine)
516+
// + moveIntoPackage's replay of a stopped move, twice: the target's
517+
// address as deleted, the package-less one as restored
518+
// (`protocol-package-move-in.ts` `replayRestored`) [#38150]
516519
// [#29985] `host.` in a moved body is the same call (ruling E's rewrite set).
517520
const callSites = sitesOf(/\b(?:this|host)\.runMutationProjector\(/g);
518-
expect(callSites).toHaveLength(7);
521+
expect(callSites).toHaveLength(9);
519522
// Non-vacuity: the declaration is not one of them.
520523
expect(source.match(/private async runMutationProjector\(/g) ?? []).toHaveLength(1);
521524
});

0 commit comments

Comments
 (0)