Repository navigation
refactor: merge duplicate helpers, remove dead code, add a lint step - #71
Merged
Merged
Conversation
danoszz
force-pushed
the
refactor/cleanup
branch
from
October 20, 2026 12:15
a7dc6c3 to
4621e6d
Compare
… fetches - lib/git.js: the safe git config and runner, now used by the agent loop's allow-listed runner, the pre-commit hook, lockfile reads at a ref and project detection (four copies before). Reads that must see the repo's real core.hooksPath opt out with `raw: true`. - lib/tmp.js: withTempDir() for the hook's and install's scratch folders. - src/report/md-escape.js: mdCell() for the CI report tables (four copies). - src/utils/http.js: fetchJson() for recon's three fetch-and-parse blocks. AI-Assisted: Claude Code with Claude Opus 5.5; merged the duplicate helpers into single modules Co-Authored-By: Claude Opus 5.5 <[email protected]>
- eslint.config.js: recommended rules minus style-only ones; `npm run lint` runs in CI before the tests. ESLint is a devDependency only; the package still has one runtime dependency. - Removed exports nothing referenced (findShadowEndpoints, getTemplateStats, DEPS_FLAGS, stagedFiles), an unused runFile helper in machine.js, and unused imports and bindings the lint found. AI-Assisted: Claude Code with Claude Opus 5.5; set up the lint step and removed what it found unused Co-Authored-By: Claude Opus 5.5 <[email protected]>
AI-Assisted: Claude Code with Claude Opus 5.5; added the Changed entry Co-Authored-By: Claude Opus 5.5 <[email protected]>
danoszz
force-pushed
the
refactor/cleanup
branch
from
October 20, 2026 14:12
4621e6d to
0d08f52
Compare
Dependency capability diffCompared against Upgrades that gained capabilities
New packages
Evidence (file:line)ajv@6.15.0
cross-spawn@7.0.6
debug@4.4.3
eslint@10.12.0
penthera deps v1.7.0: offline static analysis, no telemetry. Capabilities are what code can do, not a verdict. Checked by Penthera, open-source security for the apps and AI systems you ship · https://github.com/danoszz/penthera Updated for commit |
danoszz
added a commit
that referenced
this pull request
Oct 20, 2026
… diff-bound approvals into the redesign main (#70, #71) moved the dashboard to a bearer session in the URL fragment and sessionStorage, a fetch-based run stream, SHA-256-bound approvals and cut-diff acknowledgement, in files the redesign had rewritten. Resolved by keeping the redesigned files and porting each change into them: - app.js: signIn() before the first API call. - center.js: the run stream uses api.stream; Apply (button, y, or y from the transcript) sends diffSha256 of the diff as shown; a cut diff shows the warning and needs the box ticked before Apply or y works. - panels.js, menubar.js: report downloads go through api.download, since a plain link cannot carry the session header (it now gets a 401). - right.js: session wording in Settings. - tests/ui.test.js: static files need no session now; the font and logo test checks type and content instead. - docs/dashboard.md: the cut-diff and SHA-256 rules move into the approval window paragraph; reopening a run points at the menu bar and History. - scripts/dashboard-screenshots.mjs: the #t= link, and globalThis for page globals (new lint step). AI-Assisted: Claude Code with Claude Opus 5.5; resolved the merge conflicts and ported main's session and approval changes into the redesign Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code cleanup with no behaviour change. Stacked on #70 (base
fix/security-review-2), so retarget tomainafter #70 merges. PR #63 is still open, so this PR doesn't touch the dashboard client.What changed
src/agent/git.js,lib/hook/index.js,lib/deps/lockfile.js,src/cli/detect.jslib/git.js: safe config,git(),gitSpawn(),gitToplevel(). The loop's allow-list runner builds on it. Reads that need the repo's realcore.hooksPathpassraw: truemdInlineplus 4 hand-rolled table-cell escapes in CI scriptssrc/report/md-escape.js:mdInline(untrusted text) andmdCell(our own CI tables)fetchJson()insrc/utils/http.js(on top of #70'sreadBody)mkdtemp+try/finally rmSyncin hook and installlib/tmp.js:withTempDir()findShadowEndpoints,getTemplateStats,DEPS_FLAGS,stagedFiles(never referenced),runFilein machine.js, unused imports and bindingseslint.config.js(recommended rules minus style-only ones),npm run lint, and a CI step before the tests. ESLint 10.12.0,@eslint/js10.0.1 and globals 17.12.0 are pinned exactly, each at least two weeks old, and are dev-onlyUnused flags: none found. Every parsed option is read and documented.
fix --planis the documented default mode.Module splits: none. The largest files are cohesive:
lib/machine.js(machine audit),lib/injections.js(probes) andlib/deps/index.js.src/cli.jsis mostly a single 600-linerun(), and splitting it would be a rewrite while #70 and #63 are in flight.Runtime dependencies: still exactly one (
yaml).Numbers
bin+src+lib+scriptstestslib/git.js,lib/tmp.js)The line count barely moves. The gain is one place each for the git safety config, escaping and temp folders, not a smaller codebase.
Tests
npm run lint: clean.npm test: 1,010 passed, 21 skipped, the same as fix(security): fail closed in deps, hook and git; bound the dashboard, HTTP and regex paths #70. The test edits only remove unused imports (tests/ui.test.js,tests/validate-report.test.js,tests/pentest-adaptive.test.js) and one unusedconst result =binding; no assertion changed.npm run audit:internal: all gates pass.Small side effects
checkout-indexand the lockfile anddetectreads now run with the same safe config overrides as the loop: no hooks, no signing, no attributes file. For a normal repo the output is the same.nullbody, it returns no results instead of throwing.🤖 Generated with Claude Code