pi-mega-compact 0.20.55 → 0.20.57
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/repo-corpus.js +20 -0
- package/dist/config/vector-cortex-cosfp-real.js +34 -0
- package/dist/config/vector-cortex.js +5 -0
- package/dist/config.js +1 -1
- package/dist/extensions/dashboard-server/api-contracts/endpoints/registry-ext.js +7 -0
- package/dist/extensions/dashboard-server/api-contracts/repo-corpus.js +10 -0
- package/dist/extensions/dashboard-server/route-dispatch.js +3 -1
- package/dist/extensions/dashboard-server/routes-rag-settings-vector-cortex.js +2 -0
- package/dist/extensions/dashboard-server/routes-repo-corpus.js +258 -0
- package/dist/extensions/dashboard-server/routes.js +1 -0
- package/dist/src/config/repo-corpus.js +20 -0
- package/dist/src/config/vector-cortex-cosfp-real.js +34 -0
- package/dist/src/config/vector-cortex.js +5 -0
- package/dist/src/config.js +1 -1
- package/extensions/dashboard-client/dist/assets/{AreaChart-DlndN0p2.js → AreaChart-CtJ6dSMT.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{AreaChart-DlndN0p2.js.map → AreaChart-CtJ6dSMT.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{BarChart-DH6rZ60s.js → BarChart-DJ3j3xDz.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{BarChart-DH6rZ60s.js.map → BarChart-DJ3j3xDz.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{CacheTab-Qj_NYKw3.js → CacheTab-CXU1_9lR.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{CacheTab-Qj_NYKw3.js.map → CacheTab-CXU1_9lR.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{EventsTab-3QlIPMFj.js → EventsTab-DF-Q3o7x.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{EventsTab-3QlIPMFj.js.map → EventsTab-DF-Q3o7x.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{HealthTab-DTwitpIb.js → HealthTab-Dr1HGOkl.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{HealthTab-DTwitpIb.js.map → HealthTab-Dr1HGOkl.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MaintenanceTab-DkVlBnp7.js → MaintenanceTab-zKhR18_s.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MaintenanceTab-DkVlBnp7.js.map → MaintenanceTab-zKhR18_s.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MemoryMapTab-B-pHH85r.js → MemoryMapTab-DekIzfn2.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MemoryMapTab-B-pHH85r.js.map → MemoryMapTab-DekIzfn2.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MetricsTab-C8VpwhJN.js → MetricsTab-CEKajY38.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MetricsTab-C8VpwhJN.js.map → MetricsTab-CEKajY38.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{OverviewTab-C_JZlM_Q.js → OverviewTab-24sG8xiE.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{OverviewTab-C_JZlM_Q.js.map → OverviewTab-24sG8xiE.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{ReposTab-rRMlub-E.js → ReposTab-70gkV8l9.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{ReposTab-rRMlub-E.js.map → ReposTab-70gkV8l9.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{SessionsTab-CL6S094G.js → SessionsTab-B3quvYPZ.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{SessionsTab-CL6S094G.js.map → SessionsTab-B3quvYPZ.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/SetupTab-tbPrrfYx.js +3 -0
- package/extensions/dashboard-client/dist/assets/SetupTab-tbPrrfYx.js.map +1 -0
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-B-8NCvzd.js → TimeSavedCard-B6mdtCWE.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-B-8NCvzd.js.map → TimeSavedCard-B6mdtCWE.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{TurnsTab-C2MVgG4N.js → TurnsTab-CmhRJJqr.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{TurnsTab-C2MVgG4N.js.map → TurnsTab-CmhRJJqr.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{VcStatusBadge-CvlS_fvh.js → VcStatusBadge-SDThp0R0.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{VcStatusBadge-CvlS_fvh.js.map → VcStatusBadge-SDThp0R0.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{VectorCortexTab-BXCAzwQm.js → VectorCortexTab-DDjCkTjk.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{VectorCortexTab-BXCAzwQm.js.map → VectorCortexTab-DDjCkTjk.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{WikiTab-DUivYmJ5.js → WikiTab-Cki48_8N.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{WikiTab-DUivYmJ5.js.map → WikiTab-Cki48_8N.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{button-dTpuinxr.js → button-CojFYd7q.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{button-dTpuinxr.js.map → button-CojFYd7q.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{card-DNwZ7dSg.js → card-Cxeeje9o.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{card-DNwZ7dSg.js.map → card-Cxeeje9o.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{client-extra-CQuCpjyO.js → client-extra-DLxyGxW8.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{client-extra-CQuCpjyO.js.map → client-extra-DLxyGxW8.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-D1HV4d79.js → generateCategoricalChart-DRlqBks2.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-D1HV4d79.js.map → generateCategoricalChart-DRlqBks2.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{index-Bi5YNsLx.js → index-CkbdlPBm.js} +14 -14
- package/extensions/dashboard-client/dist/assets/index-CkbdlPBm.js.map +1 -0
- package/extensions/dashboard-client/dist/assets/{switch-DiKc2q4n.js → switch-Cx_nl-Ba.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{switch-DiKc2q4n.js.map → switch-Cx_nl-Ba.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{toggle-BBYD10JO.js → toggle-CfIFzp6P.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{toggle-BBYD10JO.js.map → toggle-CfIFzp6P.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{useSSE-CWUSDhIb.js → useSSE-B9_N7ccG.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{useSSE-CWUSDhIb.js.map → useSSE-B9_N7ccG.js.map} +1 -1
- package/extensions/dashboard-client/dist/index.html +1 -1
- package/extensions/dashboard-client/src/tabs/SetupTab/CortexSetup.tsx +2 -0
- package/extensions/dashboard-client/src/tabs/SetupTab/VectorCortexRepoCorpusCard.tsx +126 -0
- package/extensions/dashboard-client/src/types/repo-corpus.ts +25 -0
- package/extensions/dashboard-server/api-contracts/endpoints/registry-ext.ts +11 -0
- package/extensions/dashboard-server/api-contracts/index.ts +12 -0
- package/extensions/dashboard-server/api-contracts/repo-corpus.ts +76 -0
- package/extensions/dashboard-server/route-dispatch.ts +2 -0
- package/extensions/dashboard-server/routes-rag-settings-vector-cortex.ts +12 -0
- package/extensions/dashboard-server/routes-repo-corpus.ts +286 -0
- package/extensions/dashboard-server/routes.ts +1 -0
- package/package.json +1 -1
- package/src/config/repo-corpus.ts +23 -0
- package/src/config/vector-cortex-cosfp-real.ts +37 -0
- package/src/config/vector-cortex.ts +5 -0
- package/src/config.ts +2 -0
- package/extensions/dashboard-client/dist/assets/SetupTab-C6b8YuBK.js +0 -3
- package/extensions/dashboard-client/dist/assets/SetupTab-C6b8YuBK.js.map +0 -1
- package/extensions/dashboard-client/dist/assets/index-Bi5YNsLx.js.map +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* config/repo-corpus.ts — REPO-A cross-repo corpus preparation sprint flag.
|
|
3
|
+
*
|
|
4
|
+
* Positive sprint flag sibling (mirrors config/vector-cortex-cosfp.ts), NOT under
|
|
5
|
+
* a vector-cortex- prefix per the REPO-A spec: the reader route + corpus-builder
|
|
6
|
+
* gate on this flag. Root src/config.ts re-exports it so every existing import
|
|
7
|
+
* keeps resolving unchanged. Pi-agnostic, dependency-free (PREVENT-PI-004 /
|
|
8
|
+
* PREVENT-011).
|
|
9
|
+
*/
|
|
10
|
+
import { sprintFlag } from "./vector-cortex-flag.js";
|
|
11
|
+
/**
|
|
12
|
+
* REPO-A — cross-repo corpus preparation. Default ON.
|
|
13
|
+
* `MEGACOMPACT_REPO_CORPUS=0` disables and is byte-identical to the predecessor:
|
|
14
|
+
* the reader route GET /api/repo-corpus 404s (no derived artifact written), the
|
|
15
|
+
* corpus-builder refuses to run, and the existing single-repo recall path is
|
|
16
|
+
* untouched. This flag MUST also be a dashboard SETTINGS toggle (visible in the
|
|
17
|
+
* config UI, never in EXCLUDED_SETTINGS). The builder + route perform only local
|
|
18
|
+
* filesystem reads / local `git` introspection (PREVENT-PI-004).
|
|
19
|
+
*/
|
|
20
|
+
export const REPO_CORPUS_ENABLED = () => sprintFlag("MEGACOMPACT_REPO_CORPUS");
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* config/vector-cortex-cosfp-real.ts — COS-FP-R real-corpus FP validation flag.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from vector-cortex.ts so that barrel stays under the 300-line soft
|
|
5
|
+
* limit (soft-as-hard gate), exactly as vector-cortex-cosfp.ts and the other
|
|
6
|
+
* per-sprint flag siblings were. Gating the real-corpus L2 cosine false-positive
|
|
7
|
+
* validation: the `scripts/cosine-fp/real-bench.mjs` execution harness that runs
|
|
8
|
+
* only when a consented donated corpus exists, the execution-time report rows,
|
|
9
|
+
* and the evidence record. A pure-local, consent-gated tool (SECURITY_PRIVACY
|
|
10
|
+
* §Lifecycle/§Consent + EVAL-REDACT-002) — it never reads real session/ledger
|
|
11
|
+
* bytes without an explicit per-session consent record.
|
|
12
|
+
*
|
|
13
|
+
* The split is mechanical: COSINE_FP_REAL_ENABLED is byte-identical in name,
|
|
14
|
+
* semantics, and default to the sibling flag convention (positive, default ON),
|
|
15
|
+
* and vector-cortex.ts re-exports it so every existing
|
|
16
|
+
* `from "./config/vector-cortex.js"` import keeps resolving unchanged.
|
|
17
|
+
*
|
|
18
|
+
* Pi-agnostic, dependency-free (PREVENT-PI-004 / PREVENT-011).
|
|
19
|
+
*/
|
|
20
|
+
import { sprintFlag } from "./vector-cortex-flag.js";
|
|
21
|
+
/**
|
|
22
|
+
* COS-FP-R — real-corpus L2 cosine FP validation against donated sessions.
|
|
23
|
+
* Default ON. `MEGACOMPACT_COSINE_FP_REAL=0` disables and is byte-identical to
|
|
24
|
+
* the predecessor: `scripts/cosine-fp/real-bench.mjs` is inert (nothing
|
|
25
|
+
* executes, no writes), no real-corpus report rows or evidence are written, and
|
|
26
|
+
* no threshold is adopted. When ON (default), execution still only proceeds when
|
|
27
|
+
* a valid consented corpus exists under `scripts/cosine-fp/corpus/` — absent
|
|
28
|
+
* corpus is the normative `no_corpus` pre-donation state, not a failure. Corpus
|
|
29
|
+
* bytes are read only for sessions with an explicit, append-only, revocable
|
|
30
|
+
* consent record (SECURITY_PRIVACY §Lifecycle/§Consent). This flag MUST also be
|
|
31
|
+
* a dashboard SETTINGS toggle (visible in config UI, never in EXCLUDED_SETTINGS).
|
|
32
|
+
* The harness performs only local filesystem reads (PREVENT-PI-004).
|
|
33
|
+
*/
|
|
34
|
+
export const COSINE_FP_REAL_ENABLED = () => sprintFlag("MEGACOMPACT_COSINE_FP_REAL");
|
|
@@ -34,6 +34,11 @@ export { ENC_0F_ENABLED } from "./vector-cortex-enc0f.js";
|
|
|
34
34
|
export { ENC_0G_ENABLED } from "./vector-cortex-enc0g.js";
|
|
35
35
|
// COS-FP-A synthetic FP harness flag extracted to vector-cortex-cosfp.ts.
|
|
36
36
|
export { COSINE_FP_BENCH_ENABLED } from "./vector-cortex-cosfp.js";
|
|
37
|
+
// COS-FP-R real-corpus FP validation flag extracted to vector-cortex-cosfp-real.ts.
|
|
38
|
+
export { COSINE_FP_REAL_ENABLED } from "./vector-cortex-cosfp-real.js";
|
|
39
|
+
// REPO-A cross-repo corpus prep flag extracted to repo-corpus.ts (no vector-cortex
|
|
40
|
+
// prefix per spec); re-exported so root src/config.ts barrel resolves unchanged.
|
|
41
|
+
export { REPO_CORPUS_ENABLED } from "./repo-corpus.js";
|
|
37
42
|
export { ENC_1A_ENABLED } from "./vector-cortex-enc1a.js";
|
|
38
43
|
export { ENC_1B_ENABLED, ENC_1B_MAX_EMBEDDING_DIM, ENC_1B_EMBEDDING_DIM_ENV, ENC_1B_EMBEDDING_HEADERS_ENV, ENC_1B_ALLOW_REMOTE_EMBEDDER_ENV, ENC_1B_ENCODER_NATIVE_ENV, } from "./vector-cortex-enc1b.js";
|
|
39
44
|
export { ENC_2BUDGET_ENABLED, ENC_2BUDGET_NATIVE_ORT_BUDGET_ENV, ENC_2BUDGET_MAX_MIB, ENC_2BUDGET_DEFAULT_MIB, } from "./vector-cortex-enc2budget.js";
|
package/dist/config.js
CHANGED
|
@@ -114,4 +114,4 @@ export const NEW_UI = () => ragEnabled("MEGACOMPACT_NEW_UI");
|
|
|
114
114
|
// default ON, `=0`/`_DISABLED` off. Re-exported from src/config/vector-cortex.ts
|
|
115
115
|
// so root consumers share one source of truth.
|
|
116
116
|
// ---------------------------------------------------------------------------
|
|
117
|
-
export { VC0A_ENABLED, VC0B_ENABLED, VC1A_ENABLED, VC0C_ENABLED, VC1B_ENABLED, VC1C_ENABLED, VC2A_ENABLED, VC2B_ENABLED, VC2C_ENABLED, VC3A_ENABLED, VC3B_ENABLED, VC3C_ENABLED, VC4A_ENABLED, VC4B_ENABLED, VC4C_ENABLED, VC5A_ENABLED, VC5B_ENABLED, VC5C_ENABLED, VC6A_ENABLED, VC6B_ENABLED, VC6C_ENABLED, VC7A_ENABLED, VC7B_ENABLED, VC7C_ENABLED, VC8A_ENABLED, VC8B_ENABLED, VC8C_ENABLED, VC9A_ENABLED, VC9B_ENABLED, VC9C_ENABLED, VC9D_ENABLED, PCC_ENABLED, ML5A_ENABLED, ML5B_ENABLED, ML5C_ENABLED, ML5D_ENABLED, ML5E_ENABLED, DEDUP_ATTR_ENABLED, ENC_0A_ENABLED, ENC_0B_ENABLED, ENC_0C_ENABLED, ENC_0D_ENABLED, ENC_0E_ENABLED, ENC_0F_ENABLED, ENC_0G_ENABLED, ENC_1A_ENABLED, ENC_1B_ENABLED, ENC_2BUDGET_ENABLED, ENC_2BUDGET_NATIVE_ORT_BUDGET_ENV, ENC_2BUDGET_MAX_MIB, ENC_2BUDGET_DEFAULT_MIB, COSINE_FP_BENCH_ENABLED, BREAKER_WINDOW_MS, BREAKER_MIN_ATTEMPTS, BREAKER_PERF_FAILURES, BREAKER_PERF_FAILURE_RATE, BREAKER_CORRECTNESS_FAILURES, BREAKER_COOLDOWN_MS, BREAKER_PROBE_COUNT, BREAKER_RETRY_BASE_MS, BREAKER_RETRY_CAP_MS, BREAKER_RETRY_JITTER, BREAKER_HYSTERESIS_FAILURE_RATE, BREAKER_HYSTERESIS_BUDGET_P95_MS, BREAKER_MIN_HEALTHY_RESIDENCE_MS, } from "./config/vector-cortex.js";
|
|
117
|
+
export { VC0A_ENABLED, VC0B_ENABLED, VC1A_ENABLED, VC0C_ENABLED, VC1B_ENABLED, VC1C_ENABLED, VC2A_ENABLED, VC2B_ENABLED, VC2C_ENABLED, VC3A_ENABLED, VC3B_ENABLED, VC3C_ENABLED, VC4A_ENABLED, VC4B_ENABLED, VC4C_ENABLED, VC5A_ENABLED, VC5B_ENABLED, VC5C_ENABLED, VC6A_ENABLED, VC6B_ENABLED, VC6C_ENABLED, VC7A_ENABLED, VC7B_ENABLED, VC7C_ENABLED, VC8A_ENABLED, VC8B_ENABLED, VC8C_ENABLED, VC9A_ENABLED, VC9B_ENABLED, VC9C_ENABLED, VC9D_ENABLED, PCC_ENABLED, ML5A_ENABLED, ML5B_ENABLED, ML5C_ENABLED, ML5D_ENABLED, ML5E_ENABLED, DEDUP_ATTR_ENABLED, ENC_0A_ENABLED, ENC_0B_ENABLED, ENC_0C_ENABLED, ENC_0D_ENABLED, ENC_0E_ENABLED, ENC_0F_ENABLED, ENC_0G_ENABLED, ENC_1A_ENABLED, ENC_1B_ENABLED, ENC_2BUDGET_ENABLED, ENC_2BUDGET_NATIVE_ORT_BUDGET_ENV, ENC_2BUDGET_MAX_MIB, ENC_2BUDGET_DEFAULT_MIB, COSINE_FP_BENCH_ENABLED, COSINE_FP_REAL_ENABLED, REPO_CORPUS_ENABLED, BREAKER_WINDOW_MS, BREAKER_MIN_ATTEMPTS, BREAKER_PERF_FAILURES, BREAKER_PERF_FAILURE_RATE, BREAKER_CORRECTNESS_FAILURES, BREAKER_COOLDOWN_MS, BREAKER_PROBE_COUNT, BREAKER_RETRY_BASE_MS, BREAKER_RETRY_CAP_MS, BREAKER_RETRY_JITTER, BREAKER_HYSTERESIS_FAILURE_RATE, BREAKER_HYSTERESIS_BUDGET_P95_MS, BREAKER_MIN_HEALTHY_RESIDENCE_MS, } from "./config/vector-cortex.js";
|
|
@@ -81,4 +81,11 @@ export const EXTRA_ENDPOINTS = {
|
|
|
81
81
|
path: "/api/cosine-fp-report",
|
|
82
82
|
description: "Reader-only cosine-FP report (COS-FP-A): the last written synthetic bench aggregate — grid summary, per-content-type FP/FN/F1, recommended default, report digest. Counts + fractions + digests only, never template text. Missing report → awaiting_data; flag-off returns 404.",
|
|
83
83
|
},
|
|
84
|
+
// ─── REPO-A cross-repo corpus ──────────────────────────────────────
|
|
85
|
+
/** GET /api/repo-corpus — reader-only pseudonymous corpus status. */
|
|
86
|
+
repoCorpus: {
|
|
87
|
+
method: "GET",
|
|
88
|
+
path: "/api/repo-corpus",
|
|
89
|
+
description: "Reader-only cross-repo corpus status (REPO-A): which pseudonymous repos/sessions are in the consented corpus, cross-repo overlap descriptors, and per-repo active-consent state. Counts + IDs + status only — never payload content. Flag-off returns 404; absent corpus returns awaiting_data.",
|
|
90
|
+
},
|
|
84
91
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* api-contracts/repo-corpus.ts — REPO-A cross-repo corpus API contract.
|
|
3
|
+
*
|
|
4
|
+
* Reader-only shapes for GET /api/repo-corpus. The corpus manifest is written by
|
|
5
|
+
* the CLI corpus-builder (scripts/repo-corpus/build.mjs) as a PSEUDONYMOUS
|
|
6
|
+
* artifact — repo IDs/counts/digests/cross-repo-overlap descriptors only, never
|
|
7
|
+
* payload content (EVAL-REDACT-002). The canonicalRemote→pseudonym mapping is a
|
|
8
|
+
* pure in-memory function and never leaves the builder. No `any`.
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* PREVENT-PI-004: local filesystem read only, no network.
|
|
9
9
|
* PREVENT-011: no `any` type.
|
|
10
10
|
*/
|
|
11
|
-
import { handleIndex, handleRepoIndex, handleEvents, handleGameState, handleGameScores, handlePerfSamples, handlePerf, handleAchievements, handleSessions, handleTopics, handleTurns, handleMaintenance, handleProviderCache, handleMemoryStatus, handleCacheStripes, handlePrefixStability, handleSetupStatus, handleSetupDetect, handleSetupConfigure, handleMemoryMap, handleRaptorTree, handleRaptorBuildHistory, handleContextHealth, handleCachePoison, handleHealthSettings, handleEmbedderHealth, handleRagSettings, handleRagMetrics, handleModelThresholds, handleWiki, handleVectorCortexEvaluation, handleVectorCortexHealth, handleVectorCortexBreakersReset, handleVectorCortexLedger, handleVectorCortexTopology, handleVectorCortexQuery, handleVectorCortexShards, handleVectorCortexResidual, handleVectorCortexReconstruct, handleVectorCortexPlans, handleVectorCortexRender, handleVectorCortexRollout, handleVectorCortexClosureProof, handleVectorCortexRestore, handleSetupCortexStatus, handleSetupCortexAction, handleSetupCortexActionLog, handleImproveCortex, handleImproveCortexStatus, handleDedupTierAttribution, handleCosineFpReport, } from "./routes.js";
|
|
11
|
+
import { handleIndex, handleRepoIndex, handleEvents, handleGameState, handleGameScores, handlePerfSamples, handlePerf, handleAchievements, handleSessions, handleTopics, handleTurns, handleMaintenance, handleProviderCache, handleMemoryStatus, handleCacheStripes, handlePrefixStability, handleSetupStatus, handleSetupDetect, handleSetupConfigure, handleMemoryMap, handleRaptorTree, handleRaptorBuildHistory, handleContextHealth, handleCachePoison, handleHealthSettings, handleEmbedderHealth, handleRagSettings, handleRagMetrics, handleModelThresholds, handleWiki, handleVectorCortexEvaluation, handleVectorCortexHealth, handleVectorCortexBreakersReset, handleVectorCortexLedger, handleVectorCortexTopology, handleVectorCortexQuery, handleVectorCortexShards, handleVectorCortexResidual, handleVectorCortexReconstruct, handleVectorCortexPlans, handleVectorCortexRender, handleVectorCortexRollout, handleVectorCortexClosureProof, handleVectorCortexRestore, handleSetupCortexStatus, handleSetupCortexAction, handleSetupCortexActionLog, handleImproveCortex, handleImproveCortexStatus, handleDedupTierAttribution, handleCosineFpReport, handleRepoCorpus, } from "./routes.js";
|
|
12
12
|
// VC6C repair lives in its own module (routes-vector-cortex-repair.ts) so the
|
|
13
13
|
// heal route file stays well under the 400-line extension soft limit.
|
|
14
14
|
import { handleVectorCortexRepair } from "./routes-vector-cortex-repair.js";
|
|
@@ -157,5 +157,7 @@ export function dispatchRoutes(req, res, ctx) {
|
|
|
157
157
|
return true;
|
|
158
158
|
if (handleCosineFpReport(req, res, ctx))
|
|
159
159
|
return true;
|
|
160
|
+
if (handleRepoCorpus(req, res, ctx))
|
|
161
|
+
return true;
|
|
160
162
|
return false;
|
|
161
163
|
}
|
|
@@ -69,5 +69,7 @@ export const VECTOR_CORTEX_SETTINGS = {
|
|
|
69
69
|
boolDirect("MEGACOMPACT_ENC_1B", "ENC-1b ONNX runtime backend + embedder API settings", "ENC-1b completes the embedder API Settings surface (dim / headers / allow-remote persisted to the per-repo .mega-compact.env) and surfaces the ONNX runtime selection knob (MEGACOMPACT_ENCODER_NATIVE) as a toggle plus the current effective backend + demotion reason. OFF = no new GET fields, no writer branch, no new Settings rows or toggle (byte-identical ENC-1a predecessor).", true),
|
|
70
70
|
boolDirect("MEGACOMPACT_ENC_2BUDGET", "ENC-2a operator-configurable native install-budget knob", "ENC-2a exposes the runtime operator knob MEGACOMPACT_NATIVE_ORT_BUDGET_MIB (default 300 MiB, clamp 8192) as a dashboard Settings field. The knob gates budgetOk in the encoder runtime decision (decision.ts installBudgetMib + runtime-select.ts selectRuntimeBackend). Persisted to the per-repo .mega-compact.env via the setup-configure writer branch; the GET status route surfaces the persisted value AND the effective integer installBudgetMib() resolves to (so the dashboard shows the runtime's actual operand). OFF = no new GET fields, no writer branch, no new Settings rows (byte-identical ENC-1b predecessor).", true),
|
|
71
71
|
boolDirect("MEGACOMPACT_COSINE_FP_BENCH", "COS-FP-A Synthetic FP Bench", "Synthetic FP harness + L2 cosine threshold calibration (COS-FP-A): drives the deterministic synthetic-corpus grid sweep (scripts/cosine-fp/bench.mjs) that measures L2 cosine false-positive rates and emits a recommended default, and serves the reader-only GET /api/cosine-fp-report. Synthetic-corpus-only — never reads real session/ledger bytes. OFF = bench inert, endpoint 404s, no report write, L2_COSINE plain MEGACOMPACT_L2_THRESHOLD (byte-identical predecessor).", true),
|
|
72
|
+
boolDirect("MEGACOMPACT_COSINE_FP_REAL", "COS-FP-R Real-Corpus Validation", "Real-corpus L2 cosine FP validation (COS-FP-R): runs the real-corpus grid sweep (scripts/cosine-fp/real-bench.mjs) against donated, consent-approved sessions only (SECURITY_PRIVACY Lifecycle/Consent), scoring FP/FN with Wilson intervals + session-grouped bootstrap, and appends CI-backed per-content-type recommendations to the cosine-threshold report. Runs only when a valid consented corpus exists; absent corpus = no_corpus (normative pre-donation state, nothing written). OFF = script inert, nothing executes, no writes (byte-identical predecessor).", true),
|
|
73
|
+
boolDirect("MEGACOMPACT_REPO_CORPUS", "Cross-Repo Corpus (REPO-A)", "Cross-repo corpus preparation (REPO-A): the governed, consent-gated reader-only path that builds a pseudonymous corpus manifest from per-repo events.log slices and serves GET /api/repo-corpus answering which pseudonymous repos/sessions are in the corpus, what cross-repo overlap exists, and whether consent is active for each — counts + IDs + status only, never payload content. Consent is append-only (consent.mjs, CLI/ops-only); revocation freezes the builder + route. OFF = builder refuses to run, reader route 404s, single-repo recall untouched (byte-identical predecessor).", true),
|
|
72
74
|
],
|
|
73
75
|
};
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dashboard-server/routes-repo-corpus.ts — REPO-A cross-repo corpus status route.
|
|
3
|
+
*
|
|
4
|
+
* GET /api/repo-corpus — reader-only aggregate answering "which pseudonymous
|
|
5
|
+
* repos/sessions are in the consented corpus, what cross-repo overlap exists,
|
|
6
|
+
* and is consent active for each". Reads the corpus manifest + consent-state the
|
|
7
|
+
* CLI corpus-builder (scripts/repo-corpus/build.mjs) produced into the resolved
|
|
8
|
+
* corpus dir, memoized by {mtime,size} key with a 5s TTL (mirrors
|
|
9
|
+
* routes-cosine-fp.ts). Serves counts + IDs + status only — never payload
|
|
10
|
+
* content (EVAL-REDACT-002).
|
|
11
|
+
*
|
|
12
|
+
* IMPORTANT (distribution): this route does NOT import the builder scripts
|
|
13
|
+
* (scripts/ is excluded from package.json `files`). It reads the manifest files
|
|
14
|
+
* the builder wrote; the corpus dir is resolved from MEGACOMPACT_REPO_CORPUS_DIR
|
|
15
|
+
* (operator/test seam) or a bundled asset dir. The contract types ship in
|
|
16
|
+
* api-contracts/repo-corpus.ts.
|
|
17
|
+
*
|
|
18
|
+
* Flag-off (MEGACOMPACT_REPO_CORPUS=0) returns 404 — byte-identical
|
|
19
|
+
* predecessor. Absent corpus → awaiting_data (never a fabricated zero row).
|
|
20
|
+
*
|
|
21
|
+
* Guardrails: PREVENT-PI-004 (local filesystem read only), PREVENT-001
|
|
22
|
+
* (JSON.parse guarded), PREVENT-011 (no `any`).
|
|
23
|
+
*/
|
|
24
|
+
import { readFileSync, statSync } from "node:fs";
|
|
25
|
+
import { join, dirname } from "node:path";
|
|
26
|
+
import { fileURLToPath } from "node:url";
|
|
27
|
+
import { sendJson } from "./routes-vector-cortex-shared.js";
|
|
28
|
+
import { REPO_CORPUS_ENABLED } from "../../src/config.js";
|
|
29
|
+
import { deriveVcStatus } from "./vc-status.js";
|
|
30
|
+
const MEMO_TTL_MS = 5000; // ≤5s per file state
|
|
31
|
+
const MANIFEST_FILENAME = "manifest.json";
|
|
32
|
+
const CONSENT_STATE_FILENAME = "consent-state.json";
|
|
33
|
+
let memo = null;
|
|
34
|
+
/**
|
|
35
|
+
* Resolve the directory containing the corpus manifest + consent-state.
|
|
36
|
+
* 1. MEGACOMPACT_REPO_CORPUS_DIR (operator/test seam) — the canonical runtime
|
|
37
|
+
* location where an operator ran the builder (or a test points a temp dir).
|
|
38
|
+
* 2. Bundled asset extension/dashboard-server/assets/ — the shipped location,
|
|
39
|
+
* so a pre-built corpus can be shipped in the tarball (PREVENT-DIST-001);
|
|
40
|
+
* tsc does not copy .json into dist, so probe co-located + repo-root.
|
|
41
|
+
* 3. Git-checkout well-known dir for dev use (scripts/repo-corpus/corpus-run/).
|
|
42
|
+
* Returns null when unresolvable — caller serves awaiting_data.
|
|
43
|
+
*/
|
|
44
|
+
export function repoCorpusDir() {
|
|
45
|
+
const override = process.env.MEGACOMPACT_REPO_CORPUS_DIR;
|
|
46
|
+
if (override)
|
|
47
|
+
return override;
|
|
48
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
49
|
+
const bundledCandidates = [
|
|
50
|
+
join(here, "assets"),
|
|
51
|
+
join(here, "..", "..", "..", "extensions", "dashboard-server", "assets"),
|
|
52
|
+
];
|
|
53
|
+
for (const bundled of bundledCandidates) {
|
|
54
|
+
try {
|
|
55
|
+
// guardrails-allow PREVENT-PI-004: local bundled manifest stat (loopback)
|
|
56
|
+
statSync(join(bundled, MANIFEST_FILENAME));
|
|
57
|
+
return bundled;
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
/* try next candidate, then fall through to git-checkout walk */
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// Git-checkout corpus dir — dev path only.
|
|
64
|
+
let dir = here;
|
|
65
|
+
const rel = join("scripts", "repo-corpus", "corpus-run");
|
|
66
|
+
for (let i = 0; i < 8; i++) {
|
|
67
|
+
const candidate = join(dir, rel);
|
|
68
|
+
try {
|
|
69
|
+
// guardrails-allow PREVENT-PI-004: local corpus-run dir stat (loopback)
|
|
70
|
+
statSync(candidate);
|
|
71
|
+
return candidate;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
/* keep walking */
|
|
75
|
+
}
|
|
76
|
+
const next = dirname(dir);
|
|
77
|
+
if (next === dir)
|
|
78
|
+
break;
|
|
79
|
+
dir = next;
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
/** Guarded JSON file read → parsed value or null (PREVENT-001, PREVENT-011). */
|
|
84
|
+
function readJsonFile(p) {
|
|
85
|
+
let raw;
|
|
86
|
+
try {
|
|
87
|
+
raw = readFileSync(p, "utf8"); // guardrails-allow PREVENT-PI-004: local corpus file read (loopback)
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
let parsed;
|
|
93
|
+
try {
|
|
94
|
+
parsed = JSON.parse(raw);
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
100
|
+
return null;
|
|
101
|
+
return parsed;
|
|
102
|
+
}
|
|
103
|
+
function isRecord(v) {
|
|
104
|
+
return !!v && typeof v === "object" && !Array.isArray(v);
|
|
105
|
+
}
|
|
106
|
+
/** Project a raw consent-state file (structurally guarded, PREVENT-011). */
|
|
107
|
+
function readConsentState(corpusDir) {
|
|
108
|
+
const raw = readJsonFile(join(corpusDir, CONSENT_STATE_FILENAME));
|
|
109
|
+
if (!isRecord(raw))
|
|
110
|
+
return null;
|
|
111
|
+
const perRepo = Array.isArray(raw.perRepo) ? raw.perRepo : [];
|
|
112
|
+
const rows = perRepo
|
|
113
|
+
.filter(isRecord)
|
|
114
|
+
.map((r) => ({
|
|
115
|
+
repoPseudonym: typeof r.repoPseudonym === "string" ? r.repoPseudonym : "",
|
|
116
|
+
consentedCrossRepo: r.consentedCrossRepo === true || r.consentedCrossRepo === "true",
|
|
117
|
+
revokedAt: typeof r.revokedAt === "string" ? r.revokedAt : undefined,
|
|
118
|
+
}))
|
|
119
|
+
.filter((r) => r.repoPseudonym.length > 0);
|
|
120
|
+
return { schema: "repo-corpus-consent-state-v1", perRepo: rows };
|
|
121
|
+
}
|
|
122
|
+
/** Project a raw manifest file (structurally guarded, PREVENT-011). */
|
|
123
|
+
function readManifest(corpusDir) {
|
|
124
|
+
const raw = readJsonFile(join(corpusDir, MANIFEST_FILENAME));
|
|
125
|
+
if (!isRecord(raw))
|
|
126
|
+
return null;
|
|
127
|
+
if (raw.schema !== "repo-corpus-manifest-v1")
|
|
128
|
+
return null;
|
|
129
|
+
const repos = Array.isArray(raw.repos)
|
|
130
|
+
? raw.repos
|
|
131
|
+
.filter(isRecord)
|
|
132
|
+
.map((r) => ({
|
|
133
|
+
repoPseudonym: typeof r.repoPseudonym === "string" ? r.repoPseudonym : "",
|
|
134
|
+
sessions: typeof r.sessions === "number" ? r.sessions : 0,
|
|
135
|
+
sessionIds: Array.isArray(r.sessionIds)
|
|
136
|
+
? r.sessionIds.filter((x) => typeof x === "string")
|
|
137
|
+
: [],
|
|
138
|
+
events: typeof r.events === "number" ? r.events : 0,
|
|
139
|
+
digest: typeof r.digest === "string" ? r.digest : "",
|
|
140
|
+
}))
|
|
141
|
+
.filter((r) => r.repoPseudonym.length > 0)
|
|
142
|
+
: [];
|
|
143
|
+
const overlaps = Array.isArray(raw.overlaps)
|
|
144
|
+
? raw.overlaps
|
|
145
|
+
.filter(isRecord)
|
|
146
|
+
.map((o) => ({
|
|
147
|
+
repoA: typeof o.repoA === "string" ? o.repoA : "",
|
|
148
|
+
repoB: typeof o.repoB === "string" ? o.repoB : "",
|
|
149
|
+
sharedSessions: typeof o.sharedSessions === "number" ? o.sharedSessions : 0,
|
|
150
|
+
sharedIds: Array.isArray(o.sharedIds)
|
|
151
|
+
? o.sharedIds.filter((x) => typeof x === "string")
|
|
152
|
+
: [],
|
|
153
|
+
}))
|
|
154
|
+
.filter((o) => o.repoA.length > 0 && o.repoB.length > 0)
|
|
155
|
+
: [];
|
|
156
|
+
return {
|
|
157
|
+
schema: "repo-corpus-manifest-v1",
|
|
158
|
+
ownerPseudonym: typeof raw.ownerPseudonym === "string" ? raw.ownerPseudonym : "",
|
|
159
|
+
datasetVersion: typeof raw.datasetVersion === "string" ? raw.datasetVersion : "",
|
|
160
|
+
effectiveSeq: typeof raw.effectiveSeq === "number" ? raw.effectiveSeq : 0,
|
|
161
|
+
totalEvents: typeof raw.totalEvents === "number" ? raw.totalEvents : 0,
|
|
162
|
+
repos,
|
|
163
|
+
overlaps,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Build the perRepo status rows. A repo whose consent cannot be confirmed
|
|
168
|
+
* (missing from consent-state, or missing stateDir at the builder) degrades to
|
|
169
|
+
* consentedCrossRepo:false — never a crash, never a silent inclusion.
|
|
170
|
+
*/
|
|
171
|
+
function buildPerRepo(manifest, consent) {
|
|
172
|
+
const consentByRepo = new Map();
|
|
173
|
+
if (consent) {
|
|
174
|
+
for (const row of consent.perRepo)
|
|
175
|
+
consentByRepo.set(row.repoPseudonym, row);
|
|
176
|
+
}
|
|
177
|
+
return manifest.repos.map((r) => {
|
|
178
|
+
const c = consentByRepo.get(r.repoPseudonym);
|
|
179
|
+
return {
|
|
180
|
+
repoPseudonym: r.repoPseudonym,
|
|
181
|
+
sessions: r.sessions,
|
|
182
|
+
consentedCrossRepo: c ? c.consentedCrossRepo : false,
|
|
183
|
+
revokedAt: c && c.revokedAt ? c.revokedAt : undefined,
|
|
184
|
+
};
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
function buildBody(corpusDir, manifest) {
|
|
188
|
+
const consent = readConsentState(corpusDir);
|
|
189
|
+
const perRepo = buildPerRepo(manifest, consent);
|
|
190
|
+
const hasData = manifest.repos.length > 0;
|
|
191
|
+
const status = deriveVcStatus({ enabled: true, hasData, structuralOnly: false });
|
|
192
|
+
return {
|
|
193
|
+
schema: "repo-corpus-status-v1",
|
|
194
|
+
corpus: manifest,
|
|
195
|
+
perRepo,
|
|
196
|
+
totalEvents: manifest.totalEvents,
|
|
197
|
+
status,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
function awaitingDataBody() {
|
|
201
|
+
const status = deriveVcStatus({
|
|
202
|
+
enabled: true,
|
|
203
|
+
hasData: false,
|
|
204
|
+
structuralOnly: false,
|
|
205
|
+
});
|
|
206
|
+
return {
|
|
207
|
+
schema: "repo-corpus-status-v1",
|
|
208
|
+
corpus: null,
|
|
209
|
+
perRepo: [],
|
|
210
|
+
totalEvents: 0,
|
|
211
|
+
status,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
export function handleRepoCorpus(req, res, _ctx) {
|
|
215
|
+
const url = req.url ?? "";
|
|
216
|
+
if (url !== "/api/repo-corpus")
|
|
217
|
+
return false;
|
|
218
|
+
if (req.method !== "GET") {
|
|
219
|
+
sendJson(res, 405, { error: "method_not_allowed" });
|
|
220
|
+
return true;
|
|
221
|
+
}
|
|
222
|
+
if (!REPO_CORPUS_ENABLED()) {
|
|
223
|
+
// Flag-off: 404 — byte-identical predecessor.
|
|
224
|
+
sendJson(res, 404, { error: "not_found" });
|
|
225
|
+
return true;
|
|
226
|
+
}
|
|
227
|
+
const corpusDir = repoCorpusDir();
|
|
228
|
+
if (corpusDir === null) {
|
|
229
|
+
sendJson(res, 200, awaitingDataBody());
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
// Memoized-facts pattern: serve a still-fresh entry keyed on {mtime,size}.
|
|
233
|
+
let size = 0;
|
|
234
|
+
let mtime = 0;
|
|
235
|
+
try {
|
|
236
|
+
const s = statSync(join(corpusDir, MANIFEST_FILENAME)); // guardrails-allow PREVENT-PI-004: local stat (loopback)
|
|
237
|
+
size = s.size;
|
|
238
|
+
mtime = s.mtimeMs;
|
|
239
|
+
}
|
|
240
|
+
catch {
|
|
241
|
+
// no manifest on disk yet
|
|
242
|
+
}
|
|
243
|
+
if (size === 0 && mtime === 0) {
|
|
244
|
+
sendJson(res, 200, awaitingDataBody());
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
const key = `${mtime}:${size}`;
|
|
248
|
+
const now = Date.now();
|
|
249
|
+
if (memo !== null && memo.key === key && now - memo.at <= MEMO_TTL_MS) {
|
|
250
|
+
sendJson(res, 200, memo.body);
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
const manifest = readManifest(corpusDir);
|
|
254
|
+
const body = manifest === null ? awaitingDataBody() : buildBody(corpusDir, manifest);
|
|
255
|
+
memo = { key, at: now, body };
|
|
256
|
+
sendJson(res, 200, body);
|
|
257
|
+
return true;
|
|
258
|
+
}
|
|
@@ -30,3 +30,4 @@ export { handleSetupCortexAction, handleSetupCortexActionLog, } from "./routes-s
|
|
|
30
30
|
export { handleImproveCortex, handleImproveCortexStatus, } from "./routes-cortex-improve.js";
|
|
31
31
|
export { handleDedupTierAttribution } from "./routes-dedup-attribution.js";
|
|
32
32
|
export { handleCosineFpReport } from "./routes-cosine-fp.js";
|
|
33
|
+
export { handleRepoCorpus } from "./routes-repo-corpus.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* config/repo-corpus.ts — REPO-A cross-repo corpus preparation sprint flag.
|
|
3
|
+
*
|
|
4
|
+
* Positive sprint flag sibling (mirrors config/vector-cortex-cosfp.ts), NOT under
|
|
5
|
+
* a vector-cortex- prefix per the REPO-A spec: the reader route + corpus-builder
|
|
6
|
+
* gate on this flag. Root src/config.ts re-exports it so every existing import
|
|
7
|
+
* keeps resolving unchanged. Pi-agnostic, dependency-free (PREVENT-PI-004 /
|
|
8
|
+
* PREVENT-011).
|
|
9
|
+
*/
|
|
10
|
+
import { sprintFlag } from "./vector-cortex-flag.js";
|
|
11
|
+
/**
|
|
12
|
+
* REPO-A — cross-repo corpus preparation. Default ON.
|
|
13
|
+
* `MEGACOMPACT_REPO_CORPUS=0` disables and is byte-identical to the predecessor:
|
|
14
|
+
* the reader route GET /api/repo-corpus 404s (no derived artifact written), the
|
|
15
|
+
* corpus-builder refuses to run, and the existing single-repo recall path is
|
|
16
|
+
* untouched. This flag MUST also be a dashboard SETTINGS toggle (visible in the
|
|
17
|
+
* config UI, never in EXCLUDED_SETTINGS). The builder + route perform only local
|
|
18
|
+
* filesystem reads / local `git` introspection (PREVENT-PI-004).
|
|
19
|
+
*/
|
|
20
|
+
export const REPO_CORPUS_ENABLED = () => sprintFlag("MEGACOMPACT_REPO_CORPUS");
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* config/vector-cortex-cosfp-real.ts — COS-FP-R real-corpus FP validation flag.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from vector-cortex.ts so that barrel stays under the 300-line soft
|
|
5
|
+
* limit (soft-as-hard gate), exactly as vector-cortex-cosfp.ts and the other
|
|
6
|
+
* per-sprint flag siblings were. Gating the real-corpus L2 cosine false-positive
|
|
7
|
+
* validation: the `scripts/cosine-fp/real-bench.mjs` execution harness that runs
|
|
8
|
+
* only when a consented donated corpus exists, the execution-time report rows,
|
|
9
|
+
* and the evidence record. A pure-local, consent-gated tool (SECURITY_PRIVACY
|
|
10
|
+
* §Lifecycle/§Consent + EVAL-REDACT-002) — it never reads real session/ledger
|
|
11
|
+
* bytes without an explicit per-session consent record.
|
|
12
|
+
*
|
|
13
|
+
* The split is mechanical: COSINE_FP_REAL_ENABLED is byte-identical in name,
|
|
14
|
+
* semantics, and default to the sibling flag convention (positive, default ON),
|
|
15
|
+
* and vector-cortex.ts re-exports it so every existing
|
|
16
|
+
* `from "./config/vector-cortex.js"` import keeps resolving unchanged.
|
|
17
|
+
*
|
|
18
|
+
* Pi-agnostic, dependency-free (PREVENT-PI-004 / PREVENT-011).
|
|
19
|
+
*/
|
|
20
|
+
import { sprintFlag } from "./vector-cortex-flag.js";
|
|
21
|
+
/**
|
|
22
|
+
* COS-FP-R — real-corpus L2 cosine FP validation against donated sessions.
|
|
23
|
+
* Default ON. `MEGACOMPACT_COSINE_FP_REAL=0` disables and is byte-identical to
|
|
24
|
+
* the predecessor: `scripts/cosine-fp/real-bench.mjs` is inert (nothing
|
|
25
|
+
* executes, no writes), no real-corpus report rows or evidence are written, and
|
|
26
|
+
* no threshold is adopted. When ON (default), execution still only proceeds when
|
|
27
|
+
* a valid consented corpus exists under `scripts/cosine-fp/corpus/` — absent
|
|
28
|
+
* corpus is the normative `no_corpus` pre-donation state, not a failure. Corpus
|
|
29
|
+
* bytes are read only for sessions with an explicit, append-only, revocable
|
|
30
|
+
* consent record (SECURITY_PRIVACY §Lifecycle/§Consent). This flag MUST also be
|
|
31
|
+
* a dashboard SETTINGS toggle (visible in config UI, never in EXCLUDED_SETTINGS).
|
|
32
|
+
* The harness performs only local filesystem reads (PREVENT-PI-004).
|
|
33
|
+
*/
|
|
34
|
+
export const COSINE_FP_REAL_ENABLED = () => sprintFlag("MEGACOMPACT_COSINE_FP_REAL");
|
|
@@ -34,6 +34,11 @@ export { ENC_0F_ENABLED } from "./vector-cortex-enc0f.js";
|
|
|
34
34
|
export { ENC_0G_ENABLED } from "./vector-cortex-enc0g.js";
|
|
35
35
|
// COS-FP-A synthetic FP harness flag extracted to vector-cortex-cosfp.ts.
|
|
36
36
|
export { COSINE_FP_BENCH_ENABLED } from "./vector-cortex-cosfp.js";
|
|
37
|
+
// COS-FP-R real-corpus FP validation flag extracted to vector-cortex-cosfp-real.ts.
|
|
38
|
+
export { COSINE_FP_REAL_ENABLED } from "./vector-cortex-cosfp-real.js";
|
|
39
|
+
// REPO-A cross-repo corpus prep flag extracted to repo-corpus.ts (no vector-cortex
|
|
40
|
+
// prefix per spec); re-exported so root src/config.ts barrel resolves unchanged.
|
|
41
|
+
export { REPO_CORPUS_ENABLED } from "./repo-corpus.js";
|
|
37
42
|
export { ENC_1A_ENABLED } from "./vector-cortex-enc1a.js";
|
|
38
43
|
export { ENC_1B_ENABLED, ENC_1B_MAX_EMBEDDING_DIM, ENC_1B_EMBEDDING_DIM_ENV, ENC_1B_EMBEDDING_HEADERS_ENV, ENC_1B_ALLOW_REMOTE_EMBEDDER_ENV, ENC_1B_ENCODER_NATIVE_ENV, } from "./vector-cortex-enc1b.js";
|
|
39
44
|
export { ENC_2BUDGET_ENABLED, ENC_2BUDGET_NATIVE_ORT_BUDGET_ENV, ENC_2BUDGET_MAX_MIB, ENC_2BUDGET_DEFAULT_MIB, } from "./vector-cortex-enc2budget.js";
|
package/dist/src/config.js
CHANGED
|
@@ -114,4 +114,4 @@ export const NEW_UI = () => ragEnabled("MEGACOMPACT_NEW_UI");
|
|
|
114
114
|
// default ON, `=0`/`_DISABLED` off. Re-exported from src/config/vector-cortex.ts
|
|
115
115
|
// so root consumers share one source of truth.
|
|
116
116
|
// ---------------------------------------------------------------------------
|
|
117
|
-
export { VC0A_ENABLED, VC0B_ENABLED, VC1A_ENABLED, VC0C_ENABLED, VC1B_ENABLED, VC1C_ENABLED, VC2A_ENABLED, VC2B_ENABLED, VC2C_ENABLED, VC3A_ENABLED, VC3B_ENABLED, VC3C_ENABLED, VC4A_ENABLED, VC4B_ENABLED, VC4C_ENABLED, VC5A_ENABLED, VC5B_ENABLED, VC5C_ENABLED, VC6A_ENABLED, VC6B_ENABLED, VC6C_ENABLED, VC7A_ENABLED, VC7B_ENABLED, VC7C_ENABLED, VC8A_ENABLED, VC8B_ENABLED, VC8C_ENABLED, VC9A_ENABLED, VC9B_ENABLED, VC9C_ENABLED, VC9D_ENABLED, PCC_ENABLED, ML5A_ENABLED, ML5B_ENABLED, ML5C_ENABLED, ML5D_ENABLED, ML5E_ENABLED, DEDUP_ATTR_ENABLED, ENC_0A_ENABLED, ENC_0B_ENABLED, ENC_0C_ENABLED, ENC_0D_ENABLED, ENC_0E_ENABLED, ENC_0F_ENABLED, ENC_0G_ENABLED, ENC_1A_ENABLED, ENC_1B_ENABLED, ENC_2BUDGET_ENABLED, ENC_2BUDGET_NATIVE_ORT_BUDGET_ENV, ENC_2BUDGET_MAX_MIB, ENC_2BUDGET_DEFAULT_MIB, COSINE_FP_BENCH_ENABLED, BREAKER_WINDOW_MS, BREAKER_MIN_ATTEMPTS, BREAKER_PERF_FAILURES, BREAKER_PERF_FAILURE_RATE, BREAKER_CORRECTNESS_FAILURES, BREAKER_COOLDOWN_MS, BREAKER_PROBE_COUNT, BREAKER_RETRY_BASE_MS, BREAKER_RETRY_CAP_MS, BREAKER_RETRY_JITTER, BREAKER_HYSTERESIS_FAILURE_RATE, BREAKER_HYSTERESIS_BUDGET_P95_MS, BREAKER_MIN_HEALTHY_RESIDENCE_MS, } from "./config/vector-cortex.js";
|
|
117
|
+
export { VC0A_ENABLED, VC0B_ENABLED, VC1A_ENABLED, VC0C_ENABLED, VC1B_ENABLED, VC1C_ENABLED, VC2A_ENABLED, VC2B_ENABLED, VC2C_ENABLED, VC3A_ENABLED, VC3B_ENABLED, VC3C_ENABLED, VC4A_ENABLED, VC4B_ENABLED, VC4C_ENABLED, VC5A_ENABLED, VC5B_ENABLED, VC5C_ENABLED, VC6A_ENABLED, VC6B_ENABLED, VC6C_ENABLED, VC7A_ENABLED, VC7B_ENABLED, VC7C_ENABLED, VC8A_ENABLED, VC8B_ENABLED, VC8C_ENABLED, VC9A_ENABLED, VC9B_ENABLED, VC9C_ENABLED, VC9D_ENABLED, PCC_ENABLED, ML5A_ENABLED, ML5B_ENABLED, ML5C_ENABLED, ML5D_ENABLED, ML5E_ENABLED, DEDUP_ATTR_ENABLED, ENC_0A_ENABLED, ENC_0B_ENABLED, ENC_0C_ENABLED, ENC_0D_ENABLED, ENC_0E_ENABLED, ENC_0F_ENABLED, ENC_0G_ENABLED, ENC_1A_ENABLED, ENC_1B_ENABLED, ENC_2BUDGET_ENABLED, ENC_2BUDGET_NATIVE_ORT_BUDGET_ENV, ENC_2BUDGET_MAX_MIB, ENC_2BUDGET_DEFAULT_MIB, COSINE_FP_BENCH_ENABLED, COSINE_FP_REAL_ENABLED, REPO_CORPUS_ENABLED, BREAKER_WINDOW_MS, BREAKER_MIN_ATTEMPTS, BREAKER_PERF_FAILURES, BREAKER_PERF_FAILURE_RATE, BREAKER_CORRECTNESS_FAILURES, BREAKER_COOLDOWN_MS, BREAKER_PROBE_COUNT, BREAKER_RETRY_BASE_MS, BREAKER_RETRY_CAP_MS, BREAKER_RETRY_JITTER, BREAKER_HYSTERESIS_FAILURE_RATE, BREAKER_HYSTERESIS_BUDGET_P95_MS, BREAKER_MIN_HEALTHY_RESIDENCE_MS, } from "./config/vector-cortex.js";
|
package/extensions/dashboard-client/dist/assets/{AreaChart-DlndN0p2.js → AreaChart-CtJ6dSMT.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-D1HV4d79.js";import{R as p,E as ee,r as ve}from"./index-Bi5YNsLx.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-DRlqBks2.js";import{R as p,E as ee,r as ve}from"./index-CkbdlPBm.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-CtJ6dSMT.js.map
|