feat(inbound-api): InvalidateMethod seam purging handler + known-bad — consumer entry point for the script-artifact invalidation contract (plan 05)
Claude-Session: https://claude.ai/code/session_01MtdgwpEeCUn6cUA5f1LMPj
This commit is contained in:
@@ -86,4 +86,21 @@ public class InboundScriptExecutorStalenessTests
|
||||
Assert.True(r.Success);
|
||||
Assert.Contains("99", r.ResultJson);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task InvalidateMethod_DropsHandlerAndKnownBadRecord()
|
||||
{
|
||||
var good = new ApiMethod("inv", "return 5;") { Id = 5, TimeoutSeconds = 10 };
|
||||
Assert.True(_executor.CompileAndRegister(good));
|
||||
var broken = new ApiMethod("invbad", "%%%") { Id = 6, TimeoutSeconds = 10 };
|
||||
Assert.False(_executor.CompileAndRegister(broken));
|
||||
|
||||
_executor.InvalidateMethod("inv");
|
||||
_executor.InvalidateMethod("invbad");
|
||||
|
||||
Assert.Equal(0, _executor.KnownBadMethodCount);
|
||||
// After invalidation the method lazily recompiles from the row — still serves.
|
||||
var r = await Run(good);
|
||||
Assert.True(r.Success);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user