feat: appRunning condition and systemPackages DSL support #41

Merged
yorunikakeru merged 5 commits from feat/app-running into main 2026-06-19 22:46:43 +02:00
Owner

Summary

  • appRunning — new DSL condition for FrogOS app/package identity. Users write appRunning "steam" instead of matching raw process names; the runtime/Toad layer resolves the identity to concrete process observations. processRunning is retained as a documented low-level escape hatch.

  • systemPackages — new MonadPackages typeclass with systemPackages :: [Text] -> m () working in three scopes:

    • configuration — global, available to all users
    • service "x" — available only to the service's user/group
    • profile / when — conditional, available while the profile is active; not guaranteed stable in $PATH

Package names are validated (non-empty); all other validation is deferred to the Planner.

IR changes

Both features required upstream IR changes (committed and pushed to IR main before this PR):

  • IR.Domain.Process: AppName newtype + AppRunning condition constructor
  • IR.Domain.Package: new module with PackageName newtype
  • IR.Types: new irPackages, profilePackages, serviceSectionPackages fields — omitted from JSON when empty, default to [] when absent (backward compatible, no version bump)

Test plan

  • appRunning construction/validation tests in DSL.ConstructionSpec
  • appRunning golden JSON fixture (test/fixtures/app-running.json)
  • appRunning round-trip and builder-mirror tests in SerializationSpec
  • systemPackages construction/validation tests (all three scopes) in DSL.ConstructionSpec
  • systemPackages golden JSON fixture (test/fixtures/system-packages.json)
  • systemPackages round-trip and builder-mirror tests in SerializationSpec
  • All 110 DSL tests pass; all 91 IR tests pass; stan 100% on both
## Summary - **appRunning** — new DSL condition for FrogOS app/package identity. Users write appRunning "steam" instead of matching raw process names; the runtime/Toad layer resolves the identity to concrete process observations. processRunning is retained as a documented low-level escape hatch. - **systemPackages** — new MonadPackages typeclass with systemPackages :: [Text] -> m () working in three scopes: - configuration — global, available to all users - service "x" — available only to the service's user/group - profile / when — conditional, available while the profile is active; not guaranteed stable in $PATH Package names are validated (non-empty); all other validation is deferred to the Planner. ## IR changes Both features required upstream IR changes (committed and pushed to IR main before this PR): - IR.Domain.Process: AppName newtype + AppRunning condition constructor - IR.Domain.Package: new module with PackageName newtype - IR.Types: new irPackages, profilePackages, serviceSectionPackages fields — omitted from JSON when empty, default to [] when absent (backward compatible, no version bump) ## Test plan - appRunning construction/validation tests in DSL.ConstructionSpec - appRunning golden JSON fixture (test/fixtures/app-running.json) - appRunning round-trip and builder-mirror tests in SerializationSpec - systemPackages construction/validation tests (all three scopes) in DSL.ConstructionSpec - systemPackages golden JSON fixture (test/fixtures/system-packages.json) - systemPackages round-trip and builder-mirror tests in SerializationSpec - All 110 DSL tests pass; all 91 IR tests pass; stan 100% on both
Users can now write `appRunning "steam"` instead of matching raw process
names. The DSL passes the app identity through to IR unchanged; the
runtime/Toad layer resolves it to concrete process observations.

processRunning is retained as a documented low-level escape hatch.
feat: add systemPackages to DSL for FrogOS package declarations
All checks were successful
CI / linux (pull_request) Successful in 2m11s
b9f36870cb
MonadPackages typeclass with systemPackages :: [Text] -> m () works
in configuration (global), service, and profile/when (conditional)
contexts. Conditional packages are not guaranteed stable in $PATH.

IR gains irPackages, profilePackages, serviceSectionPackages fields.
Empty lists are omitted from JSON; absent fields default to [].
refactor: replace MonadPackages typeclass with plain systemPackages/servicePackages
All checks were successful
CI / linux (pull_request) Successful in 1m6s
e8171d30b7
Remove the MonadPackages typeclass entirely. Replace with two plain functions:
- systemPackages :: [Text] -> ConfigBuilder () at the top-level configuration scope
- servicePackages :: [Text] -> Builder scope () inside service/profile/when bodies

ConfigBuilder reverts to a type alias (StateT ConfigState). All fmap calls in
DSL.Condition replaced with <$>.
fix: address review findings on appRunning/systemPackages PR
All checks were successful
CI / linux (pull_request) Successful in 1m7s
9f870ce25a
- Remove MonadPackages typeclass; restore separate servicePackages/systemPackages
  with distinct types (Builder scope vs ConfigBuilder)
- Export servicePackages from DSL module alongside systemPackages
- Revert spurious do-block in app/Main.hs
- Restore not = fmap Not (clearer than operator section)
- Fix ConstructionSpec to use servicePackages inside service/profile builders
style: use named record syntax for empty builder states
All checks were successful
CI / linux (pull_request) Successful in 1m7s
cad2407b7e
yorunikakeru deleted branch feat/app-running 2026-06-19 22:46:48 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
FrogOS/DSL!41
No description provided.