aboutsummaryrefslogtreecommitdiffstats
path: root/app/History/Plan.hs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-26 07:10:05 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-26 07:24:02 +0100
commit22fd4b079dcf02a72fbd26c9d6733b5ec250ea53 (patch)
tree88d24d2b9e6e49e7af3671b718b457fe8971ed6e /app/History/Plan.hs
parent1290402724684a47b5f36f1158b7fbc7b5406a09 (diff)
Previously, we tracked re-opening of issues by advancing the commit hash for scrambles that do not witness an issue. Advancing the commit hash for scrambles not witnessing an issue is obviously incorrect. To see that, consider a top/earlier commit that creates a new file with an issue in it. None of the bottom/later scrambles witness the issue. Hence, it would have been logged as being created in the bottom-most/latest commit instead of the top-most/earliest commit.
Diffstat (limited to 'app/History/Plan.hs')
-rw-r--r--app/History/Plan.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/History/Plan.hs b/app/History/Plan.hs
index 3dec391..d7984c6 100644
--- a/app/History/Plan.hs
+++ b/app/History/Plan.hs
@@ -41,6 +41,8 @@ class Planable output where
protoOf :: Proxy output -> Id output -> IO (Proto output)
assume :: Proto output -> output
propagate :: [Id output] -> output -> Proto output -> output
+ postprocess :: [Id output] -> output -> output
+ postprocess _ = id
data Plan output = Plan (NE.NonEmpty (Id output)) [Task output]
@@ -102,7 +104,7 @@ realise plan@(Plan ids tasks) = do
output <- atomically $ do
maybe retry pure . M.lookup id . (.outputs) =<< readTVar stateT
killThread tid
- pure output
+ pure (postprocess (NE.toList ids) output)
step ::
(Ord (Id output), Planable output) =>