Repository navigation
docs: agent-scan reverse engineering - #514
eugene-eko2000 wants to merge 1 commit into
Conversation
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can hide the parts of a finding you never read, like the evidence or the agent prompt |
PR Summary by QodoDocument reverse-engineered CLI execution flows
AI Description
Diagram
High-Level Assessment
Files changed (11)
|
docs: add reverse-engineered CLI execution flow diagrams
Summary
Adds
docs/cli-flows/, a set of Mermaid sequence diagrams that document how eachsnyk-agent-scancommand actually executes. The CLI has grown incrementally, and there was no single place showing how responsibilities are split between client-machine I/O, flow logic and backend calls. This is documentation only: no source, test or config files are changed.What's included
README.mdscan.mdinspect.mdevo.mdhelp.mdguard-status.mdguardwith no subcommandguard-install.mdguard-uninstall.mdguard-discover.mdguard-hook-runtime.mdshared-subflows.mdEvery diagram groups participants into the same four layers: User, Flow logic, Client machine resources (filesystem, env/OS, SQLite, subprocesses) and Backends (remote MCP servers, Snyk APIs, Agent Monitor). The split is visible at a glance.
Key findings (detailed in
README.md)AgentDiscovererclasses) run for the same agents and are merged afterwards.codesign,powershellandwsl.exe. SQLite is used only for the opencode project list.command == ...checks inside shared helpers.evodiscards the scan result, so nothing is printed. It does not revoke the key if the scan raises, and it exits 0 even when min--storage-file,--checks-per-server,--no-bootstrap.--control-serveris documented as never called.aiohttp,urllib,httpx,curl) with inconsistent retry policies.guard.pyis a ~2100-line module that mixes several concerns.How it was produced
Derived by reading the source at v0.6.9 (
cli.py,pipelines.py,inspect.py,verify_api.py,guard.py,agents/*, hook scripts executed.Testing
with Mermaid 11. A negative test confirmed the checker rejects invalid input.
Notes for reviewers
changes. The suggested seams in the README are suggestions only. -
docs/README.mdis not updated toay if you want that added.Note
Low Risk
Documentation-only addition with no runtime or build impact; main risk is diagram drift as the CLI evolves.
Overview
Adds
docs/cli-flows/, documentation-only reverse engineering ofsnyk-agent-scanv0.6.9: Mermaid sequence diagrams for every CLI command (scan,inspect,evo,help, and allguardsubcommands), plus shared sub-flows (bootstrap, discovery, inspection, analysis) and guard hook runtime behavior.The index ties commands to a flowchart, maps responsibilities across User / Flow logic / Client machine / Backends, and records cross-cutting findings (dual discovery, unused flags, HTTP/retry inconsistencies,
evo/guardquirks) with optional refactor seams. No application code, tests, or config change—diagrams were parse-checked with Mermaid 11.Reviewed by Cursor Bugbot for commit 5cb402b. Bugbot is set up for automated code reviews on this repo. Configure here.