Title: feat(forge-core): AI configuration section, shared untrusted boundary, and ForgeError::Ai · Issue #85 · elcode-id/elcode-forge · GitHub
Open Graph Title: feat(forge-core): AI configuration section, shared untrusted boundary, and ForgeError::Ai · Issue #85 · elcode-id/elcode-forge
X Title: feat(forge-core): AI configuration section, shared untrusted boundary, and ForgeError::Ai · Issue #85 · elcode-id/elcode-forge
Description: Deterministic Codebase Intelligence, Architecture Analysis, Change Blast-Radius, Release Readiness & Native MCP Engine . built in Rust by ELCODE. - feat(forge-core): AI configuration section, shared untrusted boundary, and ForgeError::Ai · Issue #85 · elcode-id/elcode-forge
Open Graph Description: Deterministic Codebase Intelligence, Architecture Analysis, Change Blast-Radius, Release Readiness & Native MCP Engine . built in Rust by ELCODE. - feat(forge-core): AI configuration section, s...
X Description: Deterministic Codebase Intelligence, Architecture Analysis, Change Blast-Radius, Release Readiness & Native MCP Engine . built in Rust by ELCODE. - feat(forge-core): AI configuration sectio...
Opengraph URL: https://github.com/elcode-id/elcode-forge
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(forge-core): AI configuration section, shared untrusted boundary, and ForgeError::Ai","articleBody":"## 1. Context & Objective\nExtend `forge-core` with the `AiConfig` and `AiProviderKind` configuration structures (`ai:` section in `eforge.config.yaml`), promote `UntrustedEnvelope\u003cT>`, `detect_prompt_injection_signals`, and `wrap_untrusted_payload` from `forge-mcp::boundary` into `forge_core::untrusted` (re-exporting in `forge-mcp`), and add `ForgeError::Ai` and `ForgeError::AiBudgetExceeded` variants (PRD §19, §36, §39).\n\n- **Parent Epic:** #82\n- **GitFlow Branch:** `feat/forge-085-ai-config-and-boundary`\n- **Execution Wave:** `wave-9`\n- **DAG Dependencies:** None (root of Phase 4)\n- **Estimated Size:** ~250 LOC (`\u003c 400 LOC`)\n\n## 2. Target Files\n- `crates/forge-core/src/config.rs` *(MODIFY: add `AiConfig`, `AiProviderKind`, nested `ai:` parsing)*\n- `crates/forge-core/src/untrusted.rs` *(NEW: moved from `crates/forge-mcp/src/boundary.rs`)*\n- `crates/forge-core/src/error.rs` *(MODIFY: add `Ai { message: String }` and `AiBudgetExceeded { spent_usd: f64, limit_usd: f64 }`)*\n- `crates/forge-core/src/lib.rs` *(MODIFY: export `untrusted` module and new config/error types)*\n- `crates/forge-mcp/src/boundary.rs` *(MODIFY: re-export `forge_core::untrusted::*` for backward compatibility)*\n\n## 3. Public Contract\n```rust\npub enum AiProviderKind {\n OpenAiCompatible,\n Anthropic,\n Gemini,\n}\n\npub struct AiConfig {\n pub enabled: bool, // default: false\n pub provider: Option\u003cAiProviderKind>,\n pub model: Option\u003cString>,\n pub base_url: Option\u003cString>,\n pub api_key_env: Option\u003cString>, // env var name only, NEVER raw key\n pub max_tokens: u32, // default: 1024\n pub max_context_tokens: u32, // default: 8000\n pub temperature: Option\u003cf32>, // default: Some(0.0)\n pub timeout_secs: u64, // default: 60\n pub cache_enabled: bool, // default: true\n pub budget_daily_usd: Option\u003cf64>,\n pub price_input_per_1k: Option\u003cf64>,\n pub price_output_per_1k: Option\u003cf64>,\n}\n```\n- `ForgeConfig` gains `pub ai: AiConfig` while keeping flat `ai_enabled` synchronized with `ai.enabled` for backward compatibility.\n- Supported YAML keys under `ai:`: `enabled`, `provider`, `model`, `base_url`, `api_key_env`, `max_tokens`, `max_context_tokens`, `temperature`, `timeout_secs`, `cache`, `budget.daily_usd`, `pricing.input_per_1k`, `pricing.output_per_1k`.\n\n## 4. Security & Privacy Invariants\n- Secret-like keys (`api_key`, `token`, `secret`, `password`) under `ai:` MUST be rejected with `ForgeError::Config` instructing the user to store credentials in an environment variable and reference it via `api_key_env`.\n- `base_url` (when provided) MUST start with `http://` or `https://`.\n\n## 5. Definition of Done & Verification (Tier 3)\n- Unit tests covering full `ai:` YAML parsing, default values, rejection of `ai.api_key`, backward-compatible `ai_enabled`, and `forge_core::untrusted` prompt-injection detection.\n- All existing `forge-mcp` boundary tests pass without modification.\n- **Selective Verification Gate (Tier 3):**\n 1. `cargo fmt --all -- --check`\n 2. `cargo clippy --workspace --all-targets -- -D warnings`\n 3. `cargo test --workspace --lib --bins`","author":{"url":"https://github.com/luksluki","@type":"Person","name":"luksluki"},"datePublished":"2026-10-19T14:21:18Z","url":"https://github.com/elcode-id/elcode-forge/issues/85"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:04aa4245-0d7d-ddfa-296c-23378f7109ea |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A208:12E8E1:1C87D8E:272D6CE:6B059780 |
| html-safe-nonce | eeb2dd522c79ab68c52e2e9e45f3c731fdb9a6b4f72769ceef15dbfab6ea283b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjA4OjEyRThFMToxQzg3RDhFOjI3MkQ2Q0U6NkIwNTk3ODAiLCJ2aXNpdG9yX2lkIjoiMTY5NTU4OTU0MTkyMDIxNjk2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 22696460aaf4cc7478b6f82360c9886169060c2685365f79b336cef9db2d2ef3 |
| hovercard-subject-tag | repository:1423983661 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/elcode-id/elcode-forge/issues/85 |
| twitter:image | https://opengraph.githubassets.com/9b8d05eb3e68ccef67c29ed6fe256b5731cdfc3bf948270564a181228bcf2b2c/elcode-id/elcode-forge |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9b8d05eb3e68ccef67c29ed6fe256b5731cdfc3bf948270564a181228bcf2b2c/elcode-id/elcode-forge |
| og:image:alt | Deterministic Codebase Intelligence, Architecture Analysis, Change Blast-Radius, Release Readiness & Native MCP Engine . built in Rust by ELCODE. - feat(forge-core): AI configuration section, s... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3b72fd2385d76a50ce0fe937d50bb4a81434432c4fd47866074a26f6cd03623f |
| turbo-cache-control | no-cache |
| go-import | github.com/elcode-id/elcode-forge git https://github.com/elcode-id/elcode-forge.git |
| octolytics-dimension-user_id | 337957755 |
| octolytics-dimension-user_login | elcode-id |
| octolytics-dimension-repository_id | 1423983661 |
| octolytics-dimension-repository_nwo | elcode-id/elcode-forge |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1423983661 |
| octolytics-dimension-repository_network_root_nwo | elcode-id/elcode-forge |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 58e2bd32336f3dcee343ec627a4d09c7c444e214 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width