Refresh HiveGrid Cloud reference snapshot

This commit is contained in:
david committed 2026-08-03 15:31:14 +02:00
1 parent 5e99e14772
commit 7f88026f79
5955 files changed
+1177325 -188362

No files matched your search

@@ -4,9 +4,10 @@ import { describe, expect, test } from "vitest";
import { getEnvVariableDefinition, getRequiredEnvVariableNames, listEnvVariables, validateEnv } from "./index.js";
const representativeDefinitions = {
APP_NAME: { classification: "required-core", targets: ["shared", "web", "api", "mcp", "worker"], source: "code-and-example" },
APP_NAME: { classification: "required-core", targets: ["web", "api", "worker"], source: "code-and-example" },
DATABASE_URL: { classification: "required-core", targets: ["shared", "web", "api", "mcp", "worker"], source: "code-and-example" },
SESSION_SECRET: { classification: "required-core", targets: ["web", "api"], source: "code-and-example" },
AUDIT_CHAIN_SECRET: { classification: "production-only", targets: ["web", "api", "mcp", "worker"], source: "code-and-example" },
API_ACCESS_TOKEN: { classification: "required-per-app", targets: ["web", "api"], source: "code-and-example" },
JWT_SECRET: { classification: "required-per-app", targets: ["web", "api"], source: "code-and-example" },
ANALYTICS_TOKEN: { classification: "required-per-app", targets: ["api"], source: "code" },
@@ -94,6 +95,7 @@ describe("env access inventory contract", () => {
"WORKFLOW_TRIGGER_EXECUTOR_URL",
"OUTBOX_DISPATCHER_REQUIRED",
"WORKFLOW_TRIGGER_OUTBOX_REQUIRED",
"CRYPTO_SECRET",
"BULLMQ_REDIS_URL",
"REDIS_URL",
"BROWSER_RUNTIME_URL",
@@ -115,6 +117,10 @@ describe("env access inventory contract", () => {
expect(getRequiredEnvVariableNames({ target: "worker", nodeEnv: "production" })).not.toEqual(
expect.arrayContaining(["WORKER_ENABLED", "BULLMQ_REDIS_URL", "REDIS_URL", "SITE_KEY_*"])
);
expect(getRequiredEnvVariableNames({ target: "mcp", nodeEnv: "production" })).not.toContain("APP_NAME");
expect(getRequiredEnvVariableNames({ target: "mcp", nodeEnv: "production" })).toEqual(
expect.arrayContaining(["DATABASE_URL", "REDIS_URL"])
);
});
test("validates missing required env values deterministically without reading process.env", () => {
@@ -139,10 +145,13 @@ describe("env access inventory contract", () => {
APP_BASE_DOMAIN: "example.com",
APP_NAME: "HiveGrid",
CRYPTO_SECRET: "crypto-secret",
ADMIN_CONNECTION_MASTER_KEY:
"admin-connection-master-key-value",
DATABASE_URL: "postgresql://user:pass@localhost:5432/app",
JWT_SECRET: "jwt-secret",
SESSION_SECRET: "session-secret",
ANALYTICS_TOKEN: "analytics-token",
AUDIT_CHAIN_SECRET: "audit-chain-secret-value-with-at-least-32-characters",
WEB_APP_HOST: "app.example.com",
},
{ target: "api", nodeEnv: "production" }
@@ -166,7 +175,7 @@ describe("env access inventory contract", () => {
test("locks stable inventory wording for S05/S06 owners and dynamic/fallback key semantics", () => {
expect(followUpMapping).toContain("| S05 docs | Example and documentation alignment, fallback wording, deprecated/example-only cleanup |");
expect(followUpMapping).toContain("`BULLMQ_REDIS_URL` as primary");
expect(followUpMapping).toContain("`REDIS_URL` as fallback only when `BULLMQ_REDIS_URL` is absent");
expect(followUpMapping).toContain("`REDIS_URL` as the required MCP shared-store URL and queue fallback");
expect(followUpMapping).toContain("| S06 enforcement | Future direct-read guardrails and drift tests |");
expect(followUpMapping).toContain("Prefix support for `SITE_KEY_*`");
expect(followUpMapping).toContain("CORS-origin catalog drift checks for `WEB_ORIGIN` and `ADMIN_ORIGIN`");
@@ -174,7 +183,7 @@ describe("env access inventory contract", () => {
expect(sourceAccessTable).toContain("| `BULLMQ_REDIS_URL` |");
expect(sourceAccessTable).toContain("Primary BullMQ Redis URL for web/API enqueue and worker queues");
expect(sourceAccessTable).toContain("| `REDIS_URL` |");
expect(sourceAccessTable).toContain("BullMQ fallback only when `BULLMQ_REDIS_URL` is absent");
expect(sourceAccessTable).toContain("Required by MCP in production and a BullMQ fallback elsewhere");
expect(sourceAccessTable).toContain("| `SITE_KEY_*` |");
expect(sourceAccessTable).toContain("Must be matched by prefix, not enumerated as one literal key");
expect(sourceAccessTable).toContain("| `WEB_ORIGIN` |");