Skip to content

feat(observability): OS signposts for pressure / pageout / freeze-tier - #51

Merged
froggychips merged 1 commit into
mainfrom
feat/observability-signposts
Sep 20, 2026
Merged

froggychips merged 1 commit into
mainfrom
feat/observability-signposts

Conversation

@froggychips

Copy link
Copy Markdown
Owner

Summary

Adds time-correlated signposts in three places that produce the clearest pressure → freeze decision → pageout outcome timeline in Instruments:

  • MemoryPressureSource — signpost event on each level change (.normal / .warning / .critical), with PointsOfInterest twin so the standard PoI track shows pressure changes alongside any other component's events.
  • PageoutChain.pageout — interval per strategy attempt, with strategy + outcome (success / skipped / failed). Closes the validation-gate question from ADR-0007 / 0011: "which pageout strategy actually fires on this machine".
  • VortexCoordinator.freezeTier — interval per freeze cycle, with tier + candidate count + final frozen count.

Why

Today's live session showed the three biggest gaps in current observability:

  1. We could not tell from the unified log alone whether mach_vm_behavior_set was actually fired or skipped under fallback to jetsam.
  2. We could not see the latency between a .warning dispatch event and the actual freezeTier call.
  3. We had no time-correlated picture of pressure level vs freeze decisions vs pageout outcomes.

All three are now visible as a single Instruments timeline.

How to use

xcrun instruments -t Logging /path/to/.build/release/FroggyDaemon
# or
open /Applications/Xcode.app/Contents/Applications/Instruments.app
# Choose the "Logging" template, attach to FroggyDaemon, filter
# subsystem == com.froggychips.froggy

Behavior change

None. Existing os.Logger lines preserved. Signposts are observability-only.

Test plan

  • make build clean
  • Manual: run daemon, push pressure to .warning and .critical, verify Instruments shows correlated pressure-level events + freeze-tier intervals + pageout-attempt intervals
  • Verify no regressions in existing tests (make test)

Follow-ups (not in this PR)

  • ADR for "Observability via OS signposts" recording categories + intent
  • Signposts for VortexActor.thawProcess / thawAll (thaw timeline)
  • Signposts for VisionActor OCR cycles
  • Signposts for full generation pipeline in MLXSupervisor (partial coverage exists)

Related

  • ADR-0006 reactive memory pressure
  • ADR-0007 pageout strategies
  • ADR-0011 validation gate (substrate-level honesty)
  • ADR-0014 design docs after implementation

Time-correlated signposts in the three places that produce the clearest
"pressure → freeze decision → pageout outcome" timeline in Instruments:

* `MemoryPressureSource` — an event per level change (.normal /
  .warning / .critical), with a PointsOfInterest twin so the standard
  PoI track shows pressure changes next to other components' events.
* `PageoutChain.pageout` — an interval per strategy attempt carrying the
  strategy and its outcome (success / skipped / failed), which answers
  the ADR-0007 / 0011 validation-gate question of which strategy
  actually fires on a given machine. ADR-0018 has since answered it for
  unprivileged runs; the interval still shows the per-attempt cost.
* `VortexCoordinator.freezeTier` — an interval per tier traversal with
  the tier, the reason, how many candidates were seen and how many were
  actually frozen (the rest being vetoes, already-frozen pids and
  reverts).

No behavior change: the existing `os.Logger` lines stay, signposts are
observability-only.

Rebased onto the current main: the original branch predates the
per-bundleId traversal, the audit log, frontmost veto and the policy
generation checks, so the freeze-tier interval was re-applied to the
traversal as it exists now rather than to its May shape.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R7Ei5xAcQz8FiwdHNMjJYF
@froggychips
froggychips force-pushed the feat/observability-signposts branch from 284bdf1 to 2dbaefb Compare September 20, 2026 08:25
@froggychips

Copy link
Copy Markdown
Owner Author

Ветка пересажена на текущий main (ce85f22) — прежняя история разошлась с main ещё в мае (общий предок f46d9c9), поэтому вместо мержа сделан cherry-pick содержательного коммита и force-push.

Что изменилось при пересадке: MemoryPressureSource и PageoutChain легли без правок, а вот freezeTier с мая переписан (обход per-bundleId, audit log, frontmost-veto, inFlightFreezes, проверки поколения политики), поэтому interval пришлось переложить на нынешний обход: candidates считается по ходу, frozen — только реально вставленные в tier-set, в метке добавлен reason. Поведение не меняется.

Проверка: swift build для FroggyDaemon / froggy / FroggyAudioWorker проходит без ошибок и без новых предупреждений. Тесты не запускались — на машине нет Xcode (только CommandLineTools, import XCTest не резолвится), self-hosted раннер offline.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 2dbaefbb09

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@froggychips
froggychips merged commit 46d2d02 into main Sep 20, 2026
1 of 3 checks passed
@froggychips
froggychips deleted the feat/observability-signposts branch September 20, 2026 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant