Run the plan-execute loop inside the daemon #11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Gap found while delivering RAM-10 (the standalone CLI).
The action coordinator (RAM-7) can execute a plan with confirmations, a bounded journal, and recovery, and the CLI can now report every recorded action with its reason, target, timestamp, result, requested effect, and observed effect. Nothing yet connects the two: the daemon's monitor loop collects an observation, runs the state machine, and produces a dry-run plan, but it never hands that plan to the coordinator. So the journal is always empty and the end-to-end path "pressure in, memory released, pressure down" is still not demonstrable.
Scope
automaticand only the actions the configuration allows.breadram actionsshows real history, and publish the resulting state so a restart recovers owned values safely.Acceptance criteria
automaticand an allowed action configured, a pressured host is measurably relieved and the journal shows the reason, the target, the timestamp, the result, and the measured effect.monitornothing is written, whatever the pressure, and the CLI's explanation still describes what automatic mode would do.Related: RAM-20 (managed scopes) and RAM-21/RAM-22 (priorities and budgets) depend on this step existing, since policy depth is not observable until actions actually run.
Implemented and merged in PR #15,
mainat639f630.What landed:
breadram-core/src/execution.rs(the plan-execute step),breadram-core/src/coordinator/persist.rs(the versioned state file), journal additions (from_owned_values,history), the adapter registry built from configured providers, and the daemon wiring inbreadramd/src/daemon.rs.docs/ARCHITECTURE.mdgained AD-11 anddocs/AGENT-HANDOFF.mdnow describes the real current state.Acceptance criteria, each with the evidence behind it
automaticmode against a transient user scope holding 200 MiB with a 4 MiB budget. breadram setMemoryHighthrough systemd,MemoryCurrentwent 66.8 MiB → 4.2 MiB, andbreadram actionsshowedconfirmed | at_ms | requested: -62599168 | observed: -9408512with the reason "it is 62599168 bytes over its 4194304 byte budget…" and the owned value with its original. Later passes reportedskipped_duplicate, so the action is not applied twice.dry_runwith the monitor note, left the state file byte for byte unchanged, and wrote no journal entry.rolled_backentry; a value that no longer matches what breadram last wrote is reported as left alone, and a state file this build cannot read is refused rather than reinterpreted.execution.rscovers all four against a fake executor plus monitor-mode and duplicate-suppression cases;daemon.rscovers the daemon's own gating (automatic writes and journals, monitor writes nothing, disallowed action refused, second pass not repeated, state file round trip and unreadable file).Verification on the merged head:
cargo fmt --all -- --checkclean,cargo clippy --workspace --all-targets -- -D warningsclean,cargo test --workspace336 tests pass.Two defects were caught by the live run rather than by reading: a recovered ownership record satisfied
has_confirmed, which would have suppressed the action forever after a restart even though the restart had just undone it; and the startup restore note was cleared by the next tick.Scope item not delivered, with the reason: "adapter and control executor wiring" is half done. The control executor is wired and real. The registry is built from
config.providers(a provider now names the workload scope it owns, validated) and its activity evidence reaches the planner, so an idle-model release is plannable. What is missing is executing a provider action: there is still no HTTPTransportinbreadram_core::adapter(onlyScriptedTransport), so nothing can call a provider. That belongs with RAM-13/RAM-14 (which need it to talk to a real server) and RAM-45; I have not pretended otherwise in the docs or the PR.