@ultimat3/core 31.28.0 → 31.29.0
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/CLAUDE.md +1 -0
- package/README.md +1 -0
- package/package.json +2 -2
- package/src/framework-env.ts +1 -0
- package/src/index.ts +2 -0
- package/src/schema-metrics.ts +41 -0
package/CLAUDE.md
CHANGED
|
@@ -147,6 +147,7 @@ server-only, never on `page.ts`. One call site per recorder; a second is the bug
|
|
|
147
147
|
| `recordJob` | `@ultimat3/jobs` `worker.ts`, the outcome branch inside `tick()` (`JOB_OUTCOME_LABELS` drops `suspended`) |
|
|
148
148
|
| `recordLeaseLost` | `@ultimat3/jobs` `heartbeat.ts`, once per lapsed lease |
|
|
149
149
|
| `recordBreakerTransition` | `breaker.ts`, on every state change |
|
|
150
|
+
| `recordFrameworkSchema` | `@ultimat3/cli`'s framework-schema verdict (`schema-metrics.ts`) |
|
|
150
151
|
|
|
151
152
|
- **One bus, `instrument.ts`**: every observer is a `subscribe()` — OTLP spans (`span.end`, sampled
|
|
152
153
|
only), logs (`log.record`), metrics. No `set*Observer`/`set*Sink`/`recent*()` slot
|
package/README.md
CHANGED
|
@@ -102,6 +102,7 @@ JSON.stringify({ dsn }); // the value never prints: a Secret redacts by value, a
|
|
|
102
102
|
| the `/metrics` scrape body | `metrics-text.ts` |
|
|
103
103
|
| the series every process emits, incl. what the chart scales on | `runtime-metrics.ts` |
|
|
104
104
|
| what the process itself costs: `process_resident_memory_bytes`, `process_heap_used_bytes`, `process_heap_total_bytes`, `process_external_memory_bytes`, `process_cpu_seconds_total`, `process_event_loop_lag_seconds`, `process_start_time_seconds`, `process_info{role}`, `process_memory_limit_bytes` (cgroup `memory.max`; absent when unbounded) — **server-only**, never on `@ultimat3/core/page` | `process-metrics.ts` (`startProcessMetrics`) |
|
|
105
|
+
| whether this build's framework schema is applied and the newest applied build's major skew: `framework_schema_applied`, `framework_schema_major_skew` — `recordFrameworkSchema({ applied, majorSkew })`, one call per stamp verdict; the chart's `UltimateSchemaUnapplied` and `UltimateVersionSkew` read them | `schema-metrics.ts` |
|
|
105
106
|
| graceful drain, `/healthz`, `/readyz` | `lifecycle.ts` |
|
|
106
107
|
| what a health endpoint tells whom — `healthBody(report, role, detailed)`, `healthPeerListed(peers, address)`, `DEFAULT_HEALTH_DETAIL_PEERS`; the one rule `@ultimat3/http` and the sync node's own listener both call | `health-disclosure.ts` |
|
|
107
108
|
| the readiness grace between `/readyz` → 503 and the listener closing (`drain.readinessGraceMs`) | `lifecycle-grace.ts` |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ultimat3/core",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.29.0",
|
|
4
4
|
"description": "Ultimate's foundation: errors, context, env, config, clock, ids, logging, telemetry, lifecycle",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ultimate",
|
|
@@ -54,6 +54,6 @@
|
|
|
54
54
|
"test": "bun test"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@ultimat3/schema": "31.
|
|
57
|
+
"@ultimat3/schema": "31.29.0"
|
|
58
58
|
}
|
|
59
59
|
}
|
package/src/framework-env.ts
CHANGED
|
@@ -54,6 +54,7 @@ export const FRAMEWORK_ENV: readonly FrameworkEnvName[] = [
|
|
|
54
54
|
...contract('cli', 'NODE_ENV', 'TRUSTED_PROXY_HOPS', 'WORKER_QUEUES', 'SENTRY_DSN'),
|
|
55
55
|
...contract('cli', 'S3_ENDPOINT', 'S3_BUCKET', 'S3_REGION', 'S3_FORCE_PATH_STYLE'),
|
|
56
56
|
...contract('cli', 'SCRAPE_CDP_URL', 'TLS_CERT', 'TLS_KEY'),
|
|
57
|
+
...contract('cli', 'ULTIMATE_SCHEMA_WAIT_MS'),
|
|
57
58
|
...toggles('cli', 'OTEL_SDK_DISABLED'),
|
|
58
59
|
...internal('cli', 'ULTIMATE_SEED_TIER', 'ULTIMATE_STATE_DIR', 'ULTIMATE_BUILD_CAPTURE'),
|
|
59
60
|
...internal('cli', 'ULTIMATE_DEV_CHILD', 'ULTIMATE_DEV_SUPERVISOR_PID', 'X_ENV'),
|
package/src/index.ts
CHANGED
|
@@ -961,6 +961,8 @@ export { HYDRATE_STRATEGIES, OFFLINE_STRATEGIES, RENDER_MODES, SURFACES } from '
|
|
|
961
961
|
export { safeUrl, URL_ATTRIBUTES } from './safe-url';
|
|
962
962
|
export type { OriginEvidence } from './same-origin';
|
|
963
963
|
export { type OriginVerdict, proveSameOrigin } from './same-origin';
|
|
964
|
+
export type { FrameworkSchemaSample } from './schema-metrics';
|
|
965
|
+
export { recordFrameworkSchema } from './schema-metrics';
|
|
964
966
|
export type { SealOptions, SealPurposeOptions } from './seal';
|
|
965
967
|
export { isSealed, open, openText, seal, sealAll, sealedKeyId } from './seal';
|
|
966
968
|
export { SealInvalidError, SealKeyMissingError, SealKeyUnknownError } from './seal-errors';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Single responsibility: whether this process's build has its framework schema applied, and whether
|
|
2
|
+
// the newest applied build is another major — as two gauges, so a rollout that ran its roles before
|
|
3
|
+
// migrate, or a fleet left straddling a breaking release, raises an alert instead of a log line.
|
|
4
|
+
|
|
5
|
+
import type { Gauge } from './metrics';
|
|
6
|
+
import { gauge } from './metrics';
|
|
7
|
+
|
|
8
|
+
interface SchemaGauges {
|
|
9
|
+
readonly applied: Gauge;
|
|
10
|
+
readonly majorSkew: Gauge;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let declared: SchemaGauges | undefined;
|
|
14
|
+
|
|
15
|
+
/** On the first verdict, never at import: a process that verifies nothing declares no series. */
|
|
16
|
+
function gauges(): SchemaGauges {
|
|
17
|
+
declared ??= {
|
|
18
|
+
applied: gauge('framework_schema_applied', {
|
|
19
|
+
unit: '1',
|
|
20
|
+
description:
|
|
21
|
+
"1 when this build's schema is applied: the framework stamp and every app migration it ships. 0 while a role waits for the migrate step",
|
|
22
|
+
}),
|
|
23
|
+
majorSkew: gauge('framework_schema_major_skew', {
|
|
24
|
+
unit: '1',
|
|
25
|
+
description: '1 when the newest applied framework schema is another major than this build',
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
28
|
+
return declared;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface FrameworkSchemaSample {
|
|
32
|
+
readonly applied: boolean;
|
|
33
|
+
readonly majorSkew: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** One call per stamp verdict, from the serving role's framework-schema check. */
|
|
37
|
+
export function recordFrameworkSchema(sample: FrameworkSchemaSample): void {
|
|
38
|
+
const g = gauges();
|
|
39
|
+
g.applied.record(sample.applied ? 1 : 0);
|
|
40
|
+
g.majorSkew.record(sample.majorSkew ? 1 : 0);
|
|
41
|
+
}
|