pi-mega-compact 0.20.5 → 0.20.6
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/config/vector-cortex.js +12 -0
- package/dist/config.js +1 -1
- package/dist/extensions/dashboard-server/routes-rag-settings-helpers.js +1 -0
- package/dist/extensions/dashboard-server/routes-vector-cortex-rollout.js +43 -0
- package/dist/extensions/dashboard-server/routes-vector-cortex.js +1 -0
- package/dist/extensions/dashboard-server/routes.js +1 -1
- package/dist/extensions/dashboard-server/server.js +3 -1
- package/dist/extensions/mega-runtime/vector-cortex-live.js +105 -0
- package/dist/src/config/vector-cortex.js +12 -0
- package/dist/src/config.js +1 -1
- package/dist/src/vector-cortex/rollout/_acceptance-fixture.js +55 -0
- package/dist/src/vector-cortex/rollout/_acceptance-helpers.js +8 -0
- package/dist/src/vector-cortex/rollout/_acceptance-scenario.js +70 -0
- package/dist/src/vector-cortex/rollout/assign.js +56 -0
- package/dist/src/vector-cortex/rollout/emit.js +50 -0
- package/dist/src/vector-cortex/rollout/gate.js +75 -0
- package/dist/src/vector-cortex/rollout/types.js +39 -0
- package/dist/vector-cortex/rollout/_acceptance-fixture.js +55 -0
- package/dist/vector-cortex/rollout/_acceptance-helpers.js +8 -0
- package/dist/vector-cortex/rollout/_acceptance-scenario.js +70 -0
- package/dist/vector-cortex/rollout/assign.js +56 -0
- package/dist/vector-cortex/rollout/emit.js +50 -0
- package/dist/vector-cortex/rollout/gate.js +75 -0
- package/dist/vector-cortex/rollout/types.js +39 -0
- package/extensions/dashboard-client/dist/assets/{AreaChart-CGL29Tcl.js → AreaChart-DqTbaSRA.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{AreaChart-CGL29Tcl.js.map → AreaChart-DqTbaSRA.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{BarChart-OxhalIZa.js → BarChart-BfNBeOvF.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{BarChart-OxhalIZa.js.map → BarChart-BfNBeOvF.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{CacheTab-VcMFwL-6.js → CacheTab-C9SOMYB5.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{CacheTab-VcMFwL-6.js.map → CacheTab-C9SOMYB5.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{EventsTab-DePofXDM.js → EventsTab-GsMKP10_.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{EventsTab-DePofXDM.js.map → EventsTab-GsMKP10_.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{HealthTab-nQd1tjSF.js → HealthTab-DAOCXwRP.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{HealthTab-nQd1tjSF.js.map → HealthTab-DAOCXwRP.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MaintenanceTab-CzvA8-F6.js → MaintenanceTab-BtBeMkB5.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MaintenanceTab-CzvA8-F6.js.map → MaintenanceTab-BtBeMkB5.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MemoryMapTab-3lxgWBvU.js → MemoryMapTab-DzndtgkZ.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MemoryMapTab-3lxgWBvU.js.map → MemoryMapTab-DzndtgkZ.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MetricsTab-D_FcA6kN.js → MetricsTab-DyxJ4eb8.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MetricsTab-D_FcA6kN.js.map → MetricsTab-DyxJ4eb8.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{OverviewTab-BU6R4aEs.js → OverviewTab-DCiEdVWR.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{OverviewTab-BU6R4aEs.js.map → OverviewTab-DCiEdVWR.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{ReposTab-DFjy1isz.js → ReposTab-B5SIqVHA.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{ReposTab-DFjy1isz.js.map → ReposTab-B5SIqVHA.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{SessionsTab-UGIzIH25.js → SessionsTab-DLWFJ9xI.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{SessionsTab-UGIzIH25.js.map → SessionsTab-DLWFJ9xI.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{SetupTab-CECrgMKI.js → SetupTab-CvGXZyej.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{SetupTab-CECrgMKI.js.map → SetupTab-CvGXZyej.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-Dyy4SCDk.js → TimeSavedCard-wZuQGxLS.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-Dyy4SCDk.js.map → TimeSavedCard-wZuQGxLS.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{TurnsTab-B0LPcVs1.js → TurnsTab-B7aOejch.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{TurnsTab-B0LPcVs1.js.map → TurnsTab-B7aOejch.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/VectorCortexTab-eHVt9yDx.js +2 -0
- package/extensions/dashboard-client/dist/assets/VectorCortexTab-eHVt9yDx.js.map +1 -0
- package/extensions/dashboard-client/dist/assets/{WikiTab-DWk9Qvut.js → WikiTab-DhWHjAtt.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{WikiTab-DWk9Qvut.js.map → WikiTab-DhWHjAtt.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{button-O59wPr5H.js → button-BrC-W87h.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{button-O59wPr5H.js.map → button-BrC-W87h.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{card-C-DxXv1-.js → card-0rgfRgr3.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{card-C-DxXv1-.js.map → card-0rgfRgr3.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-Dw5YnE5s.js → generateCategoricalChart-DRresOQF.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-Dw5YnE5s.js.map → generateCategoricalChart-DRresOQF.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{index-i9oaPE0a.js → index-DohmtZWL.js} +3 -3
- package/extensions/dashboard-client/dist/assets/{index-i9oaPE0a.js.map → index-DohmtZWL.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{switch-B69QY3IM.js → switch-Bs8g_zB5.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{switch-B69QY3IM.js.map → switch-Bs8g_zB5.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{toggle-BJ4Kwggu.js → toggle-DVVauIo8.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{toggle-BJ4Kwggu.js.map → toggle-DVVauIo8.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{useSSE-BpuA8sPd.js → useSSE-DxH1PTAR.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{useSSE-BpuA8sPd.js.map → useSSE-DxH1PTAR.js.map} +1 -1
- package/extensions/dashboard-client/dist/index.html +1 -1
- package/extensions/dashboard-client/src/api/vector-cortex.ts +9 -0
- package/extensions/dashboard-client/src/tabs/VectorCortexRolloutCard.tsx +44 -0
- package/extensions/dashboard-client/src/tabs/VectorCortexTab.tsx +8 -0
- package/extensions/dashboard-client/src/types/vector-cortex.ts +17 -0
- package/extensions/dashboard-server/api-contracts/vector-cortex.ts +32 -1
- package/extensions/dashboard-server/routes-rag-settings-helpers.ts +6 -0
- package/extensions/dashboard-server/routes-vector-cortex-rollout.ts +52 -0
- package/extensions/dashboard-server/routes-vector-cortex.ts +1 -0
- package/extensions/dashboard-server/routes.ts +1 -0
- package/extensions/dashboard-server/server.ts +2 -0
- package/extensions/mega-runtime/vector-cortex-live.ts +165 -0
- package/package.json +1 -1
- package/src/config/vector-cortex.ts +13 -0
- package/src/config.ts +1 -0
- package/src/vector-cortex/rollout/_acceptance-fixture.ts +94 -0
- package/src/vector-cortex/rollout/_acceptance-helpers.ts +24 -0
- package/src/vector-cortex/rollout/_acceptance-scenario.ts +96 -0
- package/src/vector-cortex/rollout/assign.ts +67 -0
- package/src/vector-cortex/rollout/emit.ts +81 -0
- package/src/vector-cortex/rollout/gate.ts +119 -0
- package/src/vector-cortex/rollout/types.ts +111 -0
- package/extensions/dashboard-client/dist/assets/VectorCortexTab-BWi3u_gp.js +0 -2
- package/extensions/dashboard-client/dist/assets/VectorCortexTab-BWi3u_gp.js.map +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* rollout/_acceptance-fixture.ts — conformance fixture I/O for VC5C rollout
|
|
3
|
+
* acceptance rows.
|
|
4
|
+
*
|
|
5
|
+
* Reads the v2 conformance manifest + the per-sprint rollout fixture files, and
|
|
6
|
+
* exposes the `RolloutFx` shape the acceptance aggregator drives. No
|
|
7
|
+
* mocks/stubs: the fixtures are the committed canonical corpus.
|
|
8
|
+
*/
|
|
9
|
+
import { readFileSync, existsSync } from "node:fs";
|
|
10
|
+
import { join, dirname } from "node:path";
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
12
|
+
import assert from "node:assert/strict";
|
|
13
|
+
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
14
|
+
function repoRoot(from) {
|
|
15
|
+
let dir = from;
|
|
16
|
+
for (let i = 0; i < 8; i++) {
|
|
17
|
+
if (existsSync(join(dir, "conformance", "vector-cortex")))
|
|
18
|
+
return dir;
|
|
19
|
+
const next = dirname(dir);
|
|
20
|
+
if (next === dir)
|
|
21
|
+
break;
|
|
22
|
+
dir = next;
|
|
23
|
+
}
|
|
24
|
+
throw new Error("conformance corpus not found above " + from);
|
|
25
|
+
}
|
|
26
|
+
export const REPO_ROOT = repoRoot(HERE);
|
|
27
|
+
export const V2 = join(REPO_ROOT, "conformance", "vector-cortex", "v2");
|
|
28
|
+
export function readManifest() {
|
|
29
|
+
return JSON.parse(readFileSync(join(V2, "manifest.json"), "utf8"));
|
|
30
|
+
}
|
|
31
|
+
function readFixture(id, prefix) {
|
|
32
|
+
const m = readManifest();
|
|
33
|
+
const row = m.fixtures.find((f) => f.id === id && f.path.startsWith(`${prefix}/`));
|
|
34
|
+
assert.ok(row, `fixture ${id} registered under ${prefix}/ in manifest`);
|
|
35
|
+
return JSON.parse(readFileSync(join(V2, row.path), "utf8"));
|
|
36
|
+
}
|
|
37
|
+
export function rolloutFixture(id) {
|
|
38
|
+
return readFixture(id, "rollout");
|
|
39
|
+
}
|
|
40
|
+
/** Flag-pinned wrapper: VC5C gated by MEGACOMPACT_VC5C (defaults ON). */
|
|
41
|
+
export function withFlagsOn(fn) {
|
|
42
|
+
return () => {
|
|
43
|
+
const saved = process.env.MEGACOMPACT_VC5C;
|
|
44
|
+
process.env.MEGACOMPACT_VC5C = "1";
|
|
45
|
+
try {
|
|
46
|
+
fn();
|
|
47
|
+
}
|
|
48
|
+
finally {
|
|
49
|
+
if (saved === undefined)
|
|
50
|
+
delete process.env.MEGACOMPACT_VC5C;
|
|
51
|
+
else
|
|
52
|
+
process.env.MEGACOMPACT_VC5C = saved;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* rollout/_acceptance-helpers.ts — pure barrel re-export of the VC5C rollout
|
|
3
|
+
* acceptance helpers (fixture I/O + REAL runner). Mirrors the render family's
|
|
4
|
+
* delegate-shell split so the aggregator stays under the 600-line test hard
|
|
5
|
+
* limit.
|
|
6
|
+
*/
|
|
7
|
+
export { REPO_ROOT, V2, readManifest, rolloutFixture, withFlagsOn, } from "./_acceptance-fixture.js";
|
|
8
|
+
export { runRolloutScenario } from "./_acceptance-scenario.js";
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* rollout/_acceptance-scenario.ts — the REAL rollout runner for VC5C acceptance
|
|
3
|
+
* rows. Drives `assignSession` + `decideGate` (no mocks) against the fixture
|
|
4
|
+
* `input` and returns the result fields the fixture's `expected` block pins.
|
|
5
|
+
*
|
|
6
|
+
* Fake clocks: the gate scenario accepts an injected monotonic clock so the
|
|
7
|
+
* spec's unique failure injection (restart at 71h59m with a wall-clock jump +1d
|
|
8
|
+
* but monotonic unchanged) is reproducible. The wall-clock jump is irrelevant to
|
|
9
|
+
* the safety decision because eligibility uses the MONOTONIC delta only.
|
|
10
|
+
*/
|
|
11
|
+
import { assignSession } from "./assign.js";
|
|
12
|
+
import { decideGate, } from "./gate.js";
|
|
13
|
+
const GATE_MIN_ELAPSED_MS = 72 * 60 * 60 * 1000;
|
|
14
|
+
/** Fixed monotonic clock: elapsed = now - windowStart (the only driver). */
|
|
15
|
+
function clockAt(elapsedMs, windowStartMs) {
|
|
16
|
+
return {
|
|
17
|
+
now: () => windowStartMs + elapsedMs, // monotonic delta is the truth
|
|
18
|
+
wallNow: () => new Date(1_700_000_000_000 + elapsedMs).toISOString(),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
/** Run a rollout fixture through the REAL assign + gate pipeline. */
|
|
22
|
+
export function runRolloutScenario(fx) {
|
|
23
|
+
const scenario = fx.input.scenario;
|
|
24
|
+
if (scenario === "assign-stable") {
|
|
25
|
+
const a = assignSession(fx.input.sessionId ?? "");
|
|
26
|
+
const b = assignSession(fx.input.sessionId ?? "");
|
|
27
|
+
// Determinism: recomputing yields the identical bucket.
|
|
28
|
+
if (a.bucket !== b.bucket) {
|
|
29
|
+
return { ok: false };
|
|
30
|
+
}
|
|
31
|
+
return { ok: true, bucket: a.bucket };
|
|
32
|
+
}
|
|
33
|
+
if (scenario === "gate-power" || scenario === "gate-safety") {
|
|
34
|
+
const ev = fx.input.evidence ?? {};
|
|
35
|
+
const windowStartMs = ev.windowStartMs ?? 0;
|
|
36
|
+
const hardFaults = (ev.hardFaults ?? []).map((f) => ({ kind: f.kind, detail: f.detail }));
|
|
37
|
+
const evidence = {
|
|
38
|
+
windowStartMs,
|
|
39
|
+
powered: ev.powered ?? false,
|
|
40
|
+
events: ev.events ?? 0,
|
|
41
|
+
sessions: ev.sessions ?? 0,
|
|
42
|
+
hardFaults,
|
|
43
|
+
};
|
|
44
|
+
// The spec's unique failure injection: wall-clock jump is irrelevant; only the
|
|
45
|
+
// monotonic elapsed drives eligibility. For the 71h59m row we pass 71h59m; for
|
|
46
|
+
// the wall-jump row we pass the SAME monotonic elapsed (so it must stay blocked);
|
|
47
|
+
// for the >=72h row we pass a full 72h+ monotonic delta (so it advances).
|
|
48
|
+
const start = fx._monotonicElapsedMs;
|
|
49
|
+
const elapsedMs = start ?? GATE_MIN_ELAPSED_MS; // default: a full 72h window
|
|
50
|
+
const clock = clockAt(elapsedMs, windowStartMs);
|
|
51
|
+
// gate-safety with a hard fault forces pre-VC + freezes promotion regardless of
|
|
52
|
+
// the monotonic window; the gate index stays at the input's prior gate (0 here).
|
|
53
|
+
if (scenario === "gate-safety") {
|
|
54
|
+
const outcome = decideGate(0, evidence, clock);
|
|
55
|
+
return {
|
|
56
|
+
ok: true,
|
|
57
|
+
gateIndex: outcome.gateIndex,
|
|
58
|
+
promotionBlocked: outcome.promotionBlocked,
|
|
59
|
+
selectsPreVc: outcome.promotionBlocked,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const outcome = decideGate(0, evidence, clock);
|
|
63
|
+
return {
|
|
64
|
+
ok: true,
|
|
65
|
+
gateIndex: outcome.gateIndex,
|
|
66
|
+
promotionBlocked: outcome.promotionBlocked,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
throw new Error(`unknown rollout scenario: ${scenario}`);
|
|
70
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vector-cortex/rollout/assign.ts — deterministic stable-bucket assignment.
|
|
3
|
+
*
|
|
4
|
+
* `assignSession(sessionId)` hashes a session id into one of 10,000 stable
|
|
5
|
+
* buckets (0..9999). The assignment is a PURE function of the session id and
|
|
6
|
+
* NEVER changes across process restart: it uses a fixed-seed FNV-1a over the
|
|
7
|
+
* session id bytes, never Date.now / Math.random (PREVENT-PI-004-adjacent
|
|
8
|
+
* determinism contract; the spec's restart-invariance requirement).
|
|
9
|
+
*
|
|
10
|
+
* A bucket `b` is "in" gate `g` (one of [1,5,25,50,100]) iff
|
|
11
|
+
* `b < g * 100`. So gate 1% covers buckets 0..99, gate 100% covers 0..9999.
|
|
12
|
+
*
|
|
13
|
+
* Pure: no I/O, no clock, no network. PREVENT-011: no `any`.
|
|
14
|
+
*/
|
|
15
|
+
import { ROLLOUT_BUCKETS, ROLLOUT_GATES, } from "./types.js";
|
|
16
|
+
/**
|
|
17
|
+
* Deterministic 32-bit FNV-1a over the session id (UTF-8 bytes). Fixed seed
|
|
18
|
+
* (2166136261) — restart-invariant by construction. Returns a bucket in
|
|
19
|
+
* 0..(ROLLOUT_BUCKETS-1).
|
|
20
|
+
*/
|
|
21
|
+
export function assignSession(sessionId) {
|
|
22
|
+
const enc = new TextEncoder();
|
|
23
|
+
const bytes = enc.encode(sessionId);
|
|
24
|
+
let hash = 0x811c9dc5; // FNV offset basis (32-bit)
|
|
25
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
26
|
+
hash ^= bytes[i];
|
|
27
|
+
// hash *= 16777619 (FNV prime) with 32-bit overflow wrap.
|
|
28
|
+
hash = Math.imul(hash, 0x01000193);
|
|
29
|
+
}
|
|
30
|
+
const bucket = (hash >>> 0) % ROLLOUT_BUCKETS;
|
|
31
|
+
// The bucket's qualifying gate is the HIGHEST gate whose bound it falls under.
|
|
32
|
+
let gateIndex = 0;
|
|
33
|
+
for (let i = 0; i < ROLLOUT_GATES.length; i++) {
|
|
34
|
+
if (bucket < ROLLOUT_GATES[i] * 100) {
|
|
35
|
+
gateIndex = i;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
schema: "rollout-assignment-v1",
|
|
41
|
+
sessionId,
|
|
42
|
+
bucket,
|
|
43
|
+
gateIndex,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Whether a bucket qualifies for a given gate percentage. Used by the live seam
|
|
48
|
+
* to decide whether a session's bucket is currently exposed to the VC path.
|
|
49
|
+
*/
|
|
50
|
+
export function bucketInGate(bucket, gatePct) {
|
|
51
|
+
return bucket < gatePct * 100;
|
|
52
|
+
}
|
|
53
|
+
/** Current gate percentage for a gate index. */
|
|
54
|
+
export function gatePctForIndex(gateIndex) {
|
|
55
|
+
return ROLLOUT_GATES[gateIndex];
|
|
56
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vector-cortex/rollout/emit.ts — VC5C rollout emit seam.
|
|
3
|
+
*
|
|
4
|
+
* The structured-event surface for the live graduated rollout: assignment and
|
|
5
|
+
* promotion-blocked observability. Mirrors the VC0C resilience emit seam and
|
|
6
|
+
* the VC0B replay emit seam: the same injected `(event, fields)` callback, the
|
|
7
|
+
* same non-fatal `safe()` best-effort wrapper, and the same per-call
|
|
8
|
+
* `VC5C_ENABLED()` gate. Absent emitter (or flag OFF) degrades to a no-op with
|
|
9
|
+
* byte-identical predecessor behavior (PREVENT-PI-004, structured `ts`+`event`).
|
|
10
|
+
*
|
|
11
|
+
* Carries exactly the two events the sprint names:
|
|
12
|
+
* - vector_cortex_rollout_assigned (a session was assigned a bucket)
|
|
13
|
+
* - vector_cortex_rollout_promotion_blocked (a hard fault froze promotion)
|
|
14
|
+
*/
|
|
15
|
+
import { VC5C_ENABLED } from "../../config/vector-cortex.js";
|
|
16
|
+
function safe(fn) {
|
|
17
|
+
return (event, fields) => {
|
|
18
|
+
try {
|
|
19
|
+
fn(event, fields);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
/* non-fatal observability — never break the agent loop */
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Build a typed reporter over an injected emit callback. Emission is gated on
|
|
28
|
+
* `VC5C_ENABLED()` — flag OFF (or absent emitter) means zero rollout
|
|
29
|
+
* observability writes (pre-VC predecessor parity). The flag is read per-call so
|
|
30
|
+
* a live toggle takes effect immediately.
|
|
31
|
+
*/
|
|
32
|
+
export function createRolloutReporter(emit) {
|
|
33
|
+
const fire = safe((event, fields) => {
|
|
34
|
+
if (VC5C_ENABLED())
|
|
35
|
+
emit?.(event, fields);
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
assigned(fields) {
|
|
39
|
+
fire("vector_cortex_rollout_assigned", fields);
|
|
40
|
+
},
|
|
41
|
+
promotionBlocked(fields) {
|
|
42
|
+
fire("vector_cortex_rollout_promotion_blocked", fields);
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** Export the event names for consumers that match on them. */
|
|
47
|
+
export const ROLLOUT_EVENT_NAMES = [
|
|
48
|
+
"vector_cortex_rollout_assigned",
|
|
49
|
+
"vector_cortex_rollout_promotion_blocked",
|
|
50
|
+
];
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vector-cortex/rollout/gate.ts — monotonic graduated-gate advance decision.
|
|
3
|
+
*
|
|
4
|
+
* A gate advances exactly ONE step only when ALL conjuncts hold:
|
|
5
|
+
* (elapsedWallClock >= 72h) — measured on the MONOTONIC clock, not wall time
|
|
6
|
+
* AND (powered sample available)
|
|
7
|
+
* AND (events >= 10000)
|
|
8
|
+
* AND (sessions >= 200)
|
|
9
|
+
*
|
|
10
|
+
* Promotion is strictly monotonic by one gate step. The unique failure
|
|
11
|
+
* injection (TRIAD_RESILIENCE.md): a wall-clock jump while the monotonic clock
|
|
12
|
+
* is unchanged does NOT advance — because the 72h eligibility is the MONOTONIC
|
|
13
|
+
* delta, not wall time. We therefore take an injected clock seam with SEPARATE
|
|
14
|
+
* monotonic and wall readings and never call Date.now() directly for the safety
|
|
15
|
+
* decision (PREVENT decorum: the host injects a testable fake clock).
|
|
16
|
+
*
|
|
17
|
+
* Pure arithmetic over injected evidence + clock; no I/O, no network.
|
|
18
|
+
* PREVENT-011: no `any`.
|
|
19
|
+
*/
|
|
20
|
+
import { ROLLOUT_GATES, } from "./types.js";
|
|
21
|
+
/** The 72h monotonic residency requirement (milliseconds). */
|
|
22
|
+
export const GATE_MIN_ELAPSED_MS = 72 * 60 * 60 * 1000;
|
|
23
|
+
/** Powered-sample availability gate (minimum events for a one-sided CI read). */
|
|
24
|
+
export const GATE_MIN_EVENTS = 10_000;
|
|
25
|
+
/** Minimum distinct sessions before a gate may advance. */
|
|
26
|
+
export const GATE_MIN_SESSIONS = 200;
|
|
27
|
+
/** Default clock: real monotonic (performance.now) + wall (ISO). */
|
|
28
|
+
export function defaultClock() {
|
|
29
|
+
return {
|
|
30
|
+
now: () => performance.now(),
|
|
31
|
+
wallNow: () => new Date().toISOString(),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Decide the next live outcome for a decision epoch. Returns the (possibly
|
|
36
|
+
* advanced) gate index + the full evidence snapshot. Promotion monotonic by one
|
|
37
|
+
* step; a hard fault freezes promotion (promotionBlocked=true) and is reported
|
|
38
|
+
* for C-selection by the live seam.
|
|
39
|
+
*
|
|
40
|
+
* @param currentGate the gate index BEFORE this decision (0..4).
|
|
41
|
+
* @param evidence the observed window evidence.
|
|
42
|
+
* @param clock the injected monotonic/wall clock seam.
|
|
43
|
+
*/
|
|
44
|
+
export function decideGate(currentGate, evidence, clock) {
|
|
45
|
+
const elapsedMs = Math.max(0, clock.now() - evidence.windowStartMs);
|
|
46
|
+
const hardFault = evidence.hardFaults.length > 0;
|
|
47
|
+
const eligible = !hardFault &&
|
|
48
|
+
currentGate < (ROLLOUT_GATES.length - 1) &&
|
|
49
|
+
elapsedMs >= GATE_MIN_ELAPSED_MS &&
|
|
50
|
+
evidence.powered &&
|
|
51
|
+
evidence.events >= GATE_MIN_EVENTS &&
|
|
52
|
+
evidence.sessions >= GATE_MIN_SESSIONS;
|
|
53
|
+
// Monotonic by ONE step only.
|
|
54
|
+
const nextGate = eligible
|
|
55
|
+
? (currentGate + 1)
|
|
56
|
+
: currentGate;
|
|
57
|
+
return {
|
|
58
|
+
schema: "live-outcome-v1",
|
|
59
|
+
gateIndex: nextGate,
|
|
60
|
+
gatePct: ROLLOUT_GATES[nextGate],
|
|
61
|
+
elapsedMs,
|
|
62
|
+
powered: evidence.powered,
|
|
63
|
+
events: evidence.events,
|
|
64
|
+
sessions: evidence.sessions,
|
|
65
|
+
promotionBlocked: hardFault,
|
|
66
|
+
decidedAt: clock.wallNow(),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Whether a hard fault should SELECT triad C (pre-VC path). Any hard causal/
|
|
71
|
+
* tool/anchor/exact failure does. Exposed so the live seam can branch cleanly.
|
|
72
|
+
*/
|
|
73
|
+
export function selectsPreVcPath(fault) {
|
|
74
|
+
return fault !== undefined;
|
|
75
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vector-cortex/rollout/types.ts — VC5C live graduated-rollout contracts.
|
|
3
|
+
*
|
|
4
|
+
* A session is deterministically hashed into one of 10,000 stable buckets
|
|
5
|
+
* (0..9999). The current rollout gate is one of 1% / 5% / 25% / 50% / 100%.
|
|
6
|
+
* A bucket is "in" the current gate iff `bucket < gatePct * 100`. Assignment is
|
|
7
|
+
* a PURE function of the session id: it NEVER changes across process restart
|
|
8
|
+
* (no Date.now / Math.random — see `assign.ts`).
|
|
9
|
+
*
|
|
10
|
+
* Pure types + registered conformance IDs: no storage, no console, no network
|
|
11
|
+
* (PREVENT-PI-004 / PREVENT-011).
|
|
12
|
+
*/
|
|
13
|
+
/** Total stable buckets. Reassignment on restart is impossible by construction. */
|
|
14
|
+
export const ROLLOUT_BUCKETS = 10_000;
|
|
15
|
+
/**
|
|
16
|
+
* The five graduated gates, in promotion order. Index = step. Promotion is
|
|
17
|
+
* strictly monotonic by ONE step (never skipping a gate).
|
|
18
|
+
*/
|
|
19
|
+
export const ROLLOUT_GATES = [1, 5, 25, 50, 100];
|
|
20
|
+
/**
|
|
21
|
+
* The two conformance events VC5C emits to the monitoring/events path. Mirrors
|
|
22
|
+
* how prior sprints emit (resilience/emit.ts, render/emit.ts).
|
|
23
|
+
*/
|
|
24
|
+
export const ROLLOUT_EVENTS = [
|
|
25
|
+
"vector_cortex_rollout_assigned",
|
|
26
|
+
"vector_cortex_rollout_promotion_blocked",
|
|
27
|
+
];
|
|
28
|
+
/**
|
|
29
|
+
* Registered rollout conformance ID range (ROL-001..020). The acceptance
|
|
30
|
+
* aggregator reads these rows from the v2 manifest and asserts each returns its
|
|
31
|
+
* manifest `ok`/`code`.
|
|
32
|
+
*/
|
|
33
|
+
export const ROL_IDS = Array.from({ length: 20 }, (_v, i) => `ROL-${String(i + 1).padStart(3, "0")}`);
|
|
34
|
+
/** Named VC5C rollout conformance assertions (the sprint's headline rows). */
|
|
35
|
+
export const ROL_NAMED_IDS = [
|
|
36
|
+
"ROL-BUCKET-001",
|
|
37
|
+
"ROL-POWER-002",
|
|
38
|
+
"ROL-SAFETY-003",
|
|
39
|
+
];
|
package/extensions/dashboard-client/dist/assets/{AreaChart-CGL29Tcl.js → AreaChart-DqTbaSRA.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as R,c as W,m as T,i as C,d as F,A as ie,e as B,h as q,j as oe,k as G,l as se,n as le,u as ue,o as K,G as ce,p as J,q as Q,D as fe,g as pe,X as he,Y as de,f as me}from"./generateCategoricalChart-Dw5YnE5s.js";import{R as p,F as ee,r as ve}from"./index-i9oaPE0a.js";var ye=["layout","type","stroke","connectNulls","isRange","ref"],be=["key"],te;function M(e){"@babel/helpers - typeof";return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(e)}function ae(e,t){if(e==null)return{};var r=Ae(e,t),a,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function Ae(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},D.apply(this,arguments)}function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,a)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?U(Object(r),!0).forEach(function(a){E(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,ne(a.key),a)}}function xe(e,t,r){return t&&Z(e.prototype,t),r&&Z(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pe(e,t,r){return t=$(t),Oe(e,re()?Reflect.construct(t,r||[],$(e).constructor):t.apply(e,r))}function Oe(e,t){if(t&&(M(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ee(e)}function Ee(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function re(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(re=function(){return!!e})()}function $(e){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$(e)}function we(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&X(e,t)}function X(e,t){return X=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,n){return a.__proto__=n,a},X(e,t)}function E(e,t,r){return t=ne(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ne(e){var t=_e(e,"string");return M(t)=="symbol"?t:t+""}function _e(e,t){if(M(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(M(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var L=function(e){function t(){var r;ge(this,t);for(var a=arguments.length,n=new Array(a),i=0;i<a;i++)n[i]=arguments[i];return r=Pe(this,t,[].concat(n)),E(r,"state",{isAnimationFinished:!0}),E(r,"id",ue("recharts-area-")),E(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),K(o)&&o()}),E(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),K(o)&&o()}),r}return we(t,e),xe(t,[{key:"renderDots",value:function(a,n,i){var o=this.props.isAnimationActive,s=this.state.isAnimationFinished;if(o&&!s)return null;var u=this.props,l=u.dot,f=u.points,c=u.dataKey,h=R(this.props,!1),A=R(l,!0),g=f.map(function(v,O){var y=S(S(S({key:"dot-".concat(O),r:3},h),A),{},{index:O,cx:v.x,cy:v.y,dataKey:c,value:v.value,payload:v.payload,points:f});return t.renderDotItem(l,y)}),x={clipPath:a?"url(#clipPath-".concat(n?"":"dots-").concat(i,")"):null};return p.createElement(W,D({className:"recharts-area-dots"},x),g)}},{key:"renderHorizontalRect",value:function(a){var n=this.props,i=n.baseLine,o=n.points,s=n.strokeWidth,u=o[0].x,l=o[o.length-1].x,f=a*Math.abs(u-l),c=T(o.map(function(h){return h.y||0}));return C(i)&&typeof i=="number"?c=Math.max(i,c):i&&Array.isArray(i)&&i.length&&(c=Math.max(T(i.map(function(h){return h.y||0})),c)),C(c)?p.createElement("rect",{x:u<l?u:u-f,y:0,width:f,height:Math.floor(c+(s?parseInt("".concat(s),10):1))}):null}},{key:"renderVerticalRect",value:function(a){var n=this.props,i=n.baseLine,o=n.points,s=n.strokeWidth,u=o[0].y,l=o[o.length-1].y,f=a*Math.abs(u-l),c=T(o.map(function(h){return h.x||0}));return C(i)&&typeof i=="number"?c=Math.max(i,c):i&&Array.isArray(i)&&i.length&&(c=Math.max(T(i.map(function(h){return h.x||0})),c)),C(c)?p.createElement("rect",{x:0,y:u<l?u:u-f,width:c+(s?parseInt("".concat(s),10):1),height:Math.floor(f)}):null}},{key:"renderClipRect",value:function(a){var n=this.props.layout;return n==="vertical"?this.renderVerticalRect(a):this.renderHorizontalRect(a)}},{key:"renderAreaStatically",value:function(a,n,i,o){var s=this.props,u=s.layout,l=s.type,f=s.stroke,c=s.connectNulls,h=s.isRange;s.ref;var A=ae(s,ye);return p.createElement(W,{clipPath:i?"url(#clipPath-".concat(o,")"):null},p.createElement(F,D({},R(A,!0),{points:a,connectNulls:c,type:l,baseLine:n,layout:u,stroke:"none",className:"recharts-area-area"})),f!=="none"&&p.createElement(F,D({},R(this.props,!1),{className:"recharts-area-curve",layout:u,type:l,connectNulls:c,fill:"none",points:a})),f!=="none"&&h&&p.createElement(F,D({},R(this.props,!1),{className:"recharts-area-curve",layout:u,type:l,connectNulls:c,fill:"none",points:n})))}},{key:"renderAreaWithAnimation",value:function(a,n){var i=this,o=this.props,s=o.points,u=o.baseLine,l=o.isAnimationActive,f=o.animationBegin,c=o.animationDuration,h=o.animationEasing,A=o.animationId,g=this.state,x=g.prevPoints,v=g.prevBaseLine;return p.createElement(ie,{begin:f,duration:c,isActive:l,easing:h,from:{t:0},to:{t:1},key:"area-".concat(A),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(O){var y=O.t;if(x){var _=x.length/s.length,d=s.map(function(P,N){var k=Math.floor(N*_);if(x[k]){var j=x[k],I=B(j.x,P.x),V=B(j.y,P.y);return S(S({},P),{},{x:I(y),y:V(y)})}return P}),m;if(C(u)&&typeof u=="number"){var b=B(v,u);m=b(y)}else if(q(u)||oe(u)){var w=B(v,0);m=w(y)}else m=u.map(function(P,N){var k=Math.floor(N*_);if(v[k]){var j=v[k],I=B(j.x,P.x),V=B(j.y,P.y);return S(S({},P),{},{x:I(y),y:V(y)})}return P});return i.renderAreaStatically(d,m,a,n)}return p.createElement(W,null,p.createElement("defs",null,p.createElement("clipPath",{id:"animationClipPath-".concat(n)},i.renderClipRect(y))),p.createElement(W,{clipPath:"url(#animationClipPath-".concat(n,")")},i.renderAreaStatically(s,u,a,n)))})}},{key:"renderArea",value:function(a,n){var i=this.props,o=i.points,s=i.baseLine,u=i.isAnimationActive,l=this.state,f=l.prevPoints,c=l.prevBaseLine,h=l.totalLength;return u&&o&&o.length&&(!f&&h>0||!G(f,o)||!G(c,s))?this.renderAreaWithAnimation(a,n):this.renderAreaStatically(o,s,a,n)}},{key:"render",value:function(){var a,n=this.props,i=n.hide,o=n.dot,s=n.points,u=n.className,l=n.top,f=n.left,c=n.xAxis,h=n.yAxis,A=n.width,g=n.height,x=n.isAnimationActive,v=n.id;if(i||!s||!s.length)return null;var O=this.state.isAnimationFinished,y=s.length===1,_=ee("recharts-area",u),d=c&&c.allowDataOverflow,m=h&&h.allowDataOverflow,b=d||m,w=q(v)?this.id:v,P=(a=R(o,!1))!==null&&a!==void 0?a:{r:3,strokeWidth:2},N=P.r,k=N===void 0?3:N,j=P.strokeWidth,I=j===void 0?2:j,V=se(o)?o:{},Y=V.clipDot,H=Y===void 0?!0:Y,z=k*2+I;return p.createElement(W,{className:_},d||m?p.createElement("defs",null,p.createElement("clipPath",{id:"clipPath-".concat(w)},p.createElement("rect",{x:d?f:f-A/2,y:m?l:l-g/2,width:d?A:A*2,height:m?g:g*2})),!H&&p.createElement("clipPath",{id:"clipPath-dots-".concat(w)},p.createElement("rect",{x:f-z/2,y:l-z/2,width:A+z,height:g+z}))):null,y?null:this.renderArea(b,w),(o||y)&&this.renderDots(b,H,w),(!x||O)&&le.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(a,n){return a.animationId!==n.prevAnimationId?{prevAnimationId:a.animationId,curPoints:a.points,curBaseLine:a.baseLine,prevPoints:n.curPoints,prevBaseLine:n.curBaseLine}:a.points!==n.curPoints||a.baseLine!==n.curBaseLine?{curPoints:a.points,curBaseLine:a.baseLine}:null}}])}(ve.PureComponent);te=L;E(L,"displayName","Area");E(L,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ce.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});E(L,"getBaseValue",function(e,t,r,a){var n=e.layout,i=e.baseValue,o=t.props.baseValue,s=o??i;if(C(s)&&typeof s=="number")return s;var u=n==="horizontal"?a:r,l=u.scale.domain();if(u.type==="number"){var f=Math.max(l[0],l[1]),c=Math.min(l[0],l[1]);return s==="dataMin"?c:s==="dataMax"||f<0?f:Math.max(Math.min(l[0],l[1]),0)}return s==="dataMin"?l[0]:s==="dataMax"?l[1]:l[0]});E(L,"getComposedData",function(e){var t=e.props,r=e.item,a=e.xAxis,n=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,u=e.dataKey,l=e.stackedData,f=e.dataStartIndex,c=e.displayedData,h=e.offset,A=t.layout,g=l&&l.length,x=te.getBaseValue(t,r,a,n),v=A==="horizontal",O=!1,y=c.map(function(d,m){var b;g?b=l[f+m]:(b=J(d,u),Array.isArray(b)?O=!0:b=[x,b]);var w=b[1]==null||g&&J(d,u)==null;return v?{x:Q({axis:a,ticks:i,bandSize:s,entry:d,index:m}),y:w?null:n.scale(b[1]),value:b,payload:d}:{x:w?null:a.scale(b[1]),y:Q({axis:n,ticks:o,bandSize:s,entry:d,index:m}),value:b,payload:d}}),_;return g||O?_=y.map(function(d){var m=Array.isArray(d.value)?d.value[0]:null;return v?{x:d.x,y:m!=null&&d.y!=null?n.scale(m):null}:{x:m!=null?a.scale(m):null,y:d.y}}):_=v?n.scale(x):a.scale(x),S({points:y,baseLine:_,layout:A,isRange:O},h)});E(L,"renderDotItem",function(e,t){var r;if(p.isValidElement(e))r=p.cloneElement(e,t);else if(K(e))r=e(t);else{var a=ee("recharts-area-dot",typeof e!="boolean"?e.className:""),n=t.key,i=ae(t,be);r=p.createElement(fe,D({},i,{key:n,className:a}))}return r});var ke=pe({chartName:"AreaChart",GraphicalChild:L,axisComponents:[{axisType:"xAxis",AxisComp:he},{axisType:"yAxis",AxisComp:de}],formatAxisMap:me});export{ke as A,L as a};
|
|
2
|
-
//# sourceMappingURL=AreaChart-
|
|
1
|
+
import{b as R,c as W,m as T,i as C,d as F,A as ie,e as B,h as q,j as oe,k as G,l as se,n as le,u as ue,o as K,G as ce,p as J,q as Q,D as fe,g as pe,X as he,Y as de,f as me}from"./generateCategoricalChart-DRresOQF.js";import{R as p,F as ee,r as ve}from"./index-DohmtZWL.js";var ye=["layout","type","stroke","connectNulls","isRange","ref"],be=["key"],te;function M(e){"@babel/helpers - typeof";return M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},M(e)}function ae(e,t){if(e==null)return{};var r=Ae(e,t),a,n;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)a=i[n],!(t.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}function Ae(e,t){if(e==null)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}function D(){return D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},D.apply(this,arguments)}function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,a)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?U(Object(r),!0).forEach(function(a){E(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,ne(a.key),a)}}function xe(e,t,r){return t&&Z(e.prototype,t),r&&Z(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Pe(e,t,r){return t=$(t),Oe(e,re()?Reflect.construct(t,r||[],$(e).constructor):t.apply(e,r))}function Oe(e,t){if(t&&(M(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ee(e)}function Ee(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function re(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(re=function(){return!!e})()}function $(e){return $=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$(e)}function we(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&X(e,t)}function X(e,t){return X=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,n){return a.__proto__=n,a},X(e,t)}function E(e,t,r){return t=ne(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ne(e){var t=_e(e,"string");return M(t)=="symbol"?t:t+""}function _e(e,t){if(M(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var a=r.call(e,t);if(M(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var L=function(e){function t(){var r;ge(this,t);for(var a=arguments.length,n=new Array(a),i=0;i<a;i++)n[i]=arguments[i];return r=Pe(this,t,[].concat(n)),E(r,"state",{isAnimationFinished:!0}),E(r,"id",ue("recharts-area-")),E(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),K(o)&&o()}),E(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),K(o)&&o()}),r}return we(t,e),xe(t,[{key:"renderDots",value:function(a,n,i){var o=this.props.isAnimationActive,s=this.state.isAnimationFinished;if(o&&!s)return null;var u=this.props,l=u.dot,f=u.points,c=u.dataKey,h=R(this.props,!1),A=R(l,!0),g=f.map(function(v,O){var y=S(S(S({key:"dot-".concat(O),r:3},h),A),{},{index:O,cx:v.x,cy:v.y,dataKey:c,value:v.value,payload:v.payload,points:f});return t.renderDotItem(l,y)}),x={clipPath:a?"url(#clipPath-".concat(n?"":"dots-").concat(i,")"):null};return p.createElement(W,D({className:"recharts-area-dots"},x),g)}},{key:"renderHorizontalRect",value:function(a){var n=this.props,i=n.baseLine,o=n.points,s=n.strokeWidth,u=o[0].x,l=o[o.length-1].x,f=a*Math.abs(u-l),c=T(o.map(function(h){return h.y||0}));return C(i)&&typeof i=="number"?c=Math.max(i,c):i&&Array.isArray(i)&&i.length&&(c=Math.max(T(i.map(function(h){return h.y||0})),c)),C(c)?p.createElement("rect",{x:u<l?u:u-f,y:0,width:f,height:Math.floor(c+(s?parseInt("".concat(s),10):1))}):null}},{key:"renderVerticalRect",value:function(a){var n=this.props,i=n.baseLine,o=n.points,s=n.strokeWidth,u=o[0].y,l=o[o.length-1].y,f=a*Math.abs(u-l),c=T(o.map(function(h){return h.x||0}));return C(i)&&typeof i=="number"?c=Math.max(i,c):i&&Array.isArray(i)&&i.length&&(c=Math.max(T(i.map(function(h){return h.x||0})),c)),C(c)?p.createElement("rect",{x:0,y:u<l?u:u-f,width:c+(s?parseInt("".concat(s),10):1),height:Math.floor(f)}):null}},{key:"renderClipRect",value:function(a){var n=this.props.layout;return n==="vertical"?this.renderVerticalRect(a):this.renderHorizontalRect(a)}},{key:"renderAreaStatically",value:function(a,n,i,o){var s=this.props,u=s.layout,l=s.type,f=s.stroke,c=s.connectNulls,h=s.isRange;s.ref;var A=ae(s,ye);return p.createElement(W,{clipPath:i?"url(#clipPath-".concat(o,")"):null},p.createElement(F,D({},R(A,!0),{points:a,connectNulls:c,type:l,baseLine:n,layout:u,stroke:"none",className:"recharts-area-area"})),f!=="none"&&p.createElement(F,D({},R(this.props,!1),{className:"recharts-area-curve",layout:u,type:l,connectNulls:c,fill:"none",points:a})),f!=="none"&&h&&p.createElement(F,D({},R(this.props,!1),{className:"recharts-area-curve",layout:u,type:l,connectNulls:c,fill:"none",points:n})))}},{key:"renderAreaWithAnimation",value:function(a,n){var i=this,o=this.props,s=o.points,u=o.baseLine,l=o.isAnimationActive,f=o.animationBegin,c=o.animationDuration,h=o.animationEasing,A=o.animationId,g=this.state,x=g.prevPoints,v=g.prevBaseLine;return p.createElement(ie,{begin:f,duration:c,isActive:l,easing:h,from:{t:0},to:{t:1},key:"area-".concat(A),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(O){var y=O.t;if(x){var _=x.length/s.length,d=s.map(function(P,N){var k=Math.floor(N*_);if(x[k]){var j=x[k],I=B(j.x,P.x),V=B(j.y,P.y);return S(S({},P),{},{x:I(y),y:V(y)})}return P}),m;if(C(u)&&typeof u=="number"){var b=B(v,u);m=b(y)}else if(q(u)||oe(u)){var w=B(v,0);m=w(y)}else m=u.map(function(P,N){var k=Math.floor(N*_);if(v[k]){var j=v[k],I=B(j.x,P.x),V=B(j.y,P.y);return S(S({},P),{},{x:I(y),y:V(y)})}return P});return i.renderAreaStatically(d,m,a,n)}return p.createElement(W,null,p.createElement("defs",null,p.createElement("clipPath",{id:"animationClipPath-".concat(n)},i.renderClipRect(y))),p.createElement(W,{clipPath:"url(#animationClipPath-".concat(n,")")},i.renderAreaStatically(s,u,a,n)))})}},{key:"renderArea",value:function(a,n){var i=this.props,o=i.points,s=i.baseLine,u=i.isAnimationActive,l=this.state,f=l.prevPoints,c=l.prevBaseLine,h=l.totalLength;return u&&o&&o.length&&(!f&&h>0||!G(f,o)||!G(c,s))?this.renderAreaWithAnimation(a,n):this.renderAreaStatically(o,s,a,n)}},{key:"render",value:function(){var a,n=this.props,i=n.hide,o=n.dot,s=n.points,u=n.className,l=n.top,f=n.left,c=n.xAxis,h=n.yAxis,A=n.width,g=n.height,x=n.isAnimationActive,v=n.id;if(i||!s||!s.length)return null;var O=this.state.isAnimationFinished,y=s.length===1,_=ee("recharts-area",u),d=c&&c.allowDataOverflow,m=h&&h.allowDataOverflow,b=d||m,w=q(v)?this.id:v,P=(a=R(o,!1))!==null&&a!==void 0?a:{r:3,strokeWidth:2},N=P.r,k=N===void 0?3:N,j=P.strokeWidth,I=j===void 0?2:j,V=se(o)?o:{},Y=V.clipDot,H=Y===void 0?!0:Y,z=k*2+I;return p.createElement(W,{className:_},d||m?p.createElement("defs",null,p.createElement("clipPath",{id:"clipPath-".concat(w)},p.createElement("rect",{x:d?f:f-A/2,y:m?l:l-g/2,width:d?A:A*2,height:m?g:g*2})),!H&&p.createElement("clipPath",{id:"clipPath-dots-".concat(w)},p.createElement("rect",{x:f-z/2,y:l-z/2,width:A+z,height:g+z}))):null,y?null:this.renderArea(b,w),(o||y)&&this.renderDots(b,H,w),(!x||O)&&le.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(a,n){return a.animationId!==n.prevAnimationId?{prevAnimationId:a.animationId,curPoints:a.points,curBaseLine:a.baseLine,prevPoints:n.curPoints,prevBaseLine:n.curBaseLine}:a.points!==n.curPoints||a.baseLine!==n.curBaseLine?{curPoints:a.points,curBaseLine:a.baseLine}:null}}])}(ve.PureComponent);te=L;E(L,"displayName","Area");E(L,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ce.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});E(L,"getBaseValue",function(e,t,r,a){var n=e.layout,i=e.baseValue,o=t.props.baseValue,s=o??i;if(C(s)&&typeof s=="number")return s;var u=n==="horizontal"?a:r,l=u.scale.domain();if(u.type==="number"){var f=Math.max(l[0],l[1]),c=Math.min(l[0],l[1]);return s==="dataMin"?c:s==="dataMax"||f<0?f:Math.max(Math.min(l[0],l[1]),0)}return s==="dataMin"?l[0]:s==="dataMax"?l[1]:l[0]});E(L,"getComposedData",function(e){var t=e.props,r=e.item,a=e.xAxis,n=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,u=e.dataKey,l=e.stackedData,f=e.dataStartIndex,c=e.displayedData,h=e.offset,A=t.layout,g=l&&l.length,x=te.getBaseValue(t,r,a,n),v=A==="horizontal",O=!1,y=c.map(function(d,m){var b;g?b=l[f+m]:(b=J(d,u),Array.isArray(b)?O=!0:b=[x,b]);var w=b[1]==null||g&&J(d,u)==null;return v?{x:Q({axis:a,ticks:i,bandSize:s,entry:d,index:m}),y:w?null:n.scale(b[1]),value:b,payload:d}:{x:w?null:a.scale(b[1]),y:Q({axis:n,ticks:o,bandSize:s,entry:d,index:m}),value:b,payload:d}}),_;return g||O?_=y.map(function(d){var m=Array.isArray(d.value)?d.value[0]:null;return v?{x:d.x,y:m!=null&&d.y!=null?n.scale(m):null}:{x:m!=null?a.scale(m):null,y:d.y}}):_=v?n.scale(x):a.scale(x),S({points:y,baseLine:_,layout:A,isRange:O},h)});E(L,"renderDotItem",function(e,t){var r;if(p.isValidElement(e))r=p.cloneElement(e,t);else if(K(e))r=e(t);else{var a=ee("recharts-area-dot",typeof e!="boolean"?e.className:""),n=t.key,i=ae(t,be);r=p.createElement(fe,D({},i,{key:n,className:a}))}return r});var ke=pe({chartName:"AreaChart",GraphicalChild:L,axisComponents:[{axisType:"xAxis",AxisComp:he},{axisType:"yAxis",AxisComp:de}],formatAxisMap:me});export{ke as A,L as a};
|
|
2
|
+
//# sourceMappingURL=AreaChart-DqTbaSRA.js.map
|