pi-mega-compact 0.20.46 → 0.20.48

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.
Files changed (89) hide show
  1. package/dist/config/vector-cortex-enc0e.js +40 -0
  2. package/dist/config/vector-cortex-enc0f.js +36 -0
  3. package/dist/config/vector-cortex-vc3to8.js +239 -0
  4. package/dist/config/vector-cortex.js +5 -227
  5. package/dist/config.js +1 -1
  6. package/dist/extensions/dashboard-server/routes-rag-settings-vector-cortex.js +2 -0
  7. package/dist/extensions/dashboard-server/routes-setup-cortex.js +30 -1
  8. package/dist/extensions/dashboard-server/setup-cortex-blockers.js +2 -1
  9. package/dist/src/config/vector-cortex-enc0e.js +40 -0
  10. package/dist/src/config/vector-cortex-enc0f.js +36 -0
  11. package/dist/src/config/vector-cortex-vc3to8.js +239 -0
  12. package/dist/src/config/vector-cortex.js +5 -227
  13. package/dist/src/config.js +1 -1
  14. package/dist/src/vector-cortex/encoder/decision.js +17 -0
  15. package/dist/src/vector-cortex/encoder/qualify.js +50 -0
  16. package/dist/src/vector-cortex/encoder/runtime-emit.js +8 -2
  17. package/dist/src/vector-cortex/encoder/runtime-select.js +35 -1
  18. package/dist/vector-cortex/encoder/decision.js +17 -0
  19. package/dist/vector-cortex/encoder/qualify.js +50 -0
  20. package/dist/vector-cortex/encoder/runtime-emit.js +8 -2
  21. package/dist/vector-cortex/encoder/runtime-select.js +35 -1
  22. package/extensions/dashboard-client/dist/assets/{AreaChart-Cn6X7epL.js → AreaChart-COnj8FHi.js} +2 -2
  23. package/extensions/dashboard-client/dist/assets/{AreaChart-Cn6X7epL.js.map → AreaChart-COnj8FHi.js.map} +1 -1
  24. package/extensions/dashboard-client/dist/assets/{BarChart-APy1Wc7z.js → BarChart-BYqt8c5-.js} +2 -2
  25. package/extensions/dashboard-client/dist/assets/{BarChart-APy1Wc7z.js.map → BarChart-BYqt8c5-.js.map} +1 -1
  26. package/extensions/dashboard-client/dist/assets/{CacheTab-CEv_Ss9O.js → CacheTab-PLRjMrZV.js} +2 -2
  27. package/extensions/dashboard-client/dist/assets/{CacheTab-CEv_Ss9O.js.map → CacheTab-PLRjMrZV.js.map} +1 -1
  28. package/extensions/dashboard-client/dist/assets/{EventsTab-8jV1Pr0C.js → EventsTab-DXKSft6w.js} +2 -2
  29. package/extensions/dashboard-client/dist/assets/{EventsTab-8jV1Pr0C.js.map → EventsTab-DXKSft6w.js.map} +1 -1
  30. package/extensions/dashboard-client/dist/assets/{HealthTab-B2VgEz1j.js → HealthTab-BgVIsrde.js} +2 -2
  31. package/extensions/dashboard-client/dist/assets/{HealthTab-B2VgEz1j.js.map → HealthTab-BgVIsrde.js.map} +1 -1
  32. package/extensions/dashboard-client/dist/assets/{MaintenanceTab-m37AlTbg.js → MaintenanceTab-DNgFC8KZ.js} +2 -2
  33. package/extensions/dashboard-client/dist/assets/{MaintenanceTab-m37AlTbg.js.map → MaintenanceTab-DNgFC8KZ.js.map} +1 -1
  34. package/extensions/dashboard-client/dist/assets/{MemoryMapTab-Co2jbqdT.js → MemoryMapTab-B6yY47sz.js} +2 -2
  35. package/extensions/dashboard-client/dist/assets/{MemoryMapTab-Co2jbqdT.js.map → MemoryMapTab-B6yY47sz.js.map} +1 -1
  36. package/extensions/dashboard-client/dist/assets/{MetricsTab-D0yV9X6D.js → MetricsTab-BrhJ6rkx.js} +2 -2
  37. package/extensions/dashboard-client/dist/assets/{MetricsTab-D0yV9X6D.js.map → MetricsTab-BrhJ6rkx.js.map} +1 -1
  38. package/extensions/dashboard-client/dist/assets/{OverviewTab-J5TjXB14.js → OverviewTab-RFHU9L4x.js} +2 -2
  39. package/extensions/dashboard-client/dist/assets/{OverviewTab-J5TjXB14.js.map → OverviewTab-RFHU9L4x.js.map} +1 -1
  40. package/extensions/dashboard-client/dist/assets/{ReposTab-BadNIkWu.js → ReposTab-UFIWKkJM.js} +2 -2
  41. package/extensions/dashboard-client/dist/assets/{ReposTab-BadNIkWu.js.map → ReposTab-UFIWKkJM.js.map} +1 -1
  42. package/extensions/dashboard-client/dist/assets/{SessionsTab-CdKShJuR.js → SessionsTab-BHFYsmK8.js} +2 -2
  43. package/extensions/dashboard-client/dist/assets/{SessionsTab-CdKShJuR.js.map → SessionsTab-BHFYsmK8.js.map} +1 -1
  44. package/extensions/dashboard-client/dist/assets/{SetupTab-CPemizDx.js → SetupTab-C3dnKa8y.js} +3 -3
  45. package/extensions/dashboard-client/dist/assets/{SetupTab-CPemizDx.js.map → SetupTab-C3dnKa8y.js.map} +1 -1
  46. package/extensions/dashboard-client/dist/assets/{TimeSavedCard-TvULibwW.js → TimeSavedCard-aPG5Knqn.js} +2 -2
  47. package/extensions/dashboard-client/dist/assets/{TimeSavedCard-TvULibwW.js.map → TimeSavedCard-aPG5Knqn.js.map} +1 -1
  48. package/extensions/dashboard-client/dist/assets/{TurnsTab-CglFIcYy.js → TurnsTab-fGm9n-Tk.js} +2 -2
  49. package/extensions/dashboard-client/dist/assets/{TurnsTab-CglFIcYy.js.map → TurnsTab-fGm9n-Tk.js.map} +1 -1
  50. package/extensions/dashboard-client/dist/assets/{VcStatusBadge-H2bBNhrR.js → VcStatusBadge-BtmSNH8X.js} +2 -2
  51. package/extensions/dashboard-client/dist/assets/{VcStatusBadge-H2bBNhrR.js.map → VcStatusBadge-BtmSNH8X.js.map} +1 -1
  52. package/extensions/dashboard-client/dist/assets/{VectorCortexTab-CXPv3sYQ.js → VectorCortexTab-meALMMOZ.js} +2 -2
  53. package/extensions/dashboard-client/dist/assets/{VectorCortexTab-CXPv3sYQ.js.map → VectorCortexTab-meALMMOZ.js.map} +1 -1
  54. package/extensions/dashboard-client/dist/assets/{WikiTab-BNfN175_.js → WikiTab-0TK6q6g1.js} +2 -2
  55. package/extensions/dashboard-client/dist/assets/{WikiTab-BNfN175_.js.map → WikiTab-0TK6q6g1.js.map} +1 -1
  56. package/extensions/dashboard-client/dist/assets/{button-DjN7aqD2.js → button-CKEnMZ98.js} +2 -2
  57. package/extensions/dashboard-client/dist/assets/{button-DjN7aqD2.js.map → button-CKEnMZ98.js.map} +1 -1
  58. package/extensions/dashboard-client/dist/assets/{card-DLHA5XP8.js → card-BVVhm3sL.js} +2 -2
  59. package/extensions/dashboard-client/dist/assets/{card-DLHA5XP8.js.map → card-BVVhm3sL.js.map} +1 -1
  60. package/extensions/dashboard-client/dist/assets/{client-extra-ZT6mIQZS.js → client-extra-BvGxKZpm.js} +2 -2
  61. package/extensions/dashboard-client/dist/assets/{client-extra-ZT6mIQZS.js.map → client-extra-BvGxKZpm.js.map} +1 -1
  62. package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-DAl4dRVG.js → generateCategoricalChart-B1PeCct1.js} +2 -2
  63. package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-DAl4dRVG.js.map → generateCategoricalChart-B1PeCct1.js.map} +1 -1
  64. package/extensions/dashboard-client/dist/assets/{index-H-sfROoW.js → index-DuThOA-d.js} +3 -3
  65. package/extensions/dashboard-client/dist/assets/{index-H-sfROoW.js.map → index-DuThOA-d.js.map} +1 -1
  66. package/extensions/dashboard-client/dist/assets/{switch-BCxvJYon.js → switch-7qLS7ajc.js} +2 -2
  67. package/extensions/dashboard-client/dist/assets/{switch-BCxvJYon.js.map → switch-7qLS7ajc.js.map} +1 -1
  68. package/extensions/dashboard-client/dist/assets/{toggle-DviUMYeg.js → toggle-D7mgOVxz.js} +2 -2
  69. package/extensions/dashboard-client/dist/assets/{toggle-DviUMYeg.js.map → toggle-D7mgOVxz.js.map} +1 -1
  70. package/extensions/dashboard-client/dist/assets/{useSSE-DP2O8vHY.js → useSSE-ChpyZVeX.js} +2 -2
  71. package/extensions/dashboard-client/dist/assets/{useSSE-DP2O8vHY.js.map → useSSE-ChpyZVeX.js.map} +1 -1
  72. package/extensions/dashboard-client/dist/index.html +1 -1
  73. package/extensions/dashboard-client/src/tabs/SetupTab/CortexBlockersCard.tsx +17 -1
  74. package/extensions/dashboard-client/src/tabs/SetupTab/CortexSetup.tsx +1 -0
  75. package/extensions/dashboard-client/src/types/setup-cortex.ts +10 -0
  76. package/extensions/dashboard-server/api-contracts/setup-cortex.ts +11 -0
  77. package/extensions/dashboard-server/routes-rag-settings-vector-cortex.ts +12 -0
  78. package/extensions/dashboard-server/routes-setup-cortex.ts +35 -1
  79. package/extensions/dashboard-server/setup-cortex-blockers.ts +2 -1
  80. package/package.json +1 -1
  81. package/src/config/vector-cortex-enc0e.ts +42 -0
  82. package/src/config/vector-cortex-enc0f.ts +38 -0
  83. package/src/config/vector-cortex-vc3to8.ts +256 -0
  84. package/src/config/vector-cortex.ts +23 -244
  85. package/src/config.ts +2 -0
  86. package/src/vector-cortex/encoder/decision.ts +28 -1
  87. package/src/vector-cortex/encoder/qualify.ts +83 -0
  88. package/src/vector-cortex/encoder/runtime-emit.ts +21 -4
  89. package/src/vector-cortex/encoder/runtime-select.ts +46 -1
@@ -0,0 +1,40 @@
1
+ /**
2
+ * config/vector-cortex-enc0e.ts — ENC-0e darwin-x64 explicit demotion reason.
3
+ *
4
+ * Extracted from vector-cortex.ts so that file stays under the 300-line soft
5
+ * limit (soft-as-hard gate), exactly as vector-cortex-enc0a.ts / enc0b.ts /
6
+ * enc0c.ts / enc0d.ts and the VC8C/VC9A-D/ML5A-E/DEDUP_ATTR siblings were.
7
+ * vector-cortex.ts re-exports the flag below and root src/config.ts re-exports
8
+ * it, so no consumer import path changes.
9
+ *
10
+ * ENC-0e closes HG-4's operator-visibility gap on macOS Intel (darwin-x64): the
11
+ * platform has no native binary upstream (arm64-only; a darwin-x64
12
+ * transform-class package ships only WASM), so the runtime demotes to mode-B
13
+ * WASM per HG-4. That demotion already exists in the ML5-C decision rule —
14
+ * ENC-0e makes it EXPLICIT by surfacing a deterministic demotion reason on the
15
+ * runtime-selection event and on the Setup Cortex blockers card, so an
16
+ * Intel-Mac operator sees exactly why mode A is unreachable.
17
+ *
18
+ * `MEGACOMPACT_ENC_0E=0` strips ONLY the reason surface: no demotionReason on
19
+ * the runtime-selection event, no Setup card row. The ML5-C demotion itself
20
+ * (mode-B/WASM on Intel Mac) remains the default and is NOT gated off — so the
21
+ * flag-off path is byte-identical to the predecessor. The flag MUST also be a
22
+ * dashboard SETTINGS toggle (visible, never in EXCLUDED_SETTINGS).
23
+ *
24
+ * The split is purely mechanical: ENC_0E_ENABLED follows ENC_0D_ENABLED in
25
+ * name, semantics, and default, and vector-cortex.ts re-exports it so every
26
+ * existing `from "./config/vector-cortex.js"` import keeps resolving unchanged.
27
+ *
28
+ * Pi-agnostic, dependency-free (PREVENT-PI-004 / PREVENT-011).
29
+ */
30
+ import { sprintFlag } from "./vector-cortex-flag.js";
31
+ /**
32
+ * ENC-0e — darwin-x64 explicit demotion reason. Default ON.
33
+ * `MEGACOMPACT_ENC_0E=0` disables and is byte-identical to the predecessor
34
+ * (ENC-0d): the runtime-selection event carries no demotionReason and the Setup
35
+ * Cortex blockers card renders no demotion-reason row. The ML5-C darwin-x64
36
+ * WASM demotion itself is NOT gated off — only the explicit reason surface is.
37
+ * This flag MUST also be a dashboard SETTINGS toggle (visible in config UI,
38
+ * never in EXCLUDED_SETTINGS), mirroring ENC_0A/ENC_0B/ENC_0C/ENC_0D.
39
+ */
40
+ export const ENC_0E_ENABLED = () => sprintFlag("MEGACOMPACT_ENC_0E");
@@ -0,0 +1,36 @@
1
+ /**
2
+ * config/vector-cortex-enc0f.ts — ENC-0f p95 + marginal-RSS qualification gate.
3
+ *
4
+ * Extracted from vector-cortex.ts so that file stays under the 300-line soft
5
+ * limit (soft-as-hard gate), exactly as vector-cortex-enc0a.ts / enc0b.ts /
6
+ * enc0c.ts / enc0d.ts / enc0e.ts and the VC8C/VC9A-D/ML5A-E/DEDUP_ATTR
7
+ * siblings were. vector-cortex.ts re-exports the flag below and root
8
+ * src/config.ts re-exports it, so no consumer import path changes.
9
+ *
10
+ * ENC-0f closes HG-5 (RSS margin) with a real asset: the qualification gate
11
+ * that admits the ENC-0d-promoted trained asset to mode A. The gate runs the
12
+ * ML5-B bench under --expose-gc and asserts p95 ≤ ENCODER_LATENCY_P95_MS
13
+ * (40 ms @ 512 tokens / 4 threads), marginal RSS ≤ ENCODER_RSS_BUDGET_BYTES
14
+ * (150 MiB, baseline-subtracted), determinism (distinct digests == 1), and
15
+ * the opset-21 handshake. On pass it emits a QualificationV1 record that flips
16
+ * the runtime to qualified mode A; on any failure the asset stays demoted.
17
+ *
18
+ * `MEGACOMPACT_ENC_0F=0` disables the gate entirely: no qualification gate
19
+ * runs, no QualificationV1 record is written for the real trained asset, and
20
+ * the runtime keeps serving the ENC-0d survivor. Flag-off is byte-identical to
21
+ * the predecessor. The flag MUST also be a dashboard SETTINGS toggle (visible
22
+ * in config UI, never in EXCLUDED_SETTINGS).
23
+ *
24
+ * Pi-agnostic, dependency-free (PREVENT-PI-004 / PREVENT-011).
25
+ */
26
+ import { sprintFlag } from "./vector-cortex-flag.js";
27
+ /**
28
+ * ENC-0f — p95 + marginal-RSS qualification gate for the real trained asset.
29
+ * Default ON. `MEGACOMPACT_ENC_0F=0` disables and is byte-identical to the
30
+ * predecessor (ENC-0e): no qualification gate runs, no QualificationV1 record
31
+ * is written for the real trained asset, and the runtime keeps serving the
32
+ * ENC-0d survivor. This flag MUST also be a dashboard SETTINGS toggle (visible
33
+ * in config UI, never in EXCLUDED_SETTINGS), mirroring
34
+ * ENC_0A/ENC_0B/ENC_0C/ENC_0D/ENC_0E.
35
+ */
36
+ export const ENC_0F_ENABLED = () => sprintFlag("MEGACOMPACT_ENC_0F");
@@ -0,0 +1,239 @@
1
+ /**
2
+ * config/vector-cortex-vc3to8.ts — VC3A..VC8B flag siblings (extracted).
3
+ *
4
+ * Mechanical extract from vector-cortex.ts so that barrel stays under the
5
+ * 300-line soft-as-hard cap (each sprint adds one re-export line; the VC3A..VC8B
6
+ * inline definitions were the bulk). Mirrors the vector-cortex-early.ts precedent
7
+ * (VC0A..VC2C extracted there) and the VC8C+/ML5/ENC sibling-extract pattern.
8
+ * vector-cortex.ts re-exports every flag below, so no consumer import path changes.
9
+ *
10
+ * Pi-agnostic, dependency-free (PREVENT-PI-004 / PREVENT-011). Default ON;
11
+ * `=0` byte-identical to the predecessor for every flag.
12
+ */
13
+ import { sprintFlag } from "./vector-cortex-flag.js";
14
+ /**
15
+ * VC3A — capability-gated cortex store (CortexReader/Writer/Admin, CortexRecordV1).
16
+ * Default ON. `MEGACOMPACT_VC3A=0` disables and is byte-identical to the
17
+ * predecessor (mode C: the derived cortex store is absent, mode B in-memory is
18
+ * not consulted, zero `vector_cortex_record_append_failed` /
19
+ * `vector_cortex_generation_rebuilt` emissions; the predecessor derived pointer
20
+ * and goldens are unchanged). The real consumers are the cortex append seam, the
21
+ * cortex rebuild/admin seam and the reader-only topology summary seam.
22
+ */
23
+ export const VC3A_ENABLED = () => sprintFlag("MEGACOMPACT_VC3A");
24
+ /**
25
+ * VC3B — deterministic cortical topology (TopologyV1 / EdgeV1).
26
+ * Default ON. `MEGACOMPACT_VC3B=0` disables and is byte-identical to the
27
+ * predecessor (mode C: no topology graph is built or emitted, the dashboard
28
+ * topology view returns the VC3A-precise aggregation shape with no node/edge
29
+ * arrays, zero `vector_cortex_topology_*` emissions). The real consumers are
30
+ * the topology build seam (build.ts) and the dashboard topology node/edge view.
31
+ */
32
+ export const VC3B_ENABLED = () => sprintFlag("MEGACOMPACT_VC3B");
33
+ /**
34
+ * VC3C — topology query + router invalidation (TopologyQueryV1 / RouterKeyV2,
35
+ * M6 router-generation-v2 migration).
36
+ * Default ON. `MEGACOMPACT_VC3C=0` disables and is byte-identical to the
37
+ * predecessor (mode C: no length-delimited router key, no generation
38
+ * invalidation, zero `vector_cortex_router_generation_invalidated` /
39
+ * `vector_cortex_topology_query_demoted` emissions; the predecessor tiered
40
+ * router keying is unchanged). The real consumers are the topology query seam
41
+ * (query.ts), the M6 router-generation-v2 migration seam, and the reader-only
42
+ * dashboard topology query diagnostic view.
43
+ */
44
+ export const VC3C_ENABLED = () => sprintFlag("MEGACOMPACT_VC3C");
45
+ /**
46
+ * VC4A — dual-tier shard contract (SemanticShardV1 / ExactShardV1 /
47
+ * ShardManifestV1).
48
+ * Default ON. `MEGACOMPACT_VC4A=0` disables and is byte-identical to the
49
+ * predecessor (mode C: exact anchors/current transcript only, no semantic or
50
+ * exact shard manifest is assembled or emitted, zero
51
+ * `vector_cortex_shard_manifest_built` / `vector_cortex_protected_span_rejected`
52
+ * emissions; the predecessor derived pointer and goldens are unchanged). The
53
+ * real consumers are the shard assembly seam (manifest.ts) and the reader-only
54
+ * dashboard shards aggregate view.
55
+ */
56
+ export const VC4A_ENABLED = () => sprintFlag("MEGACOMPACT_VC4A");
57
+ /**
58
+ * VC4B — residual codec and numeric parity (ResidualCodecV1 / ParityShardV1).
59
+ * Default ON. `MEGACOMPACT_VC4B=0` disables and is byte-identical to the
60
+ * predecessor (mode C: no residual artifact is admitted, the exact compressed
61
+ * payload / ledger bytes remain the only representation, zero
62
+ * `vector_cortex_residual_admitted` / `vector_cortex_parity_recovery_failed`
63
+ * emissions; the VC4A shard manifest and its goldens are unchanged). The real
64
+ * consumers are the codec admission seam (codec.ts) and the reader-only
65
+ * dashboard residual aggregate view. The codec math itself is PURE — flag OFF
66
+ * gates the reporter/admission seam, never the arithmetic.
67
+ */
68
+ export const VC4B_ENABLED = () => sprintFlag("MEGACOMPACT_VC4B");
69
+ /**
70
+ * VC4C — reconstruction fidelity (closure + assemble + validate). Default ON.
71
+ * `MEGACOMPACT_VC4C=0` disables and is byte-identical to the predecessor
72
+ * (VC4B): no conservative closure is computed, the reconstruction validator's
73
+ * `vector_cortex_reconstruction_validated` / `vector_cortex_closure_rejected`
74
+ * events are never emitted, and the assembled reconstruction is never produced
75
+ * (the prompt continues to be built by the legacy VC4B exact/residual path and
76
+ * the VC4A shard goldens are unchanged). The closure/assemble/validate
77
+ * functions are PURE — flag OFF gates the reporter seam, never the arithmetic.
78
+ * This flag MUST also be a dashboard SETTINGS toggle (visible in config UI,
79
+ * never in EXCLUDED_SETTINGS), mirroring VC4A/VC4B.
80
+ */
81
+ export const VC4C_ENABLED = () => sprintFlag("MEGACOMPACT_VC4C");
82
+ /**
83
+ * VC5A — PromptDagV1 + budgeted portfolio planner. Default ON.
84
+ * `MEGACOMPACT_VC5A=0` disables and is byte-identical to the predecessor
85
+ * (VC4C): no prompt DAG is built or validated, no budgeted plan is selected,
86
+ * the `vector_cortex_plan_selected` / `vector_cortex_plan_mandatory_overflow`
87
+ * events are never emitted, and the prompt continues to be built by the
88
+ * predecessor VC4C closure/reconstruction path (its goldens are unchanged).
89
+ * The builder/validator/portfolio functions are PURE — flag OFF gates the
90
+ * reporter + dashboard seam, never the arithmetic. This flag MUST also be a
91
+ * dashboard SETTINGS toggle (visible in config UI, never in EXCLUDED_SETTINGS),
92
+ * mirroring VC4A/VC4B/VC4C.
93
+ */
94
+ export const VC5A_ENABLED = () => sprintFlag("MEGACOMPACT_VC5A");
95
+ /**
96
+ * VC5B — validated prompt renderer + provider profiles. Default ON.
97
+ * `MEGACOMPACT_VC5B=0` disables and is byte-identical to the predecessor
98
+ * (VC5A): no render manifest is produced, no canonical request is hashed, the
99
+ * `vector_cortex_render_validated` / `vector_cortex_provider_bypassed` events are
100
+ * never emitted, and the prompt continues to be built by the predecessor VC5A
101
+ * DAG/plan path (its goldens are unchanged). The render/validate functions are
102
+ * PURE — flag OFF gates the reporter + dashboard seam, never the arithmetic.
103
+ * This flag MUST also be a dashboard SETTINGS toggle (visible in config UI, never
104
+ * in EXCLUDED_SETTINGS), mirroring VC4A/VC4B/VC4C/VC5A.
105
+ */
106
+ export const VC5B_ENABLED = () => sprintFlag("MEGACOMPACT_VC5B");
107
+ /**
108
+ * VC5C — live graduated rollout. Default ON. `MEGACOMPACT_VC5C=0` disables and
109
+ * is byte-identical to the predecessor (VC5B): no session is assigned a stable
110
+ * 10k bucket, no gate-advance decision runs, the `vector_cortex_rollout_assigned`
111
+ * / `vector_cortex_rollout_promotion_blocked` events are never emitted, and the
112
+ * prompt continues to be built by the predecessor VC5B renderer path (its goldens
113
+ * are unchanged). The assign/gate/emit functions are PURE — flag OFF gates the
114
+ * reporter + dashboard seam, never the arithmetic. This flag MUST also be a
115
+ * dashboard SETTINGS toggle (visible in config UI, never in EXCLUDED_SETTINGS),
116
+ * mirroring VC4A/VC4B/VC4C/VC5A/VC5B.
117
+ */
118
+ export const VC5C_ENABLED = () => sprintFlag("MEGACOMPACT_VC5C");
119
+ /**
120
+ * VC6A — advanced closure optimization. Default ON. `MEGACOMPACT_VC6A=0`
121
+ * disables and is byte-identical to the predecessor (VC5C): the `optimizeClosure`
122
+ * transitive-reduction arithmetic STILL RUNS (it is PURE), but the
123
+ * `vector_cortex_closure_optimized` / `vector_cortex_closure_proof_rejected`
124
+ * events are never emitted and the dashboard closure diagnostics seam is
125
+ * suppressed. Flag OFF gates the reporter + dashboard seam, never the arithmetic,
126
+ * so flag-off outbound/predecessor golden bytes match exactly. This flag MUST
127
+ * also be a dashboard SETTINGS toggle (visible in config UI, never in
128
+ * EXCLUDED_SETTINGS), mirroring VC4A/VC4B/VC4C/VC5A/VC5B/VC5C.
129
+ */
130
+ export const VC6A_ENABLED = () => sprintFlag("MEGACOMPACT_VC6A");
131
+ /**
132
+ * VC6B — exact source restoration. Default ON. `MEGACOMPACT_VC6B=0` disables and
133
+ * is byte-identical to the predecessor (VC6A): the `restoreSources` /
134
+ * `verifyRestored` arithmetic STILL RUNS (it is PURE — an exact-source read plus
135
+ * a SHA-256 comparison, with no clock, storage, or network), but the
136
+ * `vector_cortex_source_restored` / `vector_cortex_restore_digest_rejected`
137
+ * events are never emitted and the dashboard restoration diagnostics seam is
138
+ * suppressed. Flag OFF gates the reporter + dashboard seam, never the
139
+ * restore/verify arithmetic, so flag-off outbound/predecessor golden bytes match
140
+ * exactly. This flag MUST also be a dashboard SETTINGS toggle (visible in config
141
+ * UI, never in EXCLUDED_SETTINGS), mirroring VC4A/VC4B/VC4C/VC5A/VC5B/VC5C/VC6A.
142
+ */
143
+ export const VC6B_ENABLED = () => sprintFlag("MEGACOMPACT_VC6B");
144
+ /**
145
+ * VC6C — self-healing derived controller. Default ON. `MEGACOMPACT_VC6C=0`
146
+ * disables and is byte-identical to the predecessor (VC6B): the `detectGaps` /
147
+ * `planRebuild` / `rebuildGeneration` / `switchPointer` arithmetic STILL RUNS (it
148
+ * is PURE — a high-water comparison plus a SHA-256 root-digest check, with an
149
+ * INJECTED clock and no storage or network), but the
150
+ * `vector_cortex_repair_planned` / `vector_cortex_repair_pointer_switched` /
151
+ * `vector_cortex_repair_backoff` events are never emitted and the dashboard
152
+ * repair diagnostics seam is suppressed. Flag OFF gates the reporter + dashboard
153
+ * seam, never the gap-detection/rebuild arithmetic (in particular, an unverified
154
+ * pointer switch stays refused with the flag off), so flag-off
155
+ * outbound/predecessor golden bytes match exactly. This flag MUST also be a
156
+ * dashboard SETTINGS toggle (visible in config UI, never in EXCLUDED_SETTINGS),
157
+ * mirroring VC4A/VC4B/VC4C/VC5A/VC5B/VC5C/VC6A/VC6B.
158
+ */
159
+ export const VC6C_ENABLED = () => sprintFlag("MEGACOMPACT_VC6C");
160
+ /**
161
+ * VC7A — frozen range crystals. Default ON. `MEGACOMPACT_VC7A=0` disables and is
162
+ * byte-identical to the predecessor (VC6C): the `encodeCrystalKey` /
163
+ * `CrystalStore` arithmetic STILL RUNS (it is PURE — a canonical length-prefixed
164
+ * encoding plus SHA-256, with no clock, storage, or network), so a crystal is
165
+ * keyed identically and a same-key/different-bytes write is still refused with
166
+ * the flag off. The flag gates ONLY the `vector_cortex_crystal_written` /
167
+ * `vector_cortex_crystal_collision` events and the cache-crystals dashboard seam,
168
+ * which reports `enabled:false` + mode C when off. Flag OFF never gates the
169
+ * crystal/store arithmetic, so flag-off outbound/predecessor golden bytes match
170
+ * exactly. This flag MUST also be a dashboard SETTINGS toggle (visible in config
171
+ * UI, never in EXCLUDED_SETTINGS), mirroring VC4A..VC6C.
172
+ */
173
+ export const VC7A_ENABLED = () => sprintFlag("MEGACOMPACT_VC7A");
174
+ /**
175
+ * VC7B — provider cache economics + crystal compiler. Default ON.
176
+ * `MEGACOMPACT_VC7B=0` disables and is byte-identical to the predecessor
177
+ * (VC7A): `computeEconomics`, `compileCrystalBoundaries` and `assignExperiment`
178
+ * STILL RUN (they are PURE — exact integer/rational arithmetic and a SHA-256
179
+ * session bucket, with no clock, storage, or network), so a session keeps its
180
+ * SAME experiment arm and the compiler keeps producing the SAME boundaries with
181
+ * the flag off. Crucially the compiler never changes request identity in either
182
+ * state, so the outbound canonical request — and therefore the VC7A crystal key
183
+ * and the predecessor golden bytes — are unaffected by this flag.
184
+ *
185
+ * The flag gates ONLY the `vector_cortex_cache_experiment_assigned` /
186
+ * `vector_cortex_cache_economics_estimated` events and the cache-economics
187
+ * dashboard seam, which reports `enabled:false` + mode C when off. This flag
188
+ * MUST also be a dashboard SETTINGS toggle (visible in config UI, never in
189
+ * EXCLUDED_SETTINGS), mirroring VC4A..VC7A.
190
+ */
191
+ export const VC7B_ENABLED = () => sprintFlag("MEGACOMPACT_VC7B");
192
+ /**
193
+ * VC7C — cache miss diagnostics, cache-level breakers and the completed M5
194
+ * request-hash-v2 switch. Default ON. `MEGACOMPACT_VC7C=0` disables and is
195
+ * byte-identical to the predecessor (VC7B): the miss `classify`, the breaker
196
+ * demotion decision and the M5 request-hash-v2 ARITHMETIC STILL RUN (they are
197
+ * PURE — an exclusive ordered comparison over already-computed digests plus a
198
+ * canonical length-prefixed SHA-256, with no clock, storage, or network), so a
199
+ * miss is classified into the SAME single class, a collision / stale generation
200
+ * / digest failure / profile mismatch still demotes BEFORE any cache serve, and
201
+ * the v2 hash of a given request is unchanged with the flag off. A cache is
202
+ * never allowed to serve a stale or colliding entry merely because reporting is
203
+ * off — that would be a correctness change, not a reporting change.
204
+ *
205
+ * The flag gates ONLY the `vector_cortex_cache_miss_classified` /
206
+ * `vector_cortex_cache_serve_blocked` events and the cache-diagnostics dashboard
207
+ * seam, which reports `enabled:false` + mode C when off. This flag MUST also be
208
+ * a dashboard SETTINGS toggle (visible in config UI, never in
209
+ * EXCLUDED_SETTINGS), mirroring VC4A..VC7B.
210
+ */
211
+ export const VC7C_ENABLED = () => sprintFlag("MEGACOMPACT_VC7C");
212
+ /**
213
+ * VC8A — consent-bound outcome ledger + offline learning dataset. Default ON.
214
+ * `MEGACOMPACT_VC8A=0` disables and is byte-identical to the predecessor
215
+ * (VC7C): the outcome ledger, consent records, and dataset manifest builder
216
+ * STILL RUN (they are PURE — append-only validation, consent evaluation, and
217
+ * SHA-256 digests, with no clock, storage, or network), so an outcome is still
218
+ * validated identically and a consent revocation still excludes a row. The
219
+ * flag gates ONLY the `vector_cortex_outcome_appended` /
220
+ * `vector_cortex_dataset_record_excluded` events and the outcomes dashboard
221
+ * seam, which reports `enabled:false` + mode C when off. This flag MUST also be
222
+ * a dashboard SETTINGS toggle (visible in config UI, never in
223
+ * EXCLUDED_SETTINGS), mirroring VC4A..VC7C.
224
+ */
225
+ export const VC8A_ENABLED = () => sprintFlag("MEGACOMPACT_VC8A");
226
+ /**
227
+ * VC8B — bounded shadow adaptive policy + M7 pressure-v2. Default ON.
228
+ * `MEGACOMPACT_VC8B=0` disables and is byte-identical to the predecessor
229
+ * (VC8A): the policy engine, shadow evaluator, and M7 migration STILL RUN
230
+ * (they are PURE — action validation, budget clamping, pressure canonicalization
231
+ * and copy/validate/switch, with no clock, storage, or network), so a budget is
232
+ * still clamped identically and an unknown pressure label is still rejected. The
233
+ * flag gates ONLY the `vector_cortex_shadow_decision_recorded` /
234
+ * `vector_cortex_policy_action_rejected` events and the policy dashboard seam,
235
+ * which reports `enabled:false` + mode C when off. This flag MUST also be a
236
+ * dashboard SETTINGS toggle (visible in config UI, never in EXCLUDED_SETTINGS),
237
+ * mirroring VC4A..VC8A.
238
+ */
239
+ export const VC8B_ENABLED = () => sprintFlag("MEGACOMPACT_VC8B");
@@ -7,236 +7,12 @@
7
7
  *
8
8
  * Breaker/triad constants (TRIAD_RESILIENCE.md) live here; pi-agnostic, dep-free.
9
9
  */
10
- import { sprintFlag } from "./vector-cortex-flag.js";
11
10
  // VC0/VC1/VC2 foundation-phase flags in vector-cortex-early.ts; re-exported
12
11
  // so every existing `from "./config/vector-cortex.js"` import resolves unchanged.
13
12
  export { VC0A_ENABLED, VC0B_ENABLED, VC0C_ENABLED, VC1A_ENABLED, VC1B_ENABLED, VC1C_ENABLED, VC2A_ENABLED, VC2B_ENABLED, VC2C_ENABLED, } from "./vector-cortex-early.js";
14
- /**
15
- * VC3A capability-gated cortex store (CortexReader/Writer/Admin, CortexRecordV1).
16
- * Default ON. `MEGACOMPACT_VC3A=0` disables and is byte-identical to the
17
- * predecessor (mode C: the derived cortex store is absent, mode B in-memory is
18
- * not consulted, zero `vector_cortex_record_append_failed` /
19
- * `vector_cortex_generation_rebuilt` emissions; the predecessor derived pointer
20
- * and goldens are unchanged). The real consumers are the cortex append seam, the
21
- * cortex rebuild/admin seam and the reader-only topology summary seam.
22
- */
23
- export const VC3A_ENABLED = () => sprintFlag("MEGACOMPACT_VC3A");
24
- /**
25
- * VC3B — deterministic cortical topology (TopologyV1 / EdgeV1).
26
- * Default ON. `MEGACOMPACT_VC3B=0` disables and is byte-identical to the
27
- * predecessor (mode C: no topology graph is built or emitted, the dashboard
28
- * topology view returns the VC3A-precise aggregation shape with no node/edge
29
- * arrays, zero `vector_cortex_topology_*` emissions). The real consumers are
30
- * the topology build seam (build.ts) and the dashboard topology node/edge view.
31
- */
32
- export const VC3B_ENABLED = () => sprintFlag("MEGACOMPACT_VC3B");
33
- /**
34
- * VC3C — topology query + router invalidation (TopologyQueryV1 / RouterKeyV2,
35
- * M6 router-generation-v2 migration).
36
- * Default ON. `MEGACOMPACT_VC3C=0` disables and is byte-identical to the
37
- * predecessor (mode C: no length-delimited router key, no generation
38
- * invalidation, zero `vector_cortex_router_generation_invalidated` /
39
- * `vector_cortex_topology_query_demoted` emissions; the predecessor tiered
40
- * router keying is unchanged). The real consumers are the topology query seam
41
- * (query.ts), the M6 router-generation-v2 migration seam, and the reader-only
42
- * dashboard topology query diagnostic view.
43
- */
44
- export const VC3C_ENABLED = () => sprintFlag("MEGACOMPACT_VC3C");
45
- /**
46
- * VC4A — dual-tier shard contract (SemanticShardV1 / ExactShardV1 /
47
- * ShardManifestV1).
48
- * Default ON. `MEGACOMPACT_VC4A=0` disables and is byte-identical to the
49
- * predecessor (mode C: exact anchors/current transcript only, no semantic or
50
- * exact shard manifest is assembled or emitted, zero
51
- * `vector_cortex_shard_manifest_built` / `vector_cortex_protected_span_rejected`
52
- * emissions; the predecessor derived pointer and goldens are unchanged). The
53
- * real consumers are the shard assembly seam (manifest.ts) and the reader-only
54
- * dashboard shards aggregate view.
55
- */
56
- export const VC4A_ENABLED = () => sprintFlag("MEGACOMPACT_VC4A");
57
- /**
58
- * VC4B — residual codec and numeric parity (ResidualCodecV1 / ParityShardV1).
59
- * Default ON. `MEGACOMPACT_VC4B=0` disables and is byte-identical to the
60
- * predecessor (mode C: no residual artifact is admitted, the exact compressed
61
- * payload / ledger bytes remain the only representation, zero
62
- * `vector_cortex_residual_admitted` / `vector_cortex_parity_recovery_failed`
63
- * emissions; the VC4A shard manifest and its goldens are unchanged). The real
64
- * consumers are the codec admission seam (codec.ts) and the reader-only
65
- * dashboard residual aggregate view. The codec math itself is PURE — flag OFF
66
- * gates the reporter/admission seam, never the arithmetic.
67
- */
68
- export const VC4B_ENABLED = () => sprintFlag("MEGACOMPACT_VC4B");
69
- /**
70
- * VC4C — reconstruction fidelity (closure + assemble + validate). Default ON.
71
- * `MEGACOMPACT_VC4C=0` disables and is byte-identical to the predecessor
72
- * (VC4B): no conservative closure is computed, the reconstruction validator's
73
- * `vector_cortex_reconstruction_validated` / `vector_cortex_closure_rejected`
74
- * events are never emitted, and the assembled reconstruction is never produced
75
- * (the prompt continues to be built by the legacy VC4B exact/residual path and
76
- * the VC4A shard goldens are unchanged). The closure/assemble/validate
77
- * functions are PURE — flag OFF gates the reporter seam, never the arithmetic.
78
- * This flag MUST also be a dashboard SETTINGS toggle (visible in config UI,
79
- * never in EXCLUDED_SETTINGS), mirroring VC4A/VC4B.
80
- */
81
- export const VC4C_ENABLED = () => sprintFlag("MEGACOMPACT_VC4C");
82
- /**
83
- * VC5A — PromptDagV1 + budgeted portfolio planner. Default ON.
84
- * `MEGACOMPACT_VC5A=0` disables and is byte-identical to the predecessor
85
- * (VC4C): no prompt DAG is built or validated, no budgeted plan is selected,
86
- * the `vector_cortex_plan_selected` / `vector_cortex_plan_mandatory_overflow`
87
- * events are never emitted, and the prompt continues to be built by the
88
- * predecessor VC4C closure/reconstruction path (its goldens are unchanged).
89
- * The builder/validator/portfolio functions are PURE — flag OFF gates the
90
- * reporter + dashboard seam, never the arithmetic. This flag MUST also be a
91
- * dashboard SETTINGS toggle (visible in config UI, never in EXCLUDED_SETTINGS),
92
- * mirroring VC4A/VC4B/VC4C.
93
- */
94
- export const VC5A_ENABLED = () => sprintFlag("MEGACOMPACT_VC5A");
95
- /**
96
- * VC5B — validated prompt renderer + provider profiles. Default ON.
97
- * `MEGACOMPACT_VC5B=0` disables and is byte-identical to the predecessor
98
- * (VC5A): no render manifest is produced, no canonical request is hashed, the
99
- * `vector_cortex_render_validated` / `vector_cortex_provider_bypassed` events are
100
- * never emitted, and the prompt continues to be built by the predecessor VC5A
101
- * DAG/plan path (its goldens are unchanged). The render/validate functions are
102
- * PURE — flag OFF gates the reporter + dashboard seam, never the arithmetic.
103
- * This flag MUST also be a dashboard SETTINGS toggle (visible in config UI, never
104
- * in EXCLUDED_SETTINGS), mirroring VC4A/VC4B/VC4C/VC5A.
105
- */
106
- export const VC5B_ENABLED = () => sprintFlag("MEGACOMPACT_VC5B");
107
- /**
108
- * VC5C — live graduated rollout. Default ON. `MEGACOMPACT_VC5C=0` disables and
109
- * is byte-identical to the predecessor (VC5B): no session is assigned a stable
110
- * 10k bucket, no gate-advance decision runs, the `vector_cortex_rollout_assigned`
111
- * / `vector_cortex_rollout_promotion_blocked` events are never emitted, and the
112
- * prompt continues to be built by the predecessor VC5B renderer path (its goldens
113
- * are unchanged). The assign/gate/emit functions are PURE — flag OFF gates the
114
- * reporter + dashboard seam, never the arithmetic. This flag MUST also be a
115
- * dashboard SETTINGS toggle (visible in config UI, never in EXCLUDED_SETTINGS),
116
- * mirroring VC4A/VC4B/VC4C/VC5A/VC5B.
117
- */
118
- export const VC5C_ENABLED = () => sprintFlag("MEGACOMPACT_VC5C");
119
- /**
120
- * VC6A — advanced closure optimization. Default ON. `MEGACOMPACT_VC6A=0`
121
- * disables and is byte-identical to the predecessor (VC5C): the `optimizeClosure`
122
- * transitive-reduction arithmetic STILL RUNS (it is PURE), but the
123
- * `vector_cortex_closure_optimized` / `vector_cortex_closure_proof_rejected`
124
- * events are never emitted and the dashboard closure diagnostics seam is
125
- * suppressed. Flag OFF gates the reporter + dashboard seam, never the arithmetic,
126
- * so flag-off outbound/predecessor golden bytes match exactly. This flag MUST
127
- * also be a dashboard SETTINGS toggle (visible in config UI, never in
128
- * EXCLUDED_SETTINGS), mirroring VC4A/VC4B/VC4C/VC5A/VC5B/VC5C.
129
- */
130
- export const VC6A_ENABLED = () => sprintFlag("MEGACOMPACT_VC6A");
131
- /**
132
- * VC6B — exact source restoration. Default ON. `MEGACOMPACT_VC6B=0` disables and
133
- * is byte-identical to the predecessor (VC6A): the `restoreSources` /
134
- * `verifyRestored` arithmetic STILL RUNS (it is PURE — an exact-source read plus
135
- * a SHA-256 comparison, with no clock, storage, or network), but the
136
- * `vector_cortex_source_restored` / `vector_cortex_restore_digest_rejected`
137
- * events are never emitted and the dashboard restoration diagnostics seam is
138
- * suppressed. Flag OFF gates the reporter + dashboard seam, never the
139
- * restore/verify arithmetic, so flag-off outbound/predecessor golden bytes match
140
- * exactly. This flag MUST also be a dashboard SETTINGS toggle (visible in config
141
- * UI, never in EXCLUDED_SETTINGS), mirroring VC4A/VC4B/VC4C/VC5A/VC5B/VC5C/VC6A.
142
- */
143
- export const VC6B_ENABLED = () => sprintFlag("MEGACOMPACT_VC6B");
144
- /**
145
- * VC6C — self-healing derived controller. Default ON. `MEGACOMPACT_VC6C=0`
146
- * disables and is byte-identical to the predecessor (VC6B): the `detectGaps` /
147
- * `planRebuild` / `rebuildGeneration` / `switchPointer` arithmetic STILL RUNS (it
148
- * is PURE — a high-water comparison plus a SHA-256 root-digest check, with an
149
- * INJECTED clock and no storage or network), but the
150
- * `vector_cortex_repair_planned` / `vector_cortex_repair_pointer_switched` /
151
- * `vector_cortex_repair_backoff` events are never emitted and the dashboard
152
- * repair diagnostics seam is suppressed. Flag OFF gates the reporter + dashboard
153
- * seam, never the gap-detection/rebuild arithmetic (in particular, an unverified
154
- * pointer switch stays refused with the flag off), so flag-off
155
- * outbound/predecessor golden bytes match exactly. This flag MUST also be a
156
- * dashboard SETTINGS toggle (visible in config UI, never in EXCLUDED_SETTINGS),
157
- * mirroring VC4A/VC4B/VC4C/VC5A/VC5B/VC5C/VC6A/VC6B.
158
- */
159
- export const VC6C_ENABLED = () => sprintFlag("MEGACOMPACT_VC6C");
160
- /**
161
- * VC7A — frozen range crystals. Default ON. `MEGACOMPACT_VC7A=0` disables and is
162
- * byte-identical to the predecessor (VC6C): the `encodeCrystalKey` /
163
- * `CrystalStore` arithmetic STILL RUNS (it is PURE — a canonical length-prefixed
164
- * encoding plus SHA-256, with no clock, storage, or network), so a crystal is
165
- * keyed identically and a same-key/different-bytes write is still refused with
166
- * the flag off. The flag gates ONLY the `vector_cortex_crystal_written` /
167
- * `vector_cortex_crystal_collision` events and the cache-crystals dashboard seam,
168
- * which reports `enabled:false` + mode C when off. Flag OFF never gates the
169
- * crystal/store arithmetic, so flag-off outbound/predecessor golden bytes match
170
- * exactly. This flag MUST also be a dashboard SETTINGS toggle (visible in config
171
- * UI, never in EXCLUDED_SETTINGS), mirroring VC4A..VC6C.
172
- */
173
- export const VC7A_ENABLED = () => sprintFlag("MEGACOMPACT_VC7A");
174
- /**
175
- * VC7B — provider cache economics + crystal compiler. Default ON.
176
- * `MEGACOMPACT_VC7B=0` disables and is byte-identical to the predecessor
177
- * (VC7A): `computeEconomics`, `compileCrystalBoundaries` and `assignExperiment`
178
- * STILL RUN (they are PURE — exact integer/rational arithmetic and a SHA-256
179
- * session bucket, with no clock, storage, or network), so a session keeps its
180
- * SAME experiment arm and the compiler keeps producing the SAME boundaries with
181
- * the flag off. Crucially the compiler never changes request identity in either
182
- * state, so the outbound canonical request — and therefore the VC7A crystal key
183
- * and the predecessor golden bytes — are unaffected by this flag.
184
- *
185
- * The flag gates ONLY the `vector_cortex_cache_experiment_assigned` /
186
- * `vector_cortex_cache_economics_estimated` events and the cache-economics
187
- * dashboard seam, which reports `enabled:false` + mode C when off. This flag
188
- * MUST also be a dashboard SETTINGS toggle (visible in config UI, never in
189
- * EXCLUDED_SETTINGS), mirroring VC4A..VC7A.
190
- */
191
- export const VC7B_ENABLED = () => sprintFlag("MEGACOMPACT_VC7B");
192
- /**
193
- * VC7C — cache miss diagnostics, cache-level breakers and the completed M5
194
- * request-hash-v2 switch. Default ON. `MEGACOMPACT_VC7C=0` disables and is
195
- * byte-identical to the predecessor (VC7B): the miss `classify`, the breaker
196
- * demotion decision and the M5 request-hash-v2 ARITHMETIC STILL RUN (they are
197
- * PURE — an exclusive ordered comparison over already-computed digests plus a
198
- * canonical length-prefixed SHA-256, with no clock, storage, or network), so a
199
- * miss is classified into the SAME single class, a collision / stale generation
200
- * / digest failure / profile mismatch still demotes BEFORE any cache serve, and
201
- * the v2 hash of a given request is unchanged with the flag off. A cache is
202
- * never allowed to serve a stale or colliding entry merely because reporting is
203
- * off — that would be a correctness change, not a reporting change.
204
- *
205
- * The flag gates ONLY the `vector_cortex_cache_miss_classified` /
206
- * `vector_cortex_cache_serve_blocked` events and the cache-diagnostics dashboard
207
- * seam, which reports `enabled:false` + mode C when off. This flag MUST also be
208
- * a dashboard SETTINGS toggle (visible in config UI, never in
209
- * EXCLUDED_SETTINGS), mirroring VC4A..VC7B.
210
- */
211
- export const VC7C_ENABLED = () => sprintFlag("MEGACOMPACT_VC7C");
212
- /**
213
- * VC8A — consent-bound outcome ledger + offline learning dataset. Default ON.
214
- * `MEGACOMPACT_VC8A=0` disables and is byte-identical to the predecessor
215
- * (VC7C): the outcome ledger, consent records, and dataset manifest builder
216
- * STILL RUN (they are PURE — append-only validation, consent evaluation, and
217
- * SHA-256 digests, with no clock, storage, or network), so an outcome is still
218
- * validated identically and a consent revocation still excludes a row. The
219
- * flag gates ONLY the `vector_cortex_outcome_appended` /
220
- * `vector_cortex_dataset_record_excluded` events and the outcomes dashboard
221
- * seam, which reports `enabled:false` + mode C when off. This flag MUST also be
222
- * a dashboard SETTINGS toggle (visible in config UI, never in
223
- * EXCLUDED_SETTINGS), mirroring VC4A..VC7C.
224
- */
225
- export const VC8A_ENABLED = () => sprintFlag("MEGACOMPACT_VC8A");
226
- /**
227
- * VC8B — bounded shadow adaptive policy + M7 pressure-v2. Default ON.
228
- * `MEGACOMPACT_VC8B=0` disables and is byte-identical to the predecessor
229
- * (VC8A): the policy engine, shadow evaluator, and M7 migration STILL RUN
230
- * (they are PURE — action validation, budget clamping, pressure canonicalization
231
- * and copy/validate/switch, with no clock, storage, or network), so a budget is
232
- * still clamped identically and an unknown pressure label is still rejected. The
233
- * flag gates ONLY the `vector_cortex_shadow_decision_recorded` /
234
- * `vector_cortex_policy_action_rejected` events and the policy dashboard seam,
235
- * which reports `enabled:false` + mode C when off. This flag MUST also be a
236
- * dashboard SETTINGS toggle (visible in config UI, never in EXCLUDED_SETTINGS),
237
- * mirroring VC4A..VC8A.
238
- */
239
- export const VC8B_ENABLED = () => sprintFlag("MEGACOMPACT_VC8B");
13
+ // VC3A..VC8B flags extracted to vector-cortex-vc3to8.ts (mechanical move so
14
+ // this barrel stays under the 300-line soft cap); re-exported unchanged.
15
+ export { 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, } from "./vector-cortex-vc3to8.js";
240
16
  export { VC8C_ENABLED } from "./vector-cortex-vc8c.js";
241
17
  export { VC9A_ENABLED } from "./vector-cortex-vc9a.js";
242
18
  export { VC9B_ENABLED } from "./vector-cortex-vc9b.js";
@@ -253,5 +29,7 @@ export { ENC_0A_ENABLED } from "./vector-cortex-enc0a.js";
253
29
  export { ENC_0B_ENABLED } from "./vector-cortex-enc0b.js";
254
30
  export { ENC_0C_ENABLED } from "./vector-cortex-enc0c.js";
255
31
  export { ENC_0D_ENABLED } from "./vector-cortex-enc0d.js";
32
+ export { ENC_0E_ENABLED } from "./vector-cortex-enc0e.js";
33
+ export { ENC_0F_ENABLED } from "./vector-cortex-enc0f.js";
256
34
  // Breaker constants (TRIAD_RESILIENCE.md §breaker) extracted to vector-cortex-breakers.ts.
257
35
  export { 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 "./vector-cortex-breakers.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, 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, 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";
@@ -62,5 +62,7 @@ export const VECTOR_CORTEX_SETTINGS = {
62
62
  boolDirect("MEGACOMPACT_ENC_0B", "ENC-0b Real Trunk Fetch & Gated Path", "ENC-0b real ONNX trunk fetch + gated inference: replaces the LCG placeholder with the real bge-small int8 model through an ONNX InferenceSession (onnxruntime-web WASM). OFF = LCG placeholder serves byte-identical predecessor output, no ONNX session built.", true),
63
63
  boolDirect("MEGACOMPACT_ENC_0C", "ENC-0c Five-Head Supervision Transfer", "ENC-0c five-head supervision transfer on the frozen bge-small trunk: when a developer-trained head candidate is staged under ~/.pi/mega-compact-encoder/candidates/, the five heads serve the trained weights. OFF = no candidate is loaded, the heads serve byte-identical ENC-0b survivor defaults.", true),
64
64
  boolDirect("MEGACOMPACT_ENC_0D", "ENC-0d Real-Asset Promotion Gate", "ENC-0d promotion gate over real trained assets: accepts a {color} real candidate manifest (the ENC-0c trained head weights + the ENC-0b trunk), digest-verifies every staged byte, and atomically swaps the shipped manifest to a green candidate with rollback-to-previous on qualification failure. OFF = accepts no candidate, swaps nothing, emits nothing, shipped manifest stays at the ENC-0c survivor.", true),
65
+ boolDirect("MEGACOMPACT_ENC_0E", "ENC-0e darwin-x64 Demotion Reason", "ENC-0e darwin-x64 explicit demotion: on an Intel Mac the runtime demotes to WASM (no native binary upstream); this surfaces a deterministic reason on the runtime-selection event and the Setup Cortex blockers card so an operator sees why mode A is unreachable. OFF = no demotion reason on the event and no Setup card row (the ML5-C WASM demotion itself remains the default, byte-identical predecessor).", true),
66
+ boolDirect("MEGACOMPACT_ENC_0F", "ENC-0f p95 + marginal-RSS Qualification Gate", "ENC-0f p95 + marginal-RSS qualification gate (real trained asset → mode A): runs the ENC-0d-promoted trained asset through the bench under --expose-gc, asserts p95 ≤ 40 ms @ 512/4 threads, marginal RSS ≤ 150 MiB (baseline-subtracted), determinism, and opset-21; on pass emits QualificationV1 + flips runtime to qualified mode A, on failure asset stays demoted to mode B. OFF = no qualification gate runs, no QualificationV1 written, runtime keeps serving the ENC-0d survivor (byte-identical predecessor).", true),
65
67
  ],
66
68
  };
@@ -22,8 +22,9 @@ import { createHash } from "node:crypto";
22
22
  import { readFileSync, statSync } from "node:fs";
23
23
  import { join, dirname } from "node:path";
24
24
  import { fileURLToPath } from "node:url";
25
- import { VC9A_ENABLED } from "../../src/config.js";
25
+ import { VC9A_ENABLED, ENC_0E_ENABLED } from "../../src/config.js";
26
26
  import { readEncoderManifest, verifyEncoderAsset, detectPlatform } from "../../src/vector-cortex/encoder/asset.js";
27
+ import { selectRuntimeBackend } from "../../src/vector-cortex/encoder/runtime-select.js";
27
28
  import { sendJson } from "./routes-vector-cortex-shared.js";
28
29
  import { deriveVcStatus } from "./vc-status.js";
29
30
  import { SETUP_CORTEX_BLOCKERS } from "./setup-cortex-blockers.js";
@@ -123,6 +124,11 @@ export function handleSetupCortexStatus(req, res, _ctx) {
123
124
  const enabled = VC9A_ENABLED();
124
125
  const facts = enabled ? setupCortexFacts() : null;
125
126
  const blocks = enabled ? [...SETUP_CORTEX_BLOCKERS] : [];
127
+ // ENC-0e: surface the darwin-x64 demotion reason additively (reader-only GET,
128
+ // no new route). The platform is read locally; the selection is pure. On a
129
+ // non-darwin-x64 host or flag-off this is null and the field is omitted —
130
+ // byte-compatible payload.
131
+ const darwinX64 = enabled ? darwinX64StatusBlock() : null;
126
132
  const body = {
127
133
  enabled,
128
134
  flag: "MEGACOMPACT_VC9A",
@@ -137,7 +143,30 @@ export function handleSetupCortexStatus(req, res, _ctx) {
137
143
  : { assetDigestPrefix: null, mode: "C" },
138
144
  updatedAt: new Date().toISOString(),
139
145
  status: deriveVcStatus({ enabled, hasData: !!facts && facts.verdict !== "unavailable", structuralOnly: true }),
146
+ ...(darwinX64 !== null ? { darwinX64 } : {}),
140
147
  };
141
148
  sendJson(res, 200, body);
142
149
  return true;
143
150
  }
151
+ /**
152
+ * ENC-0e helper: the darwin-x64 demotion block for the setup-cortex status
153
+ * response. Exported for direct unit assertion without a live HTTP round-trip —
154
+ * returns null on any non-darwin-x64 platform or flag-off (so the additive
155
+ * contract field is omitted from the payload, byte-compatible). The demotion
156
+ * reason flows from the pure `selectRuntimeBackend` selection, never a literal
157
+ * in the route.
158
+ */
159
+ export function darwinX64StatusBlock() {
160
+ const platform = detectPlatform();
161
+ if (platform !== "darwin-x64" || !ENC_0E_ENABLED())
162
+ return null;
163
+ const chosen = selectRuntimeBackend({
164
+ platform,
165
+ benchRecord: null,
166
+ nativeOptIn: process.env.MEGACOMPACT_ENCODER_NATIVE === "1",
167
+ });
168
+ return {
169
+ demoted: chosen.backend === "wasm",
170
+ reason: chosen.demotionReason ?? undefined,
171
+ };
172
+ }