Title: feat(forge-cli): implement read-only local eforge serve API · Issue #60 · elcode-id/elcode-forge · GitHub
Open Graph Title: feat(forge-cli): implement read-only local eforge serve API · Issue #60 · elcode-id/elcode-forge
X Title: feat(forge-cli): implement read-only local eforge serve API · Issue #60 · elcode-id/elcode-forge
Description: Context & Objective Expose the ReportBundle via a minimal, read-only, loopback-only HTTP API for the dashboard live mode (PRD §35 local-first). Branch Name: feat/forge-060-cmd-serve Parent Epic: EPIC #54 (Phase 3B) DAG Dependencies: Req...
Open Graph Description: Context & Objective Expose the ReportBundle via a minimal, read-only, loopback-only HTTP API for the dashboard live mode (PRD §35 local-first). Branch Name: feat/forge-060-cmd-serve Parent Epic: E...
X Description: Context & Objective Expose the ReportBundle via a minimal, read-only, loopback-only HTTP API for the dashboard live mode (PRD §35 local-first). Branch Name: feat/forge-060-cmd-serve Parent Epi...
Opengraph URL: https://github.com/elcode-id/elcode-forge/issues/60
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat(forge-cli): implement read-only local eforge serve API","articleBody":"## Context & Objective\nExpose the `ReportBundle` via a minimal, read-only, loopback-only HTTP API for the dashboard live mode (PRD §35 local-first).\n\n- **Branch Name:** `feat/forge-060-cmd-serve`\n- **Parent Epic:** EPIC #54 (Phase 3B)\n- **DAG Dependencies:** Requires #57 (Sub-Issue 3.2)\n- **Estimated Size:** \u003c 380 LOC\n\n## Crate & File Target\n- `crates/forge-cli/Cargo.toml` *(MODIFY — add `tiny_http`)*\n- `crates/forge-cli/src/serve/{mod.rs,routes.rs}` *(NEW)*\n- `crates/forge-cli/src/cli.rs`, `crates/forge-cli/src/lib.rs` *(MODIFY)*\n\n## Strict Input/Output Rust Type Contract\n```rust\npub struct ServeOptions {\n pub repo_root: PathBuf,\n pub port: u16, // default 7878\n pub allow_origin: Option\u003cString>, // explicit origin only, never \"*\"\n pub static_dir: Option\u003cPathBuf>,\n}\n\npub struct ApiResponse { pub status: u16, pub headers: Vec\u003c(String, String)>, pub body: Vec\u003cu8> }\n\npub fn route_request(state: &ServeState, method: &str, url: &str) -> ApiResponse; // pure & unit-testable\npub fn run_serve(opts: &ServeOptions) -> Result\u003c(), ForgeError>;\n```\n\n## Endpoints (GET only)\n`/api/v1/health`, `/api/v1/bundle`, `/api/v1/findings?severity=&rule_prefix=`, `/api/v1/explain?target=`, `/api/v1/schema`\n\n## Security Requirements\n- Bind `127.0.0.1` only; methods other than `GET`/`OPTIONS` return `405`.\n- CORS without wildcard: only the explicit `--allow-origin` value is echoed.\n- `ETag` = BLAKE3 of the serialized bundle; `Cache-Control: no-store`; `X-Content-Type-Options: nosniff`.\n- `--static-dir` paths resolved through `resolve_safe_path` (traversal rejected).\n\n## Definition of Done (Tier 2 Verification Gate)\n```bash\ncargo fmt --package forge-cli -- --check\ncargo clippy --package forge-cli --all-targets -- -D warnings\ncargo test --package forge-cli -- serve::\n```\n## Global Invariants (AGENTS.md)\n- GitFlow: branch off `develop`, PR targets `develop`, squash-merge, update `docs/ARCHITECTURE_STATE.md`.\n- Zero-panic in `crates/forge-*` (no `unwrap/expect/panic/todo/unimplemented`); Rust core stays 100% UI-agnostic.\n- Determinism: identical repo state + config => byte-identical output (no wall-clock timestamps).\n- Repository text is hostile input: never rendered via `{@html}`, never executed.\n- Plan reference: Phase 3 Dashboard Plan (approved 2026-10-19).\r\n","author":{"url":"https://github.com/luksluki","@type":"Person","name":"luksluki"},"datePublished":"2026-10-19T07:23:17Z","url":"https://github.com/elcode-id/elcode-forge/issues/60"}
| 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:79812045-cc4c-fe5e-71a8-6b4630729ad6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E9C0:2FEFED:7DC22D:AD2E73:6B05980B |
| html-safe-nonce | 39f41a625551d898c3c78480cb4de30f00fb25d7732d9adc0663c740827186dd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOUMwOjJGRUZFRDo3REMyMkQ6QUQyRTczOjZCMDU5ODBCIiwidmlzaXRvcl9pZCI6IjMyMTkyOTUwMzIwMjQ4NjQ3NzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7e79ade689e4fc1c766ca510e3b095e16834dfa43ee65a97874ccd18a65c6031 |
| hovercard-subject-tag | issue:5919653107 |
| 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/60/issue_layout |
| twitter:image | https://opengraph.githubassets.com/981601397e34be35dc63cf88bfe5ab406f172aee1c881ca2e68e27569450fccc/elcode-id/elcode-forge/issues/60 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/981601397e34be35dc63cf88bfe5ab406f172aee1c881ca2e68e27569450fccc/elcode-id/elcode-forge/issues/60 |
| og:image:alt | Context & Objective Expose the ReportBundle via a minimal, read-only, loopback-only HTTP API for the dashboard live mode (PRD §35 local-first). Branch Name: feat/forge-060-cmd-serve Parent Epic: E... |
| 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