fix: correcciones a PR#50 — validación schemas, credenciales, zero-variance, renombrado MASSIVE completo#51
Conversation
…ia, zero-variance short-circuit, BeyondSight→MASSIVE completo
…nce fix, empirical_calibration imports MASSIVE_*
… renaming, update agent.md
…d remaining doc files
There was a problem hiding this comment.
4 issues found across 18 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="llm_credentials.py">
<violation number="1" location="llm_credentials.py:47">
P1: `persist_provider_api_key` still mutates `os.environ`, which contradicts the intended in-memory-only credential handling and can leak/overwrite process-level secrets.</violation>
</file>
<file name="docs/validation/PVU_MASSIVE_EN.md">
<violation number="1" location="docs/validation/PVU_MASSIVE_EN.md:90">
P2: `MAE_BS` is a leftover from the old BeyondSight naming. Should be `MAE_MASSIVE` to match the document's own convention (sections 4.1, 4.2 all refer to 'MASSIVE').</violation>
<violation number="2" location="docs/validation/PVU_MASSIVE_EN.md:92">
P2: `BS dir. acc.` is a leftover from the old BeyondSight naming. Should be `MASSIVE dir. acc.` to match the document's naming convention.</violation>
</file>
<file name="docs/validation/PVU_MASSIVE_ES.md">
<violation number="1" location="docs/validation/PVU_MASSIVE_ES.md:90">
P2: Leftover "BS" (BeyondSight) references in section 4.3 metric names: `MAE_BS` and `Dir. acc. BS` should be `MAE_MASSIVE` and `Dir. acc. MASSIVE` to complete the rename that this PR set out to finish.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| # Mirror to env for subprocess visibility (controlled, optional) | ||
| env_name = PROVIDER_ENV_KEYS.get(proveedor, "") | ||
| if env_name: | ||
| os.environ[env_name] = key |
There was a problem hiding this comment.
P1: persist_provider_api_key still mutates os.environ, which contradicts the intended in-memory-only credential handling and can leak/overwrite process-level secrets.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At llm_credentials.py, line 47:
<comment>`persist_provider_api_key` still mutates `os.environ`, which contradicts the intended in-memory-only credential handling and can leak/overwrite process-level secrets.</comment>
<file context>
@@ -10,26 +10,38 @@
+ # Mirror to env for subprocess visibility (controlled, optional)
+ env_name = PROVIDER_ENV_KEYS.get(proveedor, "")
+ if env_name:
+ os.environ[env_name] = key
</file context>
| |--------|---------------| | ||
| | ΔMAE = MAE_baseline − MAE_BS | Absolute improvement in MAE | | ||
| | ΔRMSE | Absolute improvement in RMSE | | ||
| | Directional accuracy lift | BS dir. acc. − naive dir. acc. | |
There was a problem hiding this comment.
P2: BS dir. acc. is a leftover from the old BeyondSight naming. Should be MASSIVE dir. acc. to match the document's naming convention.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/validation/PVU_MASSIVE_EN.md, line 92:
<comment>`BS dir. acc.` is a leftover from the old BeyondSight naming. Should be `MASSIVE dir. acc.` to match the document's naming convention.</comment>
<file context>
@@ -0,0 +1,212 @@
+|--------|---------------|
+| ΔMAE = MAE_baseline − MAE_BS | Absolute improvement in MAE |
+| ΔRMSE | Absolute improvement in RMSE |
+| Directional accuracy lift | BS dir. acc. − naive dir. acc. |
+| TPS F1 | Precision–Recall balance on turning points |
+
</file context>
|
|
||
| | Metric | Interpretation | | ||
| |--------|---------------| | ||
| | ΔMAE = MAE_baseline − MAE_BS | Absolute improvement in MAE | |
There was a problem hiding this comment.
P2: MAE_BS is a leftover from the old BeyondSight naming. Should be MAE_MASSIVE to match the document's own convention (sections 4.1, 4.2 all refer to 'MASSIVE').
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/validation/PVU_MASSIVE_EN.md, line 90:
<comment>`MAE_BS` is a leftover from the old BeyondSight naming. Should be `MAE_MASSIVE` to match the document's own convention (sections 4.1, 4.2 all refer to 'MASSIVE').</comment>
<file context>
@@ -0,0 +1,212 @@
+
+| Metric | Interpretation |
+|--------|---------------|
+| ΔMAE = MAE_baseline − MAE_BS | Absolute improvement in MAE |
+| ΔRMSE | Absolute improvement in RMSE |
+| Directional accuracy lift | BS dir. acc. − naive dir. acc. |
</file context>
|
|
||
| | Métrica | Interpretación | | ||
| |---------|---------------| | ||
| | ΔMAE = MAE_baseline − MAE_BS | Mejora absoluta en MAE | |
There was a problem hiding this comment.
P2: Leftover "BS" (BeyondSight) references in section 4.3 metric names: MAE_BS and Dir. acc. BS should be MAE_MASSIVE and Dir. acc. MASSIVE to complete the rename that this PR set out to finish.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/validation/PVU_MASSIVE_ES.md, line 90:
<comment>Leftover "BS" (BeyondSight) references in section 4.3 metric names: `MAE_BS` and `Dir. acc. BS` should be `MAE_MASSIVE` and `Dir. acc. MASSIVE` to complete the rename that this PR set out to finish.</comment>
<file context>
@@ -0,0 +1,212 @@
+
+| Métrica | Interpretación |
+|---------|---------------|
+| ΔMAE = MAE_baseline − MAE_BS | Mejora absoluta en MAE |
+| ΔRMSE | Mejora absoluta en RMSE |
+| Lift de exactitud direccional | Dir. acc. BS − dir. acc. naive |
</file context>
Correcciones a los bugs reportados por cubic-dev-ai en PR #50
Esta PR aplica todas las correcciones a los issues reportados por el revisor automático cubic-dev-ai, más el renombrado completo BeyondSight → MASSIVE que quedó incompleto.
🔧 Correcciones de código (5 bugs P2)
schemas.pystrategic_weightsin validación de rangoField(0.3, ge=0.0, le=1.0)schemas.pyIntervention.time_start <= time_endacepta reversed@model_validatorque enforce temporal orderingschemas.pymodel_nametipostrsin restriccionesLiteral[...]type con 13 nombres válidosllm_credentials.pyos.environmutation para credenciales_provider_keyscomo store primariostate_compression.pytotal_energy < 1e-12short-circuit con rank=0🔧 Naming canónico MASSIVE (constant pools)
Se invierte la relación de naming en
empirical_config.py:MASSIVE_EMPIRICAL_MASTERyMASSIVE_RUNTIME_PARAMSson ahora las variables canónicasBEYONDSIGHT_*queda como alias backward-compatibleempirical_calibration.py,simulator.py,forecast/engine.py,app.py,tests/) importanMASSIVE_*🔧 Renombrado BeyondSight → MASSIVE (docs y config)
.github/agents/my-agent.agent.md— nombre, descripción y homoglifos cirílicos corregidosCONTRIBUTING.md,README_ES.md,configs/multilayer.yaml,mkdocs.ymldocs/validation/README.md+ todas las plantillas +PVU_MASSIVE_EN/ES.md📦 Archivos nuevos (PVU renombrados)
docs/validation/PVU_MASSIVE_EN.md— copia del PVU con todo el contenido BeyondSight → MASSIVEdocs/validation/PVU_MASSIVE_ES.md— mismo📝 Nota sobre docs/architecture/
Los 16 documentos arquitectónicos mencionados en PR #50 (
docs/architecture/) y los issues sobremassive/core/micro/no existen en el branch actual. Quedan pendientes para cuando se complete la fusión del paquetemassive/core/.Validación
pytest tests/test_empirical_calibration.py✅pytest tests/test_empirical_integration.py✅MASSIVE_*resueltos correctamenteBEYONDSIGHT_*aún funciona como aliasSummary by cubic
Fixes schema and stability issues from PR #50, and makes MASSIVE naming canonical across code and docs. Credentials handling is safer and SVD handles zero-variance correctly; PVU docs added and tests updated.
Bug Fixes
schemas.py: enforcestrategic_weightin [0,1], validatetime_start <= time_end, and restrictmodel_nameto a fixed Literal set.llm_credentials.py: store API keys in-memory (noos.environmutation); optional env mirror for subprocesses.state_compression.py: short-circuit zero-variance matrices with rank=0 to avoid unstable decompositions.Refactors
MASSIVE_EMPIRICAL_MASTERandMASSIVE_RUNTIME_PARAMSare primary;BEYONDSIGHT_*kept as aliases. Updated imports inempirical_calibration.py,empirical_config.py, and tests.mkdocs.yml,docs/validation/*,.github/agents/my-agent.agent.md,configs/multilayer.yaml,CONTRIBUTING.md).Written for commit 9c1176f. Summary will update on new commits.