agentleFS
BariBariGoodBariBariGood/manzanas/.agents/skills/park-thaw-semantics/SKILL.md

park-thaw-semantics

Skill22 starsChanged 3 months agoApache-2.0View on GitHub

Rules for parked (SIGSTOPped) warm-pool simulators - why simctl/AXe hang on them, the thaw-before-shutdown invariant, and how the pool cycles sims. Read before running any manual simctl/ps/kill against a host whose manzanasd daemon has a warm pool.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never SIGKILL a parked tree: If a parked sim looks stuck, restart via the daemon (it thaws everything on shutdown — ThawAll — so trees are …

    line 22
  2. Very specific:

    If you find a stopped tree and the daemon is NOT running (crashed without cleanup): kill -CONT each PID of the tree, then simctl shutdown.

    line 33
  3. Very specific:

    Quarantine: if a post-lease reset fails or hangs (>10 min bound), the target is quarantined rather than handed out dirty.

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Park/thaw semantics

The warm pool (internal/warm) keeps pool sims booted+slimmed but PARKED: the whole process tree from launchd_sim down is SIGSTOPped, so an idle warm sim costs ~0 CPU. On lease grant the tree is SIGCONTed (thawed) using the PID list cached at park time (~25ms Apple Silicon / ~225ms Intel). On release+reset the sim is erased, re-booted, and parked again.

Hard invariants — violating these wedges the host

  1. ALWAYS thaw before shutdown. xcrun simctl shutdown on a parked sim wedges for ~34s. The daemon does this for you; never simctl shutdown a pool sim by hand.
  2. Never route actions at a parked sim. While parked, AXe fails and simctl spawn hangs. The daemon thaws on lease grant — acquire a lease instead of poking the sim directly.
  3. Never SIGKILL a parked tree. If a parked sim looks stuck, restart via the daemon (it thaws everything on shutdown — ThawAll — so trees are never left stopped behind a dead daemon).
  4. Double STOP / double CONT are harmless; Park/Thaw are idempotent.

How to recognize a parked sim

  • xcrun simctl list devices shows it Booted but it responds to nothing.
  • ps -axww -o pid,ppid,state,command | grep <UDID> shows state T (stopped) on the tree.

If you find a stopped tree and the daemon is NOT running (crashed without cleanup): kill -CONT each PID of the tree, then simctl shutdown. Only do this when you have verified no daemon owns the sim.

Related machinery (same package)

  • Footprint watchdog: sweeps pool sims (default every 1m); a sim whose tree phys_footprint exceeds --pool-footprint-cap-mb (default 3 GiB) is recycled (erase→boot→park). Footprint is measured with /usr/bin/footprint (kernel phys_footprint) — summing ps RSS overcounts ~8x on sim trees.
  • Orphan reaper: kills leftover launchd_sim trees the daemon itself parked earlier (ownership ledger keyed by PID+command, never a recycled PID). It does not touch trees it never owned.
  • Quarantine: if a post-lease reset fails or hangs (>10 min bound), the target is quarantined rather than handed out dirty. Clear with POST /v0/targets/{udid}/clear-quarantine after fixing the cause.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.