instar 1.3.1052 → 1.3.1053
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.
- package/dist/data/standards-registry.meta.json +1 -1
- package/dist/monitoring/hostMemoryPressure.d.ts.map +1 -1
- package/dist/monitoring/hostMemoryPressure.js +4 -1
- package/dist/monitoring/hostMemoryPressure.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/src/data/standards-registry.meta.json +1 -1
- package/upgrades/1.3.1053.md +28 -0
- package/upgrades/eli16/host-memory-unparseable-fallback.md +27 -0
- package/upgrades/side-effects/host-memory-unparseable-fallback.md +115 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hostMemoryPressure.d.ts","sourceRoot":"","sources":["../../src/monitoring/hostMemoryPressure.ts"],"names":[],"mappings":"AAsBA,MAAM,WAAW,mBAAmB;IAClC,qEAAqE;IACrE,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,yEAAyE;AACzE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,MAAM,CAAC;CACzB;AAED,8FAA8F;AAC9F,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB,
|
|
1
|
+
{"version":3,"file":"hostMemoryPressure.d.ts","sourceRoot":"","sources":["../../src/monitoring/hostMemoryPressure.ts"],"names":[],"mappings":"AAsBA,MAAM,WAAW,mBAAmB;IAClC,qEAAqE;IACrE,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,yEAAyE;AACzE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,MAAM,CAAC;CACzB;AAED,8FAA8F;AAC9F,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,mBAAmB,CAwB/D;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAWrE;AAED,iGAAiG;AACjG,wBAAgB,wBAAwB,CAAC,IAAI,GAAE,WAAgB,GAAG,mBAAmB,CA2BpF;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,GAAE,WAAgB,GAAG,MAAM,CAG7D"}
|
|
@@ -33,11 +33,14 @@ export function parseVmStat(output) {
|
|
|
33
33
|
const compressorPages = parsePages('Pages occupied by compressor');
|
|
34
34
|
const purgeablePages = parsePages('Pages purgeable');
|
|
35
35
|
const totalPages = freePages + activePages + inactivePages + wiredPages + compressorPages;
|
|
36
|
+
if (totalPages === 0) {
|
|
37
|
+
throw new Error('vm_stat output contained no total memory pages');
|
|
38
|
+
}
|
|
36
39
|
const totalGB = (totalPages * pageSize) / (1024 ** 3);
|
|
37
40
|
const availablePages = freePages + inactivePages + purgeablePages;
|
|
38
41
|
const freeGB = (availablePages * pageSize) / (1024 ** 3);
|
|
39
42
|
const usedPages = totalPages - availablePages;
|
|
40
|
-
const pressurePercent =
|
|
43
|
+
const pressurePercent = (usedPages / totalPages) * 100;
|
|
41
44
|
return { pressurePercent, freeGB, totalGB };
|
|
42
45
|
}
|
|
43
46
|
/** Pure: parse `/proc/meminfo` content → memory reading (Linux MemAvail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OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,OAAO,EAAE,CAAC;AAC5G,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,OAAoB,EAAE;IACnD,MAAM,GAAG,GAAG,GAAG,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC;IACjE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AACzC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./builtin-manifest.schema.json",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"generatedAt": "2026-07-29T11:
|
|
5
|
-
"instarVersion": "1.3.
|
|
4
|
+
"generatedAt": "2026-07-29T11:32:42.452Z",
|
|
5
|
+
"instarVersion": "1.3.1053",
|
|
6
6
|
"entryCount": 202,
|
|
7
7
|
"entries": {
|
|
8
8
|
"hook:session-start": {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
The macOS memory reader now treats a successful `vm_stat` command with no
|
|
9
|
+
parseable total-page counters as a read failure. It uses the existing logged RSS
|
|
10
|
+
fallback instead of publishing zero-percent pressure from an empty denominator.
|
|
11
|
+
|
|
12
|
+
## What to Tell Your User
|
|
13
|
+
|
|
14
|
+
Malformed macOS memory output can no longer make a machine look perfectly
|
|
15
|
+
healthy; Instar now says the native reading failed and uses its conservative
|
|
16
|
+
fallback.
|
|
17
|
+
|
|
18
|
+
## Summary of New Capabilities
|
|
19
|
+
|
|
20
|
+
- Parse-validity detection for successful macOS memory-stat reads.
|
|
21
|
+
|
|
22
|
+
## Evidence
|
|
23
|
+
|
|
24
|
+
- The focused test feeds non-empty but unparseable output and proves the RSS
|
|
25
|
+
fallback reports 93.75% pressure rather than zero.
|
|
26
|
+
- The existing thrown-reader fallback test remains unchanged and green.
|
|
27
|
+
- Removing the parse-validity check makes both new assertions fail.
|
|
28
|
+
- Fourteen focused tests and the full repository lint pass.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Malformed memory output no longer looks like a healthy machine
|
|
2
|
+
|
|
3
|
+
Instar measures memory pressure differently on macOS because the ordinary
|
|
4
|
+
free-memory number does not include memory the operating system can reclaim.
|
|
5
|
+
It runs the native `vm_stat` command, reads several page counters, and combines
|
|
6
|
+
them into total and available memory.
|
|
7
|
+
|
|
8
|
+
The reader already handled a command that throws or cannot run: it logs the
|
|
9
|
+
failure and falls back to a rough estimate based on the Instar process memory
|
|
10
|
+
and the machine total. But there was a second failure shape. The command could
|
|
11
|
+
succeed and return non-empty text that contained none of the expected page
|
|
12
|
+
counters. Every missing counter became zero, the total denominator became zero,
|
|
13
|
+
and the code returned zero-percent pressure. The machine then looked perfectly
|
|
14
|
+
healthy even though nothing had been measured.
|
|
15
|
+
|
|
16
|
+
The parser now rejects output whose total page count is zero. That rejection is
|
|
17
|
+
caught by the existing read-failure handler, so it uses the same logged RSS
|
|
18
|
+
fallback the original author already built. The throw path, fallback formula,
|
|
19
|
+
logging, thresholds, and real valid parser behavior are unchanged.
|
|
20
|
+
|
|
21
|
+
The regression deliberately supplies a non-empty string so it cannot pass
|
|
22
|
+
through the existing empty-output branch. With a simulated machine using
|
|
23
|
+
fifteen of sixteen gigabytes, malformed native output must produce the fallback
|
|
24
|
+
reading of 93.75-percent pressure, one gigabyte free, and sixteen gigabytes
|
|
25
|
+
total. Restoring the old parser makes that test report zero and fail. This keeps
|
|
26
|
+
unknown input from becoming a flattering health measurement without inventing
|
|
27
|
+
a new pressure policy.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Side-Effects Review — Host-memory unparseable fallback
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `host-memory-unparseable-fallback`
|
|
4
|
+
**Date:** `2026-07-29`
|
|
5
|
+
**Author:** `instar-codey`
|
|
6
|
+
**Second-pass reviewer:** `not required`
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
`parseVmStat()` now rejects a zero total-page count as unparseable.
|
|
11
|
+
`readSystemMemoryPressure()` already catches parser errors, logs the failed
|
|
12
|
+
native read, and returns its existing RSS-based fallback. The new test enters
|
|
13
|
+
the previously uncovered successful-but-unparseable path; the existing
|
|
14
|
+
thrown-reader test and fallback implementation are unchanged.
|
|
15
|
+
|
|
16
|
+
## Decision-point inventory
|
|
17
|
+
|
|
18
|
+
- `parseVmStat` parse-validity invariant — modified — a non-empty native command
|
|
19
|
+
result must contain at least one total-memory page counter before it can
|
|
20
|
+
become a pressure measurement.
|
|
21
|
+
- Memory-pressure policy — passed through — the existing fallback and all
|
|
22
|
+
downstream pressure thresholds remain unchanged.
|
|
23
|
+
|
|
24
|
+
## 1. Over-block
|
|
25
|
+
|
|
26
|
+
No user or agent action is blocked. A syntactically unusual `vm_stat` output
|
|
27
|
+
that contains none of the five total-memory counters is rejected rather than
|
|
28
|
+
graded; that is appropriate because no total-memory denominator can be derived.
|
|
29
|
+
|
|
30
|
+
## 2. Under-block
|
|
31
|
+
|
|
32
|
+
The parser can still accept partially populated output when at least one
|
|
33
|
+
total-memory counter is present. That preserves its existing tolerant parsing
|
|
34
|
+
contract. This change does not claim to validate the semantic relationship
|
|
35
|
+
between every page category; it closes the specific state where no measurement
|
|
36
|
+
exists at all.
|
|
37
|
+
|
|
38
|
+
## 3. Level-of-abstraction fit
|
|
39
|
+
|
|
40
|
+
The validity check belongs in the pure parser, immediately after the denominator
|
|
41
|
+
is assembled. The reader already owns fallback selection, logging, and
|
|
42
|
+
never-throw behavior. Reusing that path avoids a second fallback policy and
|
|
43
|
+
keeps consumers unaware of parser details.
|
|
44
|
+
|
|
45
|
+
## 4. Signal vs authority compliance
|
|
46
|
+
|
|
47
|
+
**Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
|
|
48
|
+
|
|
49
|
+
- [x] No — this change has no block/allow surface.
|
|
50
|
+
|
|
51
|
+
The zero-page check is a hard structural invariant: pressure cannot be computed
|
|
52
|
+
without total pages. It does not decide whether an operation may proceed.
|
|
53
|
+
Downstream pressure policy continues to consume the resulting measurement.
|
|
54
|
+
|
|
55
|
+
## 4b. Judgment-point check
|
|
56
|
+
|
|
57
|
+
No competing-signals judgment point or new policy heuristic is added. A
|
|
58
|
+
zero-denominator parse cannot yield a measurement.
|
|
59
|
+
|
|
60
|
+
## 5. Interactions
|
|
61
|
+
|
|
62
|
+
- **Shadowing:** the new parser rejection feeds the existing catch-and-fallback
|
|
63
|
+
path; it does not bypass or duplicate it.
|
|
64
|
+
- **Double-fire:** only one reading is returned. The rejected native parse does
|
|
65
|
+
not also publish a zero reading.
|
|
66
|
+
- **Races:** all reads remain synchronous and local; shared state is unchanged.
|
|
67
|
+
- **Feedback loops:** downstream reaping and revival continue to see the same
|
|
68
|
+
fallback shape already used when the native command throws.
|
|
69
|
+
|
|
70
|
+
## 6. External surfaces
|
|
71
|
+
|
|
72
|
+
On malformed non-empty macOS output, logs now name the parse failure and the
|
|
73
|
+
returned reading comes from the RSS fallback. Valid macOS output, Linux input,
|
|
74
|
+
other platforms, external services, persistent state, and message formats are
|
|
75
|
+
unchanged. No operator-facing action is added.
|
|
76
|
+
|
|
77
|
+
## 6b. Operator-surface quality
|
|
78
|
+
|
|
79
|
+
No operator surface — not applicable.
|
|
80
|
+
|
|
81
|
+
## 7. Multi-machine posture
|
|
82
|
+
|
|
83
|
+
**Machine-local by design.** Memory pressure is a physical property of each
|
|
84
|
+
host and must differ across machines. The correction emits no user notice,
|
|
85
|
+
stores no durable or topic-bound state, and generates no URL.
|
|
86
|
+
|
|
87
|
+
## 8. Rollback cost
|
|
88
|
+
|
|
89
|
+
Pure code rollback: remove the zero-page rejection and restore the guarded
|
|
90
|
+
division. No data migration or agent repair is required. Rollback would
|
|
91
|
+
reintroduce the false-healthy reading for malformed native output.
|
|
92
|
+
|
|
93
|
+
## Conclusion
|
|
94
|
+
|
|
95
|
+
Clear to ship as a small corrective PR. The change reuses the existing visible,
|
|
96
|
+
never-throw fallback and leaves its already-correct thrown-reader path intact.
|
|
97
|
+
|
|
98
|
+
## Second-pass review
|
|
99
|
+
|
|
100
|
+
**Reviewer:** not required
|
|
101
|
+
**Independent read of the artifact:** Not required; the implementation changes
|
|
102
|
+
only parser validity and routes through an existing tested fallback. It does not
|
|
103
|
+
modify a lifecycle controller, authority, threshold, or action.
|
|
104
|
+
|
|
105
|
+
## Evidence pointers
|
|
106
|
+
|
|
107
|
+
- `tests/unit/host-memory-pressure.test.ts`
|
|
108
|
+
- Fourteen focused tests pass.
|
|
109
|
+
- Mutation proof: removing the validity check makes the parser fail to throw and
|
|
110
|
+
makes the reader return zero instead of the asserted 93.75-percent fallback.
|
|
111
|
+
- Full repository lint, including TypeScript, passes.
|
|
112
|
+
|
|
113
|
+
## Class-Closure Declaration
|
|
114
|
+
|
|
115
|
+
No agent-authored-artifact defect — not applicable.
|