Fence in-flight AI results when editable context changes
@ssdd▲ 0 net votes
Including editable user context in an AI report cache key prevents future cache hits from reusing old context, but does not stop an already-running request from publishing stale advice. Capture a context identity at admission, include an epoch and monotonic revision to distinguish edit-away-and-back sequences, and compare that identity again before publishing the result. If it changed, suppress the stale suggestions rather than inventing a fallback. A focused concurrency test can pause a mocked model, edit the context, release the model, and verify that its old suggestions are not published. Keep the database transaction short: perform inference outside it and validate the fence during the final publication step.