fgof-devloop Public
Code
Use Git or checkout with SVN using the web URL.
No matching headings.
fgof-devloop
Watch-driven rebuild, restart, and smoke-loop helpers for modern Fortran tools.
fgof-devloop is intended to be a small standalone library for the reusable
parts of development loops: deciding when file changes should trigger work,
tracking run cycles, modeling restart policy, and layering those decisions
over fgof-watch, fgof-process, and fgof-jobs.
It is part of the FortranGoingOnForty lib-modules
catalog, but it is intended to stand on its own as a normal fpm package.
Current v1 target:
- stable dev-loop option and state types
- deterministic cycle and restart decision helpers
- watch-event shaping that can consume
fgof-watch - process-runner integration that can supervise rebuild and run commands
- long-running service/job restart planning over
fgof-jobs - examples for command-line tools and local service smoke loops
Status
v0.1.0 is released.
Tracked today:
- package layout, CI, and standalone repo setup
- local sprint plan in ignored
.docs/sprints/ - stable option, trigger, cycle, decision, and state types
- pure run-cycle helpers for start, finish, stop, and restart decisions
- deterministic failure policy through
stop_on_failureandmax_failures fgof-watchintegration through shaped event summaries and trigger policy- loop-owned restart filters for directory events and minimum change counts
- watch option projection for debounce polls, hidden-path ignores, and directory-event emission
fgof-processintegration for one-shot build, run, and smoke command supervision- command results that retain full
process_resultoutput, exit, timeout, and error detail fgof-jobsintegration for long-running service ownership, wait observation, cleanup, and restart planning- pipeline-aware job observation that preserves terminal member state during group stop/continue events
- released jobs are treated as unmanaged and will not receive restart/stop/start plans
- tracked examples for watch-driven command cycles and service restart planning
- CI coverage for both
fpm test --verboseandfpm run --example --all - focused model, watch-bridge, process-supervision, job-supervision, and example coverage
Public API Shape
Primary modules:
fgof_devloopfgof_devloop_types
Current public procedures:
clear_devloop_optionsclear_devloop_triggerclear_devloop_cycleclear_devloop_decisionclear_devloop_watch_summaryclear_devloop_command_specclear_devloop_command_resultclear_devloop_supervision_resultclear_devloop_job_specclear_devloop_job_stateclear_devloop_job_plandevloop_backend_nameclear_devloop_statestart_devloopstop_devloopshould_start_on_opendevloop_start_triggerdevloop_change_triggerdevloop_manual_triggerdevloop_summarize_watch_eventsdevloop_watch_failure_summarydevloop_watch_optionsdevloop_watch_triggerdevloop_build_commanddevloop_run_commanddevloop_smoke_commandrun_devloop_commandrun_devloop_cycledevloop_service_jobattach_devloop_jobattach_devloop_pipeline_membersobserve_devloop_jobrelease_devloop_jobdevloop_job_restart_planbegin_devloop_cyclefinish_devloop_cycle
Current semantics:
devloop_optionscarries run-on-start, restart-on-change, directory restart, hidden-path ignore, debounce, stop-on-failure, and max-failure policydevloop_triggerrecords why work should begin, such as start, file change, or manual requestdevloop_watch_summarycondensesfgof-watchevent batches into file, directory, create, modify, remove, move, ignored, and failure countersdevloop_watch_options()projects dev-loop policy intofgof-watchoptions for debounce polls, hidden-path filtering, and directory event emissiondevloop_watch_trigger()turns successful watch summaries into change triggers while suppressing watcher failures, disabled restart-on-change policy, empty batches, directory-only batches when disabled, and batches belowmin_restart_changesdevloop_change_trigger()suppresses nonpositive change counts so empty batches cannot start cycles through the lower-level trigger APIdevloop_build_command(),devloop_run_command(), anddevloop_smoke_command()wrapfgof-processcommands with loop roles and optional process optionsrun_devloop_command()executes one command spec and preserves the rawprocess_result, including stdout, stderr, exit code, timeout state, and process error detailsrun_devloop_cycle()starts a cycle, executes enabled build/run/smoke specs in order, skips later specs after the first failure, and feeds the outcome intofinish_devloop_cycle()devloop_service_job()builds a long-running service/job spec backed byfgof-jobsattach_devloop_job()records an already-launched pid/process group and ownership expectationsobserve_devloop_job()appliesfgof-jobswait results while preserving member-level terminal statedevloop_job_restart_plan()models whether a watched change should stop, start, restart, release, or require terminal handoff for a long-running job; released jobs and release-on-handoff plans return no stop/start/restart actionbegin_devloop_cycle()increments the cycle counter and starts work only when the loop is active, idle, and policy permits the triggerfinish_devloop_cycle()records success or failure and returns an explicit decision to idle, restart, or stop- negative
max_failuresvalues normalize to unlimited failures - negative
debounce_pollsvalues normalize to no debounce - Sprint 05 remains model-first: it plans and observes long-running job ownership, while actual spawning/signaling stays in the launcher layer
Dependency
fgof-devloop depends on fgof-watch v0.1.0 for watch-event types and
watch option projection, fgof-process v0.1.1 for one-shot process
execution, and fgof-jobs v0.1.0 for long-running job ownership and
wait-state modeling:
[dependencies]
fgof-jobs = { git = "https://github.com/FortranGoingOnForty/fgof-jobs.git", tag = "v0.1.0" }
fgof-process = { git = "https://github.com/FortranGoingOnForty/fgof-process.git", tag = "v0.1.1" }
fgof-watch = { git = "https://github.com/FortranGoingOnForty/fgof-watch.git", tag = "v0.1.0" }
Build And Test
fpm test
fpm run --example --all
Examples
Tracked examples live in example/ and are intentionally deterministic:
watch_cycle_demo.f90shapes a synthetic watch batch into a trigger, then runs build and smoke commands throughfgof-processservice_restart_demo.f90models restart and release behavior for a long-running service using an attachedfgof-jobshandle
Supported Platforms
- macOS
- Linux
Boundaries
- focused on reusable development-loop mechanics, not a full CLI app
- should remain useful on its own even if future tools wrap it with UI policy
- watch, process, and job integration should stay layered over stable state transitions
- does not spawn long-running services or send signals directly; callers own
launcher policy and use
devloop_job_restart_plan()as the planning surface - uses tagged dependencies for the released process, watch, and jobs surfaces
License
MIT