Complete specification for configuring ELCODE Forge project settings, rule pack inheritance, AI providers, secret scanning entropy, open-source license compliance, Git hooks, Policy-as-Code, environment variables, and the GitHub Action via eforge.config.yaml.

01. Configuration File Discovery & Precedence

When eforge runs in a repository root, load_config(repo_root) resolves configuration in the following deterministic order:

1. Primary Config File
eforge.config.yaml

Standard PRD v1.1 configuration file generated by eforge init. Takes highest file precedence.

2. Legacy Fallback File
forge.config.yaml

Automatically loaded if eforge.config.yaml is absent for backward compatibility.

3. Zero-Config Default
ForgeConfig::default()

If neither file exists, Forge runs with recommended defaults, git_enabled: true, and ai.enabled: false.

02. Complete Master eforge.config.yaml Example

UTF-8 / BOM-tolerant YAML

Below is a complete, production-grade eforge.config.yaml showing all supported sections and keys:

version: 1

project:
  name: my-enterprise-platform

analysis:
  languages:
    - typescript
    - javascript
    - python
    - go
    - rust
    - php

git:
  enabled: true

# Directories & globs skipped during repository traversal
ignore:
  - node_modules
  - dist
  - .next
  - .eforge
  - target
  - vendor

# Global minimum severity threshold to fail scans (critical | high | medium | low | info)
fail_on_severity: high

# Built-in rule pack inheritance, custom rule paths, and per-rule overrides
rules:
  extends:
    - recommended
    - clean-architecture
    - security
  custom_packs:
    - .eforge/rules
    - rules/team-rules.yaml
  fail_on_severity: high
  arch/no-direct-db-in-ui:
    enabled: true
    severity: critical
  quality/max-file-lines:
    enabled: true
    severity: medium
    max_lines: 350

# Secret & Shannon Entropy Security Scanner Settings
security:
  allowlist:
    - "fixtures/**"
    - "tests/**"
    - "**/__mocks__/**"
  entropy_threshold: 4.5
  entropy_min_len: 20

# Open-Source Dependency License Compliance Policy
license:
  disallow_copyleft: true
  allowlist:
    - MIT
    - Apache-2.0
    - BSD-2-Clause
    - BSD-3-Clause
    - ISC
  denylist:
    - AGPL-3.0-only
    - GPL-3.0-only
    - SSPL-1.0

# Native Sub-200ms Git Hooks Configuration (eforge hook)
hooks:
  pre_commit:
    enabled: true
    fail_on: high
    fast: true
    staged_only: true
  pre_push:
    enabled: true
    fail_on: critical

# Optional Grounded AI Layer (Deterministic before generative)
ai:
  enabled: false
  provider: openai-compatible   # openai-compatible | anthropic | gemini
  model: gpt-4o
  base_url: https://api.openai.com/v1
  api_key_env: OPENAI_API_KEY   # NEVER put raw api_key in YAML!
  max_tokens: 1024
  max_context_tokens: 8000
  temperature: 0.0
  timeout_secs: 60
  cache: true
  budget:
    daily_usd: 5.00
  pricing:
    input_per_1k: 0.0025
    output_per_1k: 0.0100

# Enterprise Policy-as-Code Gate (eforge policy check)
policy:
  name: enterprise-release-gate
  version: 1
  organization: elcode-id
  constraints:
    min_health_score: 80
    enforce_secret_zero_tolerance: true
    max_circular_dependencies: 0
    max_blast_radius_modules: 8
    max_modified_lines_without_tests: 200
    disallowed_severities:
      - critical
      - high
    forbidden_licenses:
      - AGPL-3.0-only
      - GPL-3.0-only
    required_rule_packs:
      - recommended
  waivers:
    - rule_id: security/high-entropy-secret
      path_pattern: "fixtures/**"
      expires_at: "2027-12-31T23:59:59Z"
      justification: "Synthetic test fixture tokens"

03. AI Providers, Local Offline Models & Security Invariants (ai:)

ELCODE Forge strictly enforces credential isolation: if you place a raw api_key, token, secret, or password key inside the ai: section, the parser immediately rejects the configuration with ForgeError::Config. Always pass the environment variable name via api_key_env.

Ollama (100% Offline / Local) Zero Data Exfiltration
ai:
  enabled: true
  provider: openai-compatible
  model: qwen2.5-coder:7b
  base_url: http://localhost:11434/v1
  temperature: 0.1
  cache: true
LM Studio / vLLM (Local Server) Zero Data Exfiltration
ai:
  enabled: true
  provider: openai-compatible
  model: local-model
  base_url: http://localhost:1234/v1
  temperature: 0.0
Anthropic Claude ANTHROPIC_API_KEY
ai:
  enabled: true
  provider: anthropic
  model: claude-3-5-sonnet-latest
  api_key_env: ANTHROPIC_API_KEY
  budget_daily_usd: 5.00
Google Gemini GEMINI_API_KEY
ai:
  enabled: true
  provider: gemini
  model: gemini-2.5-pro
  api_key_env: GEMINI_API_KEY
  budget_daily_usd: 5.00

04. Local Cache, Index & Ledger Directory (.eforge/)

All local caches, OSV advisory databases, historical commit snapshots, and AI usage ledgers are stored inside <repo_root>/.eforge/ (automatically ignored during scans; add .eforge/ to your .gitignore except .eforge/rules/ if you version custom rules there):

.eforge/
├── metadata.json          # BLAKE3 file content hashes, config_hash & analyzer_version for incremental scans
├── baseline.json          # Cached remote baseline snapshot pulled via 'eforge pull' or 'eforge sync'
├── ai-usage.jsonl         # Append-only daily token & USD cost ledger read by 'eforge ai usage'
├── ai-cache/              # Deterministic 64-char BLAKE3 response cache (<hash>.json, zero auth headers)
├── cache/
│   └── osv/               # Offline OSV vulnerability advisory cache per ecosystem (npm.json, pypi.json, etc.)
├── index/                 # Local AST & architecture graph index artifacts
├── history/               # Idempotent per-commit snapshots (<unix_ts>-<sha12>.json) via 'eforge report --save-history'
└── rules/
    └── custom-rules.yaml  # Declarative custom rules initialized via 'eforge rules init'

05. Environment Variables Reference

VariableScopeDescription
NO_COLORCLI Terminal UXWhen set (to any non-empty value), disables ANSI color codes and renders plain ASCII meters ([=========.] 92/100).
CLICOLOR_FORCECLI Terminal UXWhen set to 1, forces ANSI color output even when stdout is piped in CI logs.
FORGE_SKIP_HOOKGit HooksSet FORGE_SKIP_HOOK=1 git commit ... to temporarily bypass eforge hook pre-commit/pre-push checks.
EFORGE_API_TOKENCloud SyncBearer API token for eforge push, eforge pull, and eforge sync (overrides ~/.eforge/credentials.yaml).
EFORGE_CREDENTIALS_PATHCloud SyncCustom file path for stored remote credentials (defaults to ~/.eforge/credentials.yaml with 0o600 permissions).
OPENAI_API_KEY / ANTHROPIC_API_KEY / GEMINI_API_KEYAI LayerDefault vendor API key environment variables (or any custom variable specified in ai.api_key_env).
EFORGE_BINARY_PATH / EFORGE_CACHE_DIR / EFORGE_DOWNLOAD_URLnpm LauncherOverrides binary path, local cache directory, or release mirror URL for the elcode-forge / @elcode-forge/cli npm wrapper.

06. GitHub Action Integration (elcode-id/forge-action)

Gate pull requests, publish Markdown summaries to $GITHUB_STEP_SUMMARY, and upload OASIS SARIF v2.1.0 security reports using the composite GitHub Action in integrations/github-action:

- name: Run ELCODE Forge PR Gate & SARIF Scan
  id: forge
  uses: elcode-id/elcode-forge/integrations/github-action@v1.0.0
  with:
    command: scan               # doctor | scan | review | diff | security | dependencies | graph
    path: .
    base: origin/main           # Base git ref when running review / ai-review
    format: terminal            # terminal | json | sarif | markdown
    strict: "true"              # Fails on high/critical findings when fail-on is unset
    fail-on: high               # critical | high | medium | low
    sarif-output: eforge.sarif  # Emits SARIF v2.1.0 file for scan or security commands
    ai-review: "false"          # Opt-in AI review (default: false)
    step-summary: "true"        # Appends Markdown report to $GITHUB_STEP_SUMMARY

07. Node.js, package.json Scripts & Programmatic API Integration

In JavaScript and TypeScript projects, install elcode-forge as a devDependency to wire deterministic governance, watch radar, and pre-commit hooks into standard npm scripts:

// package.json
{
  "devDependencies": {
    "elcode-forge": "^1.1.0"
  },
  "scripts": {
    "doctor": "eforge doctor",
    "scan": "eforge scan --codeframe --fail-on high",
    "review": "eforge review --fast --impacted-tests",
    "watch": "eforge watch",
    "fix": "eforge fix --apply",
    "infer": "eforge rules infer",
    "audit": "eforge security --audit",
    "precommit": "eforge hook run pre-commit"
  }
}

You can also import the programmatic helper functions (execute(), getBinary()) directly in custom Node.js build pipelines:

const { execute } = require('elcode-forge');

async function checkArchitecture() {
  const result = await execute(['scan', '--format', 'json']);
  if (result.status !== 0) {
    console.error('Violations detected:', result.stderr);
    process.exit(1);
  }
}