Title: fix(forge-cli,forge-rules): preserve cached security findings in incremental scan & JSON-safe package.json autofix · Issue #261 · elcode-id/elcode-forge · GitHub
Open Graph Title: fix(forge-cli,forge-rules): preserve cached security findings in incremental scan & JSON-safe package.json autofix · Issue #261 · elcode-id/elcode-forge
X Title: fix(forge-cli,forge-rules): preserve cached security findings in incremental scan & JSON-safe package.json autofix · Issue #261 · elcode-id/elcode-forge
Description: Part of #256. Scope Fix execute_scan incremental security scanning in crates/forge-cli/src/commands/scan.rs using FileFindingsCache (#257) so unchanged files retain their cached security findings and only newly added/modified files are r...
Open Graph Description: Part of #256. Scope Fix execute_scan incremental security scanning in crates/forge-cli/src/commands/scan.rs using FileFindingsCache (#257) so unchanged files retain their cached security findings a...
X Description: Part of #256. Scope Fix execute_scan incremental security scanning in crates/forge-cli/src/commands/scan.rs using FileFindingsCache (#257) so unchanged files retain their cached security findings a...
Opengraph URL: https://github.com/elcode-id/elcode-forge/issues/261
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fix(forge-cli,forge-rules): preserve cached security findings in incremental scan & JSON-safe package.json autofix","articleBody":"Part of #256.\n\n## Scope\n- Fix `execute_scan` incremental security scanning in `crates/forge-cli/src/commands/scan.rs` using `FileFindingsCache` (#257) so unchanged files retain their cached security findings and only newly added/modified files are re-scanned (while 0-change runs skip redundant file scanning).\n- Fix `build_unused_dep_fix` in `crates/forge-rules/src/autofix.rs` to handle removing the final property in `package.json` without leaving an invalid trailing comma on the preceding line.\n- Update `build_forbidden_import_fix` in `crates/forge-rules/src/autofix.rs` so comment-out fallback edits set `is_safe_automated: false` (reserving `true` for real service-layer import rewrites).\n\n## Out of scope\n- Changing `.eforge/tx/` transaction manifest schemas or rollback storage formats.\n\n## Acceptance criteria\n- Running `execute_scan` with `incremental: true` after modifying 0 or 1 file produces findings identical to a full `execute_scan` (`incremental: false`), including security findings in untouched files.\n- Removing the last dependency entry in `package.json` via `generate_fix_plan` + `apply_fix_plan_transactional` produces strictly valid JSON (`serde_json::from_str` succeeds).\n\n## Technical notes\n- Populate and save `FileFindingsCache` during both full scans (when `.eforge/` exists) and incremental scans so incremental scans always start from consistent per-file finding state.\n- When removing a line from `package.json` that does not end with `,`, check if the previous line ends with `,`; if so, emit a 2-line `TextEdit` removing both the trailing comma on line `n-1` and line `n`.\n\n## Dependencies\n- Blocked by: #257\n\n## Definition of Done\n- [ ] Implementation completed in `crates/forge-cli/src/commands/scan.rs` and `crates/forge-rules/src/autofix.rs`.\n- [ ] Unit/integration tests verify full vs incremental scan finding parity and valid JSON after removing the last `package.json` dependency.\n- [ ] Tier 1 (`forge-rules`) and Tier 2 (`forge-cli`) checks pass cleanly.\n- [ ] `docs/ARCHITECTURE_STATE.md` updated and PR squash-merged to `develop` after 100% green CI.\n","author":{"url":"https://github.com/luksluki","@type":"Person","name":"luksluki"},"datePublished":"2026-11-17T05:25:54Z","url":"https://github.com/elcode-id/elcode-forge/issues/261"}
| 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:095670f5-7a08-5a0d-bdfc-de7fa5ccb5b5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A20E:343AF8:57A75:77F54:6B0593E1 |
| html-safe-nonce | e611e711378c1f9b653a7f29cda0694a140ba01ad104541d51f836e204446ad7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjBFOjM0M0FGODo1N0E3NTo3N0Y1NDo2QjA1OTNFMSIsInZpc2l0b3JfaWQiOiIyNzI3OTIxNDM0NDQwODY0NzM3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d6cf5ea6dd067bab892221aa2a7c81ccc86ab083a3acb5856444fafa273f83bc |
| hovercard-subject-tag | issue:6438044991 |
| 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/261/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a33554d29c4352b31ad3c2e154251b97fb50b89e498b5006d90b2bbbb234f5cc/elcode-id/elcode-forge/issues/261 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a33554d29c4352b31ad3c2e154251b97fb50b89e498b5006d90b2bbbb234f5cc/elcode-id/elcode-forge/issues/261 |
| og:image:alt | Part of #256. Scope Fix execute_scan incremental security scanning in crates/forge-cli/src/commands/scan.rs using FileFindingsCache (#257) so unchanged files retain their cached security findings a... |
| 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