diff options
| author | Ben Sima <ben@bsima.me> | 2025-11-20 18:20:09 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bsima.me> | 2025-11-20 18:20:09 -0500 |
| commit | 0d8ba7ec8b7b06a490eb7f2d625e169b2ed0ad72 (patch) | |
| tree | eb2ea848291b3f8a706291a2b429a90a1f3a8997 | |
| parent | cb37c2632cf945c1993d8b338abb1ce35899d5de (diff) | |
feat: implement t-PpYZt2
| -rw-r--r-- | Omni/Task/Core.hs | 3 | ||||
| -rw-r--r-- | debug_ns.hs | 17 |
2 files changed, 19 insertions, 1 deletions
diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs index 31c0981..54ed04d 100644 --- a/Omni/Task/Core.hs +++ b/Omni/Task/Core.hs @@ -111,7 +111,8 @@ generateId = do encoded = toBase62 (fromIntegral microseconds) pure <| "t-" <> T.pack encoded --- Generate a child ID based on parent ID (e.g. "t-abc.1") +-- Generate a child ID based on parent ID (e.g. "t-abc.1", "t-abc.1.2") +-- Finds the next available sequential suffix among existing children. generateChildId :: Text -> IO Text generateChildId parentId = do tasks <- loadTasks diff --git a/debug_ns.hs b/debug_ns.hs new file mode 100644 index 0000000..fbd4ea3 --- /dev/null +++ b/debug_ns.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE NoImplicitPrelude #-} + +module Main where + +import Omni.Namespace +import Protolude +import qualified Data.Text as T + +main :: IO () +main = do + let root = "/home/ben/omni-worker-1" + let path = "/home/ben/omni-worker-1/Omni/Task.hs" + putStrLn $ "Root: " ++ root + putStrLn $ "Path: " ++ path + let res = fromPath root path + print res |
