← Back to Pull requests

docs: group env vars by module across CLAUDE.md, READMEs and settings example #412

Closed
unknown closed this pull request without merging on Oct 23, 2026 03:06 UTC
View on GitHub
unknown unknown commented on Oct 23, 2026 02:09 UTC
Author

Restructures the environment-variable docs by the module that reads each setting, and fixes gaps and wrong statements found by comparing the docs against what the code actually reads.

What changed


  • packages/functions/README.md → Environment Variables is now the full reference: 18 tables (runtime, database, auth, blob storage, image proxy, orphan sweep, feature flags, Azure OpenAI client, hex detection, batch pipeline, ingestion/connectors, catalog images, OCR/voice, cache, CORS, telemetry, hex eval, admin scripts), each with a Default column and the source file.

  • CLAUDE.md: the flat "Required / Optional" list is replaced by the same groups in short form, plus Web, Mobile and Infra sections. The Documentation Maintenance row for new env vars now names every place to update.

  • local.settings.json.example: keys reordered into the same groups (values unchanged).

  • Root README.md: the duplicated ~45-row table is replaced by a per-target index (where each set lives, link to its reference) and the handful of settings you actually change locally.

  • apps/web/README.md: adds where NEXT_PUBLIC_ must be set and NEXT_PUBLIC_SITE_URL.

  • infrastructure/README.md: adds the GitHub variables Deploy Infra reads that weren't listed (batch/snap flags, APIM gateway).

  • Command tables: adds dev:shared, generate:types, migrate / migrate:down and generate:pwa-icons where they were missing.
  • Fixes found along the way


  • BLOB_READ_SAS_TTL_SECONDS was listed as required, but no code reads it. Removed from the docs and the example.

  • AZURE_SPEECH_KEY / AZURE_SPEECH_REGION were listed as required, but voice.ts is a stub and only mentions them in comments. Now documented as reserved.

  • Undocumented variables the code reads: AZURE_OPENAI_USE_GATEWAY, AZURE_OPENAI_GATEWAY_ENDPOINT, AZURE_OPENAI_GATEWAY_SUBSCRIPTION_KEY (missing from CLAUDE.md), CORS_SUPPORT_CREDENTIALS and CORS_ALLOWED_ORIGINS (missing from the Functions README and the example), plus NEXT_PUBLIC_SITE_URL and the admin-script API_BASE_URL / ADMIN_BEARER_TOKEN.

  • AZURE_OPENAI_ENDPOINT was described as "for voice parsing"; it serves vision hex detection and label OCR.

  • Migrations: the docs said DATABASE_URL comes from the root .env. In fact npm run migrate loads local.settings.json into the environment, and an exported DATABASE_URL takes precedence.

  • Web: Next.js reads env files only from apps/web, so the docs now point to apps/web/.env.local instead of the root .env.
  • Verification


  • A script listed every process.env / env-helper name under packages/functions/src and scripts. Each one now appears in both CLAUDE.md and the Functions README.

  • The example still parses as JSON and has the same keys as before, except: BLOB_READ_SAS_TTL_SECONDS removed; CORS_ALLOWED_ORIGINS (set to the code default) and CORS_SUPPORT_CREDENTIALS=false added.

  • Rebased onto current dev (includes SHAREABLE_LOOKS_ENABLED from #408 and FUNCTIONS_NODE_BLOCK_ON_ENTRY_POINT_ERROR from #410).
  • 🤖 Generated with Claude Code

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->
    <!-- coderabbit-ai-generated:v1 -->

    Summary by CodeRabbit

    Documentation
    Expanded environment-variable guidance across the app, including configuration locations, defaults, fallbacks, limits, feature flags, and infrastructure settings.
    Added command references for shared-type watching, migrations, type generation, and PWA icon generation.
    Clarified migration variable precedence and that web settings are public build-time values, not secrets.
    Configuration
    * Added CORS origin and credential settings to the local Functions example; removed the blob read SAS TTL setting.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 486 lines (+364 / -122) across 6 files Reviewer: mattmck Review duration: 57m
    All Vouch review confidence checks passed
    Residual risk 0.23 = Change Risk (0.52) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 486 lines diff across 6 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.370
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #412"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52.3% (MEDIUM) · Higher = larger blast radius
    52.3%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 22.6% · Safe to merge
    22.6%