synthesize [WORKFLOW STATE] for prefect check; hoist cargo TYPE_CHECKING imports
- New core/workflow_state.py mirrors the episodic-synth pattern: pull
recent flow runs + stuck candidates from prefect REST, run a haiku
pass anchored by [NOW], and inject a per-deployment health summary
([WORKFLOW STATE]) into process_prefect_check. Phi no longer has to
aggregate timestamps in her head — the synth has already done it,
with current state defined relative to NOW.
- Two queries: recent activity (limit 100, COMPLETED/FAILED/etc) and
stuck candidates (PENDING/RUNNING with expected_start more than 1h
ago). The second catches things like a flow run stuck in Submitting
for 40 days that fall off any sane recent-activity window.
- Block named [WORKFLOW STATE] (not [PREFECT STATE]) — the workflow
tool is fungible, the surface phi sees should reflect that.
- 5min cache, same shape as the other dynamic state blocks.
While here: hoisted three TYPE_CHECKING-guarded imports of NamespaceMemory
(observations.py, discovery_pool.py, self_state.py) to direct imports.
bot.memory doesn't import from bot.core (no circular risk) and bot/agent.py
already imports from bot.memory unguarded, so the SDK weight is loaded
either way. The guards were cargo. from __future__ import annotations
removed from the same files where it had no other use.