Title: feat(forge-cli): AI-augmented eforge explain with dry-run and structured answers · Issue #91 · elcode-id/elcode-forge · GitHub
Open Graph Title: feat(forge-cli): AI-augmented eforge explain with dry-run and structured answers · Issue #91 · elcode-id/elcode-forge
X Title: feat(forge-cli): AI-augmented eforge explain with dry-run and structured answers · Issue #91 · elcode-id/elcode-forge
Description: 1. Context & Objective Extend eforge explain in crates/forge-cli with opt-in --ai, --provider, --model, --dry-run, and --no-cache flags, orchestrating safe file reading (resolve_safe_path), secret redaction via forge-security, token-budg...
Open Graph Description: 1. Context & Objective Extend eforge explain in crates/forge-cli with opt-in --ai, --provider, --model, --dry-run, and --no-cache flags, orchestrating safe file reading (resolve_safe_path), secret ...
X Description: 1. Context & Objective Extend eforge explain in crates/forge-cli with opt-in --ai, --provider, --model, --dry-run, and --no-cache flags, orchestrating safe file reading (resolve_safe_path), sec...
Opengraph URL: https://github.com/elcode-id/elcode-forge/issues/91
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(forge-cli): AI-augmented eforge explain with dry-run and structured answers","articleBody":"## 1. Context & Objective\nExtend `eforge explain` in `crates/forge-cli` with opt-in `--ai`, `--provider`, `--model`, `--dry-run`, and `--no-cache` flags, orchestrating safe file reading (`resolve_safe_path`), secret redaction via `forge-security`, token-budgeted context assembly, structured AI answers with source grounding checks, and clear separation between deterministic facts and AI interpretation (PRD §20, §21, §36).\n\n- **Parent Epic:** #84\n- **GitFlow Branch:** `feat/forge-091-cmd-explain-ai`\n- **Execution Wave:** `wave-12`\n- **DAG Dependencies:** Depends on #87, #88, #89, #90\n- **Estimated Size:** ~350 LOC (`\u003c 400 LOC`)\n\n## 2. Target Files\n- `crates/forge-cli/Cargo.toml` *(MODIFY: add `forge-ai` dependency)*\n- `crates/forge-cli/src/ai/mod.rs` *(NEW)*\n- `crates/forge-cli/src/ai/orchestrate.rs` *(NEW: safe snippet collection, secret file exclusion, `forge-security` redaction, cache/budget orchestration)*\n- `crates/forge-cli/src/commands/explain.rs` *(MODIFY: integrate `--ai` and `--dry-run` flows)*\n- `crates/forge-cli/src/cli.rs` *(MODIFY: add AI flags to `Explain` subcommand)*\n- `crates/forge-cli/src/lib.rs` *(MODIFY)*\n\n## 3. Public Contract\n```rust\npub struct GroundedClaim {\n pub text: String,\n pub source: String,\n pub verified: bool,\n}\n\npub struct AiExplainAnswer {\n pub summary: String,\n pub responsibilities: Vec\u003cString>,\n pub key_dependencies: Vec\u003cString>,\n pub risks: Vec\u003cGroundedClaim>,\n pub sources: Vec\u003cString>,\n}\n```\n- CLI: `eforge explain [target] --ai [--provider \u003ckind>] [--model \u003cid>] [--dry-run] [--no-cache] [--format terminal|json|markdown]`\n\n## 4. Security & Privacy Invariants\n- Sensitive files (`.env*`, `*.pem`, `*.key`, `.git/**`, `.eforge/**`) are excluded before reading; all included code snippets are redacted via `forge_security` secret scanner before entering `ContextInput`.\n- `--dry-run` outputs the exact `ContextPack` and token estimate without instantiating any `AiProvider` or making network calls.\n- Claims whose `source` does not match a known module ID, file path, or finding ID in the analyzed `Repository` are marked `verified: false` (`[unverified]`).\n\n## 5. Definition of Done & Verification (Tier 2)\n- Tests using `MockProvider` covering full `--ai` execution, `--dry-run` (zero provider calls), disabled AI actionable error, `.env` exclusion & secret redaction, and unverified source marking.\n- **Selective Verification Gate (Tier 2):**\n 1. `cargo fmt --package forge-cli -- --check`\n 2. `cargo clippy --package forge-cli --all-targets -- -D warnings`\n 3. `cargo test --package forge-cli`\n 4. Smoke run: `cargo run --bin eforge -- explain src/services --path fixtures/next-app --ai --dry-run`","author":{"url":"https://github.com/luksluki","@type":"Person","name":"luksluki"},"datePublished":"2026-10-19T14:22:29Z","url":"https://github.com/elcode-id/elcode-forge/issues/91"}
| 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 | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:44b2732e-8129-bc01-2b4c-83e06201f9de |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 974A:1248F8:1531E8:1CCD9B:6B059790 |
| html-safe-nonce | c494560f71f5ea4f5b0dd81c744b8e95a6d0a36980d2a220129e87c59916eff5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzRBOjEyNDhGODoxNTMxRTg6MUNDRDlCOjZCMDU5NzkwIiwidmlzaXRvcl9pZCI6IjczNjM4NjA4MzI1NDEwNTQ4NjQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f8a6da1374d1e2fab518ff97c43a337165ae695259cbb625db397da87d6f74db |
| hovercard-subject-tag | issue:5925666603 |
| 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/_view_fragments/issues/show/elcode-id/elcode-forge/91/issue_layout |
| twitter:image | https://opengraph.githubassets.com/15f319e4185842c1411301d349e40b83d4a564ad0ca09952872b6a66b485b814/elcode-id/elcode-forge/issues/91 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/15f319e4185842c1411301d349e40b83d4a564ad0ca09952872b6a66b485b814/elcode-id/elcode-forge/issues/91 |
| og:image:alt | 1. Context & Objective Extend eforge explain in crates/forge-cli with opt-in --ai, --provider, --model, --dry-run, and --no-cache flags, orchestrating safe file reading (resolve_safe_path), secret ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | luksluki |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3b72fd2385d76a50ce0fe937d50bb4a81434432c4fd47866074a26f6cd03623f |
| turbo-cache-control | no-preview |
| 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