layerfs-sdk-observe
GitHub用于观察、测量和排查 LayerFS 运行时状态,通过调用链追踪、存储指标和守护进程日志进行诊断,不涉及实际工作执行。
Trigger Scenarios
Install
npx skills add Ephemeral-AI-Lab/layerfs --skill layerfs-sdk-observe -g -y
SKILL.md
Frontmatter
{
"name": "layerfs-sdk-observe",
"description": "Use when observing, measuring or troubleshooting a LayerFS run rather than doing the work itself. Activates on the LayerFS call trace (`LAYERFS_TRACE`, `LAYERFS_TRACE_STEP`), SDK operation timing and phase breakdowns, LayerFS storage deduplication and compression over history, `@layerfs\/sdk\/operator` (`store.stats`, `store.commits`, `files.history`, `workspace.overlay`, `process.*`), or LayerFS daemon logs and observation records."
}
Observing a LayerFS run
Status: Current general guide. For whoever watches or troubleshoots a LayerFS run (an orchestrator, a maintainer), not for an agent doing the work. Using the SDK is the separate
layerfs-js-sdkskill.
This skill uses internal surfaces: the @layerfs/sdk/operator entry point, the opt-in
call trace and the daemon's diagnostic records. None of them changes the project. Don't
hand them to an agent doing production work.
| Question | Source | Page |
|---|---|---|
| How long did each SDK call take, and which phase was slow? | Call trace (LAYERFS_TRACE) with phase timing |
tracing |
| Is storage deduplicating and compressing over a long history, or blowing up? | operator.store.stats, operator.store.commits, trace sizes |
storage metrics |
| What did the Store, SQLite, locks and FUSE do during a call? | Daemon records in docker logs, decoded and joined to the trace |
daemon logs |
| What does a Workspace hold uncommitted, what is a file's history, which background processes run? | Operator methods | operator |
Collecting a run
For an agent run you want to analyse afterwards:
- Before the run, set
LAYERFS_TRACE=<run>/trace.jsonlfor every process. Ask the agent to setLAYERFS_TRACE_STEPon each command it runs. - Record identities: LayerFS commit, daemon binary, runtime image digest, addon build.
- Snapshot
operator.store.stats()at the start, every N Commits if you can, and at the end. - After the run, before closing the Sandboxes: page
operator.store.commits(branch)for every Branch, and savedocker logs <container>for every Sandbox (the container identifier is in$LAYERFS_HOME/_sandboxes/<sandbox name>/container). - Decode and join: see daemon logs. Build the per-step table: see storage metrics.
Treat every number as diagnostic: one run, tracing on, no cache control. It is not a benchmark measurement.
Version History
- 16e622e Current 2026-10-18 16:12


