@nredd/pi-resource-sampler 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +20 -11
  2. package/package.json +7 -10
package/README.md CHANGED
@@ -4,13 +4,11 @@ Pi-independent, dependency-free ESM library for passive host resource dashboards
4
4
  `@nredd/pi-resource-sampler` is not a Pi extension. No tools, timers, hooks, output or policy are
5
5
  registered. Runs on Node >=22.14 and Bun.
6
6
 
7
- Sampler `0.2.0` adds native Darwin interval CPU/footprint and host used/swap metrics. Its
8
- consumer pins are exact registry dependencies, never workspace links.
9
-
10
- Unreleased after `0.2.0`: published `0.2.0` lists `/proc` with `opendir`, so on Linux any PID exiting
11
- mid-listing rejects the whole listing (`lstat` ENOENT on the `DT_UNKNOWN` entry). That scan returns no
12
- processes (`process-collection-unavailable`) and, as a baseline, leaves every next-scan process
13
- `warming` (#499). This source lists names only; it needs a release and consumer pin bumps.
7
+ Current `0.2.1` provides native Darwin interval CPU/footprint and host used/swap metrics, plus
8
+ names-only Linux `/proc` enumeration. Consumers pin exact registry dependencies, never workspace links.
9
+ Avoid `0.2.0` on Linux: its `opendir` listing can fail when a PID exits mid-iteration, losing the
10
+ process list and next-sample CPU baseline. The current names-only enumeration skips that process
11
+ rather than failing the scan.
14
12
 
15
13
  Upgrade from `0.1.0`, which is unsafe: on Darwin it reported `ps -c -o comm`, the basename of argv[0],
16
14
  so a launcher-chosen argv[0] or Node `process.title` (e.g. `npm exec <package> mcp`) leaked into
@@ -57,7 +55,7 @@ Semantics:
57
55
  with identical parent/name and nondecreasing CPU. Each observation has its own monotonic timestamp.
58
56
  Identity/parent/name changes, negative deltas, nonpositive/nonfinite intervals and native intervals
59
57
  over 60s warm instead of fabricating CPU. Native CPU counters are Mach ticks converted using the
60
- kernel timebase (125/3 ns per tick on this Apple Silicon Mac), NOT assumed nanoseconds.
58
+ kernel-reported timebase, NOT assumed nanoseconds.
61
59
  - `processes[].footprint` is an optional Darwin metric from `ri_phys_footprint`, including compressed
62
60
  memory. Native `rssBytes` comes from `ri_resident_size`. Inaccessible/exited/reused PIDs or exhausted
63
61
  native budgets retain the enumerated metadata/RSS row with unavailable CPU/footprint; unsupported
@@ -128,8 +126,7 @@ Bounds:
128
126
  immediate SIGKILL on abort/deadline/cap, and resolve only on close. No persistent children or workers.
129
127
  - Unsupported platforms keep native host metrics but report process coverage unavailable.
130
128
 
131
- macOS measurement/definition comparison, native ABI evidence and future publication checklist:
132
- [here](../../docs/mon-accuracy.md). Process `rssBytes` still excludes compressed pages; it is not
129
+ Process `rssBytes` still excludes compressed pages; it is not
133
130
  Activity Monitor's physical footprint; use the separate `footprint` metric for that comparison.
134
131
  Names remain executable names, so Pi commonly appears as `node`.
135
132
 
@@ -147,7 +144,7 @@ Native failure tests inject fixed bindings through the same lazy loader seam use
147
144
  and `nativeCalls(host)` takes a fake `process` (platform, arch, `versions.bun`, `getBuiltinModule`)
148
145
  with recording `bun:ffi`/`node:ffi` fakes, never a patched global. Both adapters and the per-PID
149
146
  loop therefore run on every OS without the runtime's real FFI; macOS also runs the real libproc path.
150
- `test/runtime.test.ts` runs under both engines: it starts a child whose argv[0], argv, environment, process title and (Linux) comm hold a
147
+ `tests/runtime.test.ts` runs under both engines: it starts a child whose argv[0], argv, environment, process title and (Linux) comm hold a
151
148
  random secret, proves the 0.1.0 source exposes it, then requires the child in the snapshot and no
152
149
  12-character fragment of the secret, plus three real CPU samples. Everything after spawn, readiness
153
150
  included, is followed by SIGTERM, then SIGKILL, with a bounded wait for the runtime's exit status
@@ -168,3 +165,15 @@ tarball, with no Pi or siblings. Both run on existing macOS/Linux CI jobs.
168
165
  `dist` contains compiled ESM and declarations; the exact packed payload is contract-pinned. No install
169
166
  scripts or runtime dependencies. Releases publish through `publish.yml` with npm provenance; see
170
167
  [releases](../../docs/releases.md).
168
+
169
+ ## Changelog fragments
170
+
171
+ Add `changes/<issue>.<category>.md` instead of editing the shared Unreleased block.
172
+ Use the [one-line fragment grammar](https://github.com/nredd/pi-harness/blob/main/packages/subagents/README.md#changelog-fragments), including
173
+ its matching issue link. From the repository root, `make check-changelog-fragments` validates
174
+ all enrolled packages; `make fold-changelog` explicitly folds them without releasing.
175
+ See the [release contract](https://github.com/nredd/pi-harness/blob/main/docs/releases.md#changelog-fragments).
176
+
177
+ The #932 migration preserves 1 historical bullet: 0 exact bullets move to fragments
178
+ and 1 remains in `CHANGELOG.md`. The legacy `#878` attribution is not the required matching Markdown issue link.
179
+ Historical attribution and released sections are unchanged; no issue IDs are invented.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nredd/pi-resource-sampler",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Bounded, privacy-safe host resource interval sampling without Pi dependencies.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,18 +30,15 @@
30
30
  },
31
31
  "scripts": {
32
32
  "build": "tsc -p tsconfig.build.json",
33
- "lint": "biome check src test",
33
+ "prepack": "npm run build",
34
+ "lint": "biome check .",
35
+ "format": "biome check --write .",
34
36
  "typecheck": "tsc --noEmit",
35
- "test": "JITI_FS_CACHE=false vitest run --coverage --maxWorkers=1",
36
- "test:bun": "node ../../scripts/run-vitest.ts bun --maxWorkers=1",
37
+ "test": "node ../../scripts/run-vitest.ts node --coverage",
38
+ "test:bun": "node ../../scripts/run-vitest.ts bun",
37
39
  "check": "npm run lint && npm run typecheck && npm run build && npm test && npm run test:bun"
38
40
  },
39
41
  "devDependencies": {
40
- "@biomejs/biome": "2.5.15",
41
- "@types/node": "26.6.5",
42
- "@vitest/coverage-istanbul": "5.0.3",
43
- "@vitest/coverage-v8": "5.0.3",
44
- "typescript": "7.0.2",
45
- "vitest": "5.0.3"
42
+ "@nredd/pi-test-lib": "0.0.0"
46
43
  }
47
44
  }