This file provides guidance to agents when working with code in this repository.
- Debug compilation:
cabal install -f debug test-transient1 --overwrite-policy=always - Run monitor in debug mode:
runghc -w -threaded -rtsopts -i../src -i../../transient/src ../app/server/Transient/Move/Services/MonitorService.hs -p start/localhost/3000 - Run test suite in debug mode:
runghc -DDEBUG -w -threaded -rtsopts -i../src -i../../transient/src TestSuite.hs - Run examples:
runghc -DDEBUG -w -threaded -rtsopts -i../src -i../../transient/src flow.hs -p g 2>&1 | tee 8000.ansi - Compile examples:
ghc -DDEBUG -w -threaded -rtsopts -i../src -i../../transient/src flow.hs 2>&1 | tee 8000.ansi
- Distributed computing patterns: Use
wormholefor node communication,teleportfor stack transport - State management: Non-serializable mutable variables in stack are kept across successive invocations
- Exception handling:
onExceptionhandlers execute in LIFO order (last defined, first executed) - Exception recovery: Use
continueto stop propagation and resume normal execution after handler - Event propagation:
forwardis the general primitive for event control,continueisforwardfor exceptions - Concurrency patterns:
collectwiththreadsparameter controls parallelism level - Logging system: Uses custom logging with
loggedandloggedcfor checkpointing and recovery - Handler inheritance: Event handlers (
onException,onUndo,onFinish) are inherited by child threads - Finalization:
onFinishhandlers execute exactly once when entire computation branch finishes
- Main packages:
transient(core),transient-universe(distributed),transient-universe-tls(secure comms),axiom(web UI) - Test organization: Tests are in same directory as source files, not separate test folders
- Cross-compilation: Supports GHCJS for browser execution alongside native compilation
- Dependency resolution: Use
cabal install --lib --package-env . <library>when libraries not found
- Single test execution: Use
runghcwith specific include paths rather than cabal test - Distributed testing: Tests require multiple nodes running on different ports
- Debug output: Use
-DDEBUGflag and pipe to ANSI color files for log analysis - Performance profiling: Built-in profiling with
-prof -fprof-auto -rtsopts
- File encoding: Use
sed -i 's/\r//g' fileif encountering "No such file or directory" errors - Docker development: Many scripts assume Docker environment with specific image
- WebSocket connections: Browser nodes use WebSockets, server nodes use sockets
- State recovery: Execution logs are serialized and can restore computation state
- Handler ordering:
onExceptionhandlers execute in reverse order of definition (LIFO stack) - Thread safety: Event handlers propagate to child threads automatically via state inheritance
- Resource cleanup: Use
onFinishfor guaranteed cleanup, notonExceptionfor resource management - Exception control:
continueresumes execution AFTER the handler scope, not at the failure point