clerk

mathpunk 2024-12-09T19:22:49.158189Z

I'm analyzing some configuration data and I always reach for Clerk when I want to writecode my way through understanding something. I got to the point that clojure.spec seemed like it would be useful to apply to my problem, and now I'm getting some results where I don't know if (1) I just don't understand specs well enough (likely), or I'm using a workflow that is uncovering a confusion between Clerk caching and the registry where specs live (possible I guess? caching is out of my depth) 🧵

mathpunk 2025-01-06T15:33:30.374509Z

Opting out of caching was all I needed! I didn't realize that would do the right thing with the global registry, thank you

mkvlr 2024-12-13T06:47:59.033919Z

since spec uses a global registry it’s very likely to not play nice with caching

mkvlr 2024-12-13T06:48:34.399089Z

do things work okay if you opt out of caching in the namespace declaration?

mkvlr 2024-12-13T06:49:18.496789Z

btw there’s also clerk/clear-cache! which wipes both the in memory and disk cache

mathpunk 2024-12-09T19:23:19.474259Z

mathpunk 2024-12-09T19:23:57.155779Z

And then this happens, which is not what I expect:

mathpunk 2024-12-09T19:24:56.372529Z

I'm expecting :shell "cd docker" but invalid for the second one

mathpunk 2024-12-09T19:25:39.101189Z

but no!

mathpunk 2024-12-09T19:27:13.257959Z

i figure it's likely i'm holding one of these tools wrong but i have not been able to figure out how

mathpunk 2024-12-09T19:28:34.001439Z

and then, the next thing that happens is,

mathpunk 2024-12-09T19:29:26.063119Z

i go, wait could it be the '( list form? maybe i should use a different collection when i'm typing

mathpunk 2024-12-09T19:29:31.713969Z

so i

mathpunk 2024-12-09T19:30:08.150319Z

and suddenly

mathpunk 2024-12-09T19:30:54.529649Z

I don't know if many people are out here iteratively developing specs in clerk so it seems conceivable i found a crack, idk

mathpunk 2024-12-09T19:47:59.376839Z

mathpunk 2024-12-09T19:49:06.666889Z

when I uncomment a usage of that though,

(s/conform ::script  ["cd docker" "./dockerify.sh"])
then I get

mathpunk 2024-12-09T19:51:55.936409Z

Stop Clerk. rm -rf ./clerk/cache. Restart clerk

mathpunk 2024-12-09T19:52:10.148629Z

eyyyy there we go

mathpunk 2024-12-09T19:53:24.194049Z

Ok cool. I now am getting the results I expect. I'm going to continue on doing my work, but let me know if I can help with this issue

mathpunk 2024-12-09T20:18:07.793729Z

HMM so then I thought maybe I should change some of the tag names, and I discover that rm -rf .clerk/cache is not a hard enough cache refresh

mathpunk 2024-12-09T20:20:44.377779Z

mathpunk 2024-12-09T20:20:59.586949Z

no error... and then, if I conform new data,

mathpunk 2024-12-09T20:21:20.708629Z

mathpunk 2024-12-09T20:21:32.963449Z

mathpunk 2024-12-09T20:30:37.165129Z

I can recover.... kind of..... if what I do is introduce new nonsense words.

mathpunk 2024-12-09T20:31:42.131389Z

Anyway I have removed .clerk/cache and .cpcache and the stale spec registration remains. Maybe this is a workflow issue and I should instead version my understandings like ::invocation-1