All notable changes to Shingan are documented here. Format follows Keep a Changelog, versioning follows SemVer.
- Go toolchain 1.25.11 → 1.26.10 and vulnerable dependencies upgraded so the
govulncheck CI gate passes again. The Go 1.25 line's standard library has
reachable crypto/tls, crypto/x509, net/http, net/textproto and html/template
vulnerabilities that are fixed only in go1.26.9+. Modules:
golang.org/x/netv0.60.0,golang.org/x/textv0.42.0,google.golang.org/grpcv1.83.1,go.opentelemetry.io/otel*v1.45.0 (sdk/logv0.21.0). The new dependency set requiresgo 1.26.0, so the minimum Go forgo installis now 1.26 (older toolchains auto-download it under the defaultGOTOOLCHAIN=auto). CI, release, CodeQL, the composite action and the Docker builder image all use 1.26.
shingan analyzeis easier to call. The path can be given positionally (shingan analyze workflow.json,shingan analyze ./agents/);--inputstill works. When--formatis omitted the format is auto-detected from the extension + content and falls back tojsonwhen nothing matches, so every invocation that worked before still works — but an n8n export no longer fails withunknown node type string "n8n-nodes-base.…"under the old json default. Explicit--format autostays strict (errors on unknown input) for hooks. When--outputis omitted, findings print as Markdown on a terminal and as JSON when stdout is piped/redirected or--output-fileis set (scripts and CI see no change).-ois a new short alias for--output.- Directory input for n8n.
shingan analyze ./n8n-workflows/analyzes every JSON file that sniffs as an n8n export (one graph per file, ADR-012); unrelated neighbours likepackage.jsonare ignored instead of warned about. - Directory walks skip dependency trees (
node_modules,.git,.venv,venv,__pycache__,.tox,.mypy_cache,site-packages) — a LangGraph.js project'snode_moduleswas previously walked file by file. - The pre-commit hook now defaults to
--format autoinstead of hard-coding--format langgraph, so it works on non-LangGraph projects without config.
- Security/cost rules now fire on the langgraph-js parser. The AST shim
previously extracted only graph structure, so
secret_in_prompt_template,prompt_injection_sink, andunbounded_tool_argnever fired on@langchain/langgraphworkflows (shingan's security value proposition didn't reach the biggest TS agent framework). The shim now lifts security-relevant config out of node handlers: LLM-node prompt strings (SystemMessage("…"),{role:"system",content:"…"}, model.invoke/.streamstring args, and prompt-namedconstbindings) →config.system_prompt; and tool zod schemas (tool(fn,{schema:z.object({…})})resolved through aToolNodeaggregate) →config.args_schemaas JSON-schema (z.string().max(n)→maxLength,z.array().max(n)→maxItems, etc.). Extraction is additive — it adds no nodes/edges (so it cannot create anunreachable_nodeFP) and degrades gracefully on exotic zod / unresolvable prompts (ADR-015). Verified: hardcodedAKIA…/sk-…in a prompt and an unboundedz.string()arg now fire;process.env.…prompts andz.string().max(4000)args stay clean.
-
Modern OpenAI keys were not detected by
secret_in_prompt_template/secret_exposure(#53).sk-proj-…,sk-svcacct-…andsk-admin-…keys carry-/_in the body, which the legacysk-[A-Za-z0-9]{20,}pattern stopped at. Both rules now match those prefixes (legacy keys still match). -
GHCR image reported version
dev(#48). The Dockerfile now takes aVERSIONbuild-arg injected intoversion.Version, and the release workflow passes the tag fromdocker/metadata-action. -
tool_description_missingfired on LangGraph's prebuiltToolNode(#39). The aggregate dispatcher's descriptions live on the wrapped tools; both the langgraph-js and Python LangGraph shims now tag itconfig.tool_dispatcherand the rule skips it (security rules such asunbounded_tool_argstill see its merged schema). -
pydantic-graph: impossible cycle from an
if False:-gated back-edge (#40). An annotation leaf whose only body return sits in a literal-constant dead branch (if False:/if 0:/while False:/ theelseofif True:) is no longer drawn as an edge. Leaves with no body return at all are still kept. -
--format autodirectory detection broke ties by Go map order; ties now resolve lexicographically. The auto-detect notice is written to the command's stderr writer instead ofos.Stderrdirectly. -
Regression test locking
cycle_detection's reported node across every edge emission order (#43; the fix itself shipped in #56). -
langgraph-js ternary-return router false
unreachable_node(2nd external dogfood run) — a path-map-lessaddConditionalEdges(node, router)whose router returns its destination via a ternary (cond ? "answer" : "rewrite", in a concise-arrow body or via aconst t = …; return tbinding) dropped both branch targets, falsely flagging them unreachable. The router-return harvester now recurses through ternary arms, parentheses, concise arrow bodies, and const-bound identifiers (if / switch-return routers already worked). -
unreachable_nodefalse positives surfaced by the external dogfood loop (35 real OSS repos scanned; these FPs would have caused false upstream reports):- langgraph-js START fan-out — when
__start__routes to ≥2 nodes (addEdge(START, A); addEdge(START, B)oraddConditionalEdges(START, …)), the shim kept only one successor as the entry and dropped the rest, so the others fired falseunreachable_nodeat confidence 1.0.__start__is now materialised as a synthetic Control entry node with an edge to each successor so reachability flows to every parallel entry (single-successor graphs are unchanged — no synthetic node). - langgraph-js multi-
StateGraphcollapse — a file declaring multiplenew StateGraph(...).compile()graphs (esp. reusing the same variable name) merged them under one root, false-flagging graphs 2..N's nodes. ≥2 disjoint builders now setentry_ambiguous(mirrors the pydantic-graph multi-Graphfix), so reachability skips rather than inventing unreachable findings. - llamaindex externally-injected HITL events — a
@stepconsuming a human-in-the-loop event injected viactx.send_event(HumanResponseEvent(…))from the run() driver (produced by no@step) was falsely flagged unreachable.HumanResponseEvent/InputRequiredEvent(subclass / alias aware) are now treated as externally-injectable, so HITL steps stay reachable. Verified: 14 falseunreachable_nodeacross the wild repos (Magic-Resume, tiangong) → 0;cycle_detection(correct bounded warnings) unchanged.
- langgraph-js START fan-out — when
domain.Nodeに頻出設定の typed field を追加 (MaxIterations,ToolCategory,ModelName,Temperature,MaxConcurrency) と typed accessor (GetMaxIterations等)。ルールは Config map の string キーを直接読まず accessor 経由で参照するようになり、domain 層が parser-private な string contract に依存しないという Onion 原則 (ADR-003) が一段強化された。accessor は typed field を優先し、旧Config["..."]キーへ後方互換フォールバックするため 既存 JSON 入力はそのまま動作する。adk-go / n8n parser は typed field も populate する。(audit-driven)LangGraphParserがディレクトリ解析時に worker pool (デフォルト 2 並列) を 使うようになった。--workers Nフラグでチューニング可 (N=1で従来の直列 挙動、0でデフォルト)。ParseFilesMultiが primary + sibling worker に ファイルを分配し、結果は path 順にソートして決定論を維持。単一ファイルのParse/ParseFileは従来通り 1 worker。(audit-driven)ConfidenceReason必須化チェック (ADR-008) を awk shell script (scripts/check_confidence_reason.sh、削除) からgo/analysisベースの自前 vet analyzer (tools/cmd/check-confidence-reason) に置換。inline リテラルに 加え、構築後の代入 (f := domain.Finding{...}; f.ConfidenceReason = ...) や factory 関数経由の生成も検出できるようになった。make check-reason/make lintの pass/fail 挙動は同じ。- Vertex demo GCP project is read from the environment / a flag — no more
hardcoded real project ID. The demo binaries (
cmd/runner,cmd/shingan-web) and helper scripts hardcoded a real-looking project ID (axial-mercury-…). They now resolve the project from--project(runner only) >$VERTEX_PROJECT$GOOGLE_CLOUD_PROJECT, falling back to the obvious placeholderyour-gcp-project-idwith a stderr hint when unset (Vertex AI rejects the placeholder rather than touching a real project). The real ID is removed from the Go sources,scripts/demo.sh,scripts/web-demo.sh(now errors if no project is set), andcmd/shingan-web/README.md. Unit tests cover the resolution precedence. Closes #32. - GitHub Action pins the CLI to the action ref instead of
@latest.action.ymlrango install …/cmd/shingan@latest, so even a workflow that pinneduses: hatyibei/shingan@v0.9.0silently ran the newest CLI — non-reproducible CI and a supply-chain footgun. The install step now derives the CLI version fromgithub.action_ref(the tag the caller pinned), so the action tag and CLI version stay in sync automatically, falling back to the current pinned release (v0.9.0) for localuses: ./refs. Closes #30.
- Baseline fingerprint から
Messageフィールドを除外し、(RuleName, NodeID, SourceFile, MessageDigest)ベースに変更 (ADR-016)。MessageDigestはRuleWithMessageTemplate実装ルールではテンプレート ID、 未実装ルールではメッセージの数値リテラルを[N]に正規化した SHA-256 先頭 16hex。ルール文言の typo 修正や fan-out 数値変動で baseline が無効化される 問題を解消。引用リテラルは finding 識別子として保持する:unbounded_tool_arg等は 1 node に対し offending field ごとに finding を出し、同一 node のfield "query"とfield "payload"は引用部分だけで区別されるため、これを[S]へ潰すと baseline が新規 finding を誤抑制してしまう (codex review P2)。 node 名のメッセージ内ドリフトは別フィールドのNodeIDで既に吸収済み。 - Baseline JSON schema が v2 に。旧 v1 ファイル (
message全文,version不在) は読み込み時に digest へ自動移行 (warning 表示)、save 時は v2 で書き出す。
shingan feedbackサブコマンド + capture-only feedback store (#3, ADR-018)。 finding に対する true/false positive ラベル (tp/fp) を、baseline と同じ 安定 fingerprint (rule + node_id + source_file + message_digest) をキーに JSONL へ追記する。単発追記 (--rule/--node/--messageまたは--digest) と ファイル一括 ingest (--ingest、analyze --output jsonの finding 形状を そのまま受け付け) の 2 モード。confidence は fingerprint に含まれないため ラベルは confidence ドリフト後も有効。capture-only: 何も解析パイプライン に読み戻さず、shingan analyzeの出力は byte-for-byte 不変。Bayesian/ML 較正 エンジンは ADR-018 に design knobs を記録のうえ意図的に defer。domain.FeedbackRecord/infrastructure/feedback/docs/feedback.md。--format=openai-agentsparser (Experimental PoC, v0.9) for the OpenAI Agents SDK (@openai/agents). Extracts multi-agent handoff graphs from TypeScript/JavaScript via the TypeScript Compiler API in a Node shim (export_openai_agents_server.mjs), reusing the Mastra / LangGraph.js Node worker +typescriptbootstrap wholesale. One node per declarednew Agent({...})/Agent.create({...})(alias-aware on the@openai/agentsimport), keyed by the agent'sname(or binding name);handoffs: [b, handoff(c)]becomes directed edges agentA→B, agentA→C, andtools: [child.asTool(...)]agents-as-tools become edges too. Handoff targets are resolved to declared agents only (dest-must-be-declared — cross-module / computed targets are omitted, never fabricated), mirroring the LangGraph.js gate. Entry = the zero-in-degree agent; multiple roots setentry_ambiguous. Like AutoGen / Mastra there is no exit sentinel:has_exit_branchis never set, so a pure handoff loop stays Critical and a loop with a structural handoff out of the cycle downgrades to Warning viacycleHasExit. Validated on wild@openai/agentsrepos (faithful 7-agent triage graph, agents-as-tools orchestrator, no phantom edges). Wired into the factory and the CLI directory-walk extension set. (ADR-015)- Plugin SDK ABI version 互換チェック (
domain.VersionedRule.PluginSDKVersion())。 既存のManifest.MinShinganVersion(リリース版) に加えて SDK signature 世代も 検証する独立した防衛線。起動時にplugin.VerifySDKCompatibility()が登録済み ルールを binary のサポート範囲 (plugin.MinPluginSDK..MaxPluginSDK) と比較し、 範囲外プラグインは panic ではなく exit code 3 (config error) で蹴られる。VersionedRule未実装ルールは従来通りスキップ (opt-in)。(audit-driven) domain.RuleWithMessageTemplateinterface — ルール作者が安定したMessageTemplateID()を提供できる optional API。orchestrator が該当ルールの finding にFinding.MessageTemplateIDを stamp し、baseline digest が文言変更 に影響されなくなる。- Multi-arch container image published to GHCR.
git push --tagsnow also builds and pushesghcr.io/hatyibei/shingan(linux/amd64 + linux/arm64) in a dedicateddockerrelease job that runs after goreleaser, so a Docker build/push failure can't roll back the already-published binaries or npm package. The README'sdocker pull ghcr.io/hatyibei/shingannow resolves; the Dockerfile cross-compiles perTARGETARCH(a plaindocker buildstill works for single-arch local use).
- README / README.ja の Rules 表に
human_gate_missing(Warning, 0.6) とtool_description_missing(Info, 0.6) を追記し、severity / confidence を 公開。docs/rules/human-gate-missing.mdとdocs/rules/tool-description-missing.mdを新規追加。(audit-driven) - Documented the real
application-layer dependency graph (ADR-017). The docs claimed "application depends only on domain", but the code has two deliberate exceptions:application → gopkg.in/yaml.v3(policy parsing) andapplication → plugin(rule-catalog rendering), wherepluginfurther pullsdomain/rules/version/x/mod/semver. A faithful refactor would ripple into the publicpluginSDK surface, so — per the lower-risk option — the real graph is documented (new ADR-017 + a §7 indocs/architecture.md/.ja.mdand a dependency-table note) rather than claiming a purity the code doesn't have. No code change; behavior unchanged. Closes #31. - Synced
docs/architecture.md/.ja.mdto the v0.9 implementation. The architecture docs were frozen at v0.1: they referenced a non-existentdomain/analyzerpackage, "five analysis rules", a hardcoded 5-ruleAnalyzerFactorymap, andmodel//rule/sub-packages that don't exist. Corrected to reality — thedomainpackage +domain/rules(22 built-in rules self-registered viainit()→rules.AllBuiltins()), the registry-based factory, 11 framework parsers total (5 added in v0.9), theLocalRule/PathRule/GlobalRuletier interfaces, and Markdown/JSON/SARIF reporters. Genuine historical narrative (README roadmap, the v0.1-false-positives use-case note, ADR-003's as-decided design) is left intact. Closes #33. - Operational-contract consistency sweep (external-review-driven). Fixed
stale surface docs that contradicted the code: the README / README.ja Go
badge
1.23→1.25(matchesgo.mod+ CI),SECURITY.mdsupported versions0.1.x→0.9.x, anddocs/severity-policy.mdcorrected to state that a malformed policy is a fail-fast hard error (exit non-zero before any analysis) rather than a non-fatal fallback — matchingcli/analyze.go.
-
npm postinstall integrity check is now fail-CLOSED.
npm/scripts/postinstall.jspreviously warned and continued when the downloaded archive's sha256 didn't match (or whenchecksums.txtwas missing/unreachable, or the archive wasn't listed in it) — a fail-OPEN path that would silently install a tampered or unverifiable binary. The install now aborts with a non-zero exit on a checksum mismatch, an unreachable/missingchecksums.txt, OR a missing checksum entry. The only escape hatch is the existing, explicit, opt-inSHINGAN_SKIP_POSTINSTALL=1(air-gapped/CI-mirror), which skips the download entirely — there is no "download but skip verification" mode. The verify logic was extracted into a pureverifyChecksum()and covered bynpm/test/postinstall.test.js(npm test), including an end-to-end fixture that asserts a tampered download exits non-zero and installs nothing. Closes #29. -
Bumped
golang.org/x/netto v0.55.0, the Go toolchain to 1.25.11, and added a govulncheck CI gate.govulncheckflagged GO-2026-5026 (Punycode/IDNA label-rejection bug ingolang.org/x/net/idna) as reachable in v0.54.0 — the trace runs throughsignal.Notify→idna.ToASCIIincmd/api; v0.55.0 fixes it. The new gate then surfaced a second problem the project had been shipping silently: CI/release built on Go 1.25.3, whose standard library carries 18 reachable vulns (crypto/tlssession resumption,crypto/x509name-constraint / error-string DoS, severalnet/*), fixed across 1.25.6–1.25.11. The Go toolchain is bumped to 1.25.11 across all CI jobs + release, plus atoolchain go1.25.11directive ingo.modsogo install …/cmd/shingan(the GitHub Action path) and local builds get the same patched stdlib the release ships. A dedicatedgovulncheckCI job (pinned togovulncheck@v1.3.0, not@latest, for reproducibility) runsgovulncheck ./...on every push/PR, failing only on reachable vulnerabilities — so it will, by design, go red when a future stdlib/dependency disclosure lands, prompting a toolchain/dependency bump (keep the scanner Go version == the release Go version so it scans exactly what ships). Closes #28.
- v0.9 framework parsers — 5 wild-dogfood false-positive / false-negative
fixes (19 real OSS repos across all 5 new parsers; 0 crashes). Each fix was
reproduced on a wild repo, covered by a regression fixture, and checked for
same-parser regressions on the other wild targets:
- pydantic-graph: a file declaring multiple
Graph(nodes=[...])(a parent graph + a subgraph) was merged into one node set with one inferred entry, so the other graph's nodes fired falseunreachable_nodeat confidence 1.0 (X-Zero-L/pydantic-ai-deep-research: 4 FPs). The shim now tracks node sets perGraph()decl; ≥2 declared graphs →entry_ambiguousso reachability correctly skips (cycle_detection etc. unaffected). - autogen:
_resolve_refnow resolvesself.<attr>agent references (ast.Attribute) — recovering entire class-basedDiGraphBuildergraphs that were silently dropped (Austinggg/CreAgentive, the canonical idiom) — and no longer registers afor-loop control variable as a phantom node (hugocool/FateForger: falseunreachable_nodeon a node literally namedagent). - mastra: a bounded
.dountil(...).map(...)loop was flagged Critical "graph definition error" because the node-less.map/.sleepcontinuation dropped the structural exit edge; the frontier now advances through pass-throughs so the loop downgrades to the correct Warning (hashintel/labs). - langgraph-js: a routing node whose handler is
this.method.bind(this)and whose edges are declared via theaddNode(…, { ends: [...] })option lost both outgoing edges → falseunreachable_nodeontools.resolveHandlerFnnow unwraps.bind()+ resolvesthis.methodagainst class methods, and theends:[...]option is parsed into edges (agentailor/fullstack-langgraph-nextjs-agent; the ReAct+human-approval cycle is now modeled). - llamaindex: an aliased
Contextparam (ctx: AnyContext) andStartEvent/StopEventsubclasses collapsed whole workflows to 0 edges (zylon-ai/private-gpt: 6/7 files). The shim now treats anyctx/contextparam as the Context regardless of annotation and matches event classes by base leaf, recovering the real workflow graphs.
- pydantic-graph: a file declaring multiple
.shingan.yamloverrides[].pathsの**glob が区切り文字を検査せずlegacy/**がlegacy_v2.pyにもマッチしていた。bmatcuk/doublestar/v4ベースに置換し、中間**(src/**/test.py) も正しく動作するようになった。 パスは forward-slash に正規化してから照合するため Windows パスでも一貫した 挙動になる。policy override が意図通り適用されない警告ミスを修正。(audit-driven)- Findings の最終 sort で同一
(severity, confidence, rule, source_file)の場合に Go map 反復順がそのまま結果順になり、実行ごとに markdown / SARIF レポートの diff readability が壊れていた。tiebreaker にNodeIDを追加し、Analyze/AnalyzeMulti双方を共通のfindingLess比較関数に統一して完全決定論化。 (audit-driven) - 埋め込み Python / Node shim のキャッシュ展開 (
~/.cache/shingan-shims/<ver>/) で atomic 書き込み (temp file + rename) と flock (gofrs/flock) を導入。-ldflags -X ...embeddedShimVersion=...を忘れた dev ビルドが同一ディレクトリ を共有してもファイル競合でSyntaxErrorを出さなくなった。dev ビルドの cache key をvdevからdev-<goos>-<goarch>-<binary-sha256[:8]>に変更し、 ローカルビルド間の衝突を防止。(audit-driven) - Python / Node worker (
PythonWorker.Call) の JSON-RPC framing 健全性を強化:- Python shim 内で
os.dup2(2, 1)により C 拡張等の stray な fd1 書き込みを stderr へ redirect。fd1 はプロトコル専用に dup した private fd で使用する。 - Go 側は ID 不一致・パース失敗・フレームサイズ超過 (デフォルト 16 MiB,
WithMaxFrameで調整可) を protocol corruption として worker を即時 terminate し、上位呼び出しに error を返す (Closed()で再 spawn を促す)。 - フレーム読取りは
bufio.ReadSliceループで上限を強制し、ReadBytesが 無制限に成長する問題を解消。 - 結果として長寿命 LSP / MCP プロセスで stray stdout 起因の永続的 ID ずれが 発生しなくなった。(audit-driven)
- Python shim 内で
-
Six new framework parsers — TypeScript joins shingan's language scope.
--formatgained:langgraph-js— LangGraph.js (@langchain/langgraph), TypeScript / JavaScript, parsed via the TypeScript Compiler API in a Node shim.mastra— Mastra (mastra.ai) TS workflows (createWorkflow().then()…).pydantic-graph— pydantic-ai'spydantic_graph(BaseNode.run()).llamaindex— LlamaIndex Workflows (event-driven@stepmethods).autogen— Microsoft AutoGen GraphFlow (DiGraphBuilder).
Each maps its framework onto the framework-agnostic
WorkflowGraphIR, so the existing 22 rules run unchanged. The TypeScript shims requirenodeand install theirtypescriptdependency on first use ("runtime npm install" — keeps the binary ~8.6 MB rather than embedding a ~10 MB compiler); the Python shims are AST-only and need no framework install. PoC-level: each parses idiomatic workflows; see per-format limits (dynamic graphs, closure branch conditions, split-builder chains). Validated by a cross-framework wild-repo dogfood sweep before release. -
NodeTypeTaskIR node type — a leaf unit of agent work (CrewAITask, and analogous "step" units in other frameworks), distinct fromNodeTypeTool. The tool-oriented rules (error_handler_checker,eval_missing,pii_leak_scanner,unbounded_tool_arg,retry_storm, …) do not fire on it; error handling for a Task is the framework's concern (task-level retries / guardrails), not a graph-level conditional edge. -
shingan demosubcommand — runs a small embedded workflow through the full analyzer pipeline and prints a real markdown findings report. No input file needed; exits with the standard0/1/2semantics so it doubles as a one-line install smoke test. The bundled sample (cli/embedded/demo.json) intentionally triggersloop_guard(Critical) +unreachable_node(Warning) so the demo exits 2. -
Guided banner when
shinganruns with zero args — replaces cobra's default "wall-of-usage" with a four-line pointer atshingan demo/shingan analyze --input/shingan --help. Closes the "I rannpx shingan-lintand nothing useful happened" UX gap. -
--helpexamples —shingan --helpandshingan analyze --helpnow ship copy-pasteable example blocks via cobra'sExample:field, covering JSON, ADK-Go, LangGraph, SARIF output, and--sincediff mode.
- pydantic-graph: read
run()body returns, not just the type annotation. Pre-0.9.0 dogfood on real OSS (aidev9/tuts) hit a false Critical — a node annotated-> ProNodewhose body returns three node types lost the un-annotated edges, producing a false no-exit cycle + false unreachable. The parser now unions the return-type annotation with thereturn XNode()statements in the body. - CrewAI false positives eliminated (wild-repo dogfood sweep, 28
langgraph/crewai repos, 2026-05-31). Two systematic FPs that
together accounted for 126 of the CrewAI warnings in the sweep, now
both at zero:
error_handler_checkerfired on every CrewAI Task (65 findings across 15 repos) because Tasks were emitted asNodeTypeTool. Tasks are nowNodeTypeTask, so the tool-oriented rules no longer match them. (Real agent tools stayNodeTypeTool.)unreachable_nodeflagged every agent (52 findings across 8 repos) in crews that hit the AST fallback (real projects fail to importcrewai_tools→ chromadb → opentelemetry, forcing the degraded path). The AST visitor now wires Task→Agent edges, resolving the CrewBase indirection chainagent=self.x→self.x = self._make_x()→def _make_x(): … Agent(role=…). Agents never referenced by a task are still correctly reported unreachable.
- README install/quick-start commands were all broken. All three
examples under
## Installin bothREADME.mdandREADME.ja.mdeither failed withrequired flag(s) "input" not set(npx shingan-lint analyze --format=langgraph ./agents/,pnpm exec shingan analyze --since main) or pointed attestdata/buggy.jsonwhich is not shipped via npm. Rewritten aroundshingan demo+ a self-containedcat > workflow.json <<EOFheredoc so every code block on the landing page actually runs. - npm/README.md updated to use
shingan demoas the first example and replace the broken--since main/testdata/...paths.
Round-2 dogfood (mid-sized active OSS) closed two real false positives. No new rules; both fixes are AST-fallback precision improvements driven by failures on real projects.
- LangGraph parser: AST fallback now unrolls
for <var> in [<str-literal>, …]: graph.add_edge(<var>, "T")(and theadd_edge( "S", <var>)mirror). Closes a false-positiveunreachable_nodepair onstarpig1129/AI-Data-Analysis-MultiAgent(a.k.a. DATAGEN, 1.7K★) whereQualityReviewandNoteTakerwere flagged unreachable despite the for-loop wiringVisualization/Search/Coder/Report → QualityReviewand the conditional from there toNoteTaker. The unrolling is deliberately narrow: literal list/tuple iterators only, singleNametarget only, all-string-constant elements only — anything dynamic falls through to plaingeneric_visitso we don't hallucinate edges from generators,range(), or destructuring. - CrewAI parser: AST fallback returns an empty graph when a module
defines
Agent(...)ctors with noTask(...)orCrew(...)at module top level. Closes the false-positiveunreachable_nodetriad (Programmer/Tester/Reviewer) ontheyashwanthsai/Devyanwhoseagents.pyis a definition-only module imported by the entrypoint. CrewAI's mental model is task-centric: the graph isCrew.tasksorder; Agents are resources bound byTask(agent=…). An agents-only file therefore isn't a workflow in its own right and shouldn't manufacture an arbitrary "first agent is entry" topology.
- New regression fixture
testdata/langgraph/for_loop_edges.py+TestLangGraphParser_ForLoopEdgescovering the DATAGEN pattern. - New regression fixture
testdata/crewai/agents_only_module.py+TestCrewAIParser_AgentsOnlyModuleSkippedcovering the Devyan pattern.
Continuation of the dogfood-driven brushup loop started in v0.8.5. Twelve commits' worth of FP elimination across all three Python parsers, plus a security fix and an architectural cleanup.
- 🔴 GHA shell-injection fix (
action.yml). Eight${{ inputs.* }}expressions previously template-substituted directly into abash run:block. Values containing",$(), backticks, or newlines would be interpreted as live shell tokens, executing under the runner's permissions with access to GITHUB_TOKEN. All inputs now route through the step'senv:block asINPUT_*vars; therun:block references them as$INPUT_*(opaque strings, no template-time substitution). - 🟠 Go stdlib vuln upgrade (govulncheck baseline). Bumped
godirective 1.25.0 → 1.25.3, refreshedgolang.org/x/net, pinnedgo-version: 1.25.3in action.yml + ci.yml + codeql.yml + release.yml. 24 reachable vulns → 16 (remaining are stdlib without fixed versions yet — close as the next 1.25.x patch ships).
Node.HasExitBranchtyped field replaces theConfig["has_end_branch"]=truecross-layer key introduced in v0.8.5. The Onion violation flagged by review (rules/cycle.go reading parser-private string keys from a map) is closed: parsers now write a typeddomain.Nodefield, the cycle rule reads the typed field, the Config map remains as a wire-format detail at the shim level only. Integration testTestLangGraphParser_EndSentinelExitruns the full shim → wire → Go parser → domain pipeline so a future change to the parser-side JSON key fails loudly instead of silently zero-valuing the typed field.
- Router-Literal mapping omitted:
add_conditional_edges("src", router_fn)(no third arg) now readsrouter_fn's-> Literal[...]return annotation to discover destinations. Dogfood: executive-ai-assistant cleared 11 false-positiveunreachable_nodewarnings onroute_after_triage-style routers. - END-sentinel exit recognition: routers returning
Literal[END, "back_to_loop"],Command(goto=END), or list/dict path_maps containingENDnow mark the source as having a structural exit (Node.HasExitBranch=true).cycle_detectionuses the flag to downgrade Critical → Warning when the only exit is a sentinel. Dogfood: company-researcher'sroute_from_reflection(Literal[END, "research_company"]) — the first false-positive Critical from v0.8.5+ to be reclassified. - Generic-exception fallback: modules with import-time side
effects (
OpenAIError, network calls, deprecated module shims) now fall back to AST extraction instead of bubbling the exception as an RPC error. Dogfood: langchain-academy module-1 agent.py used to fail onOpenAIError("Missing credentials"). tools_conditionbuiltin:add_conditional_edges("agent", tools_condition)now resolves correctly even though the function lives inlanggraph.prebuilt. Hard-coded as_BUILTIN_ROUTER_LITERALS = {"tools_condition": {"tools", "__end__"}}. Hooks for adding more builtins (e.g.forward_message) follow the same pattern.- Fan-in
add_edge([a, b], c): LangGraph stores fan-in joins inwaiting_edgesseparately fromedges; the shim now merges them and_normalise_edgeexpands((a, b), c)to[(a, c), (b, c)]instead of producing a single bogus edge with src"('a', 'b')". Dogfood: langgraph/libs/langgraph/bench/ wide_state.py. - Bare-return router (Source 3): functions with no return
annotation but ≥2 distinct literal/sentinel return values are
now treated as routers. Avoids polluting the dispatch map with
plain utility funcs (single literal return). Dogfood:
langgraph/examples/chatbot-simulation-evaluation/
simulation_utils.py's
_should_continue. _resolve_router_callable: the second argument toadd_conditional_edgesno longer needs to be a bareName/Attribute. The resolver also unwrapsa or b(_ast.BoolOp) andfunctools.partial(fn, …)to recover the underlying function name.- Two-pass visit (
prepass_collect_dispatch): pre-walks everyFunctionDefto populate_command_goto_mapBEFORE the main visit traverses builder calls. Modules whosemake_graph()factory is defined ABOVE the router function (the most common layout) no longer hit a visit-order race that drops conditional destinations.
- Generic-exception fallback (symmetric with the LangGraph
v0.8.5+ fix). Modules with import-time side-effects (deprecated
module shims like
langchain.llms's re-export wrappers) now route through AST extraction instead of crashing the worker. Dogfood: crewAI-examples/crews/screenplay_writer/ screenplay_writer.py 0 → 9 findings.
- Sticky-note skip:
n8n-nodes-base.stickyNote(visual annotation widgets, never executed) now drops out of the WorkflowGraph entirely. Dogfood: random 10-file sample from Zie619/n8n-workflows had 4-12 sticky notes per workflow, all emitting false-positiveunreachable_nodewarnings before this fix.
| OSS file | v0.8.4 / earlier | v0.8.6 |
|---|---|---|
| open_deep_research/legacy/graph.py | 9 (1C/8W) | 1 W (legit) |
| executive-ai-assistant graph.py | 14 (13W/1I) | 3 (legit) |
| company-researcher graph.py | 1 Critical FP | 0 Critical |
| langchain-academy module-1 agent.py | parse error | 1 W (legit) |
| langgraph bench/wide_state.py | 2 W FP | 0 |
| n8n 0393 community workflow | 20 (12W/8I) | 12 (8W real / 4I) |
| crewAI-examples screenplay_writer | parse error | 9 (4W/5I) |
- README new "Real-world LangGraph dogfood (v0.8.5+)" section with finding counts on seven production LangGraph repos.
docs/langgraph.mdsyntax coverage table expanded from 8 rows to 15, each new row marked(v0.8.5+). Functional API (@entrypoint/@task) flagged as the next concrete gap.
This release is the result of a dogfood sweep across real-world LangGraph agent OSS (langchain-ai/open_deep_research, langchain-ai/data-enrichment, agno cookbook, gpt-researcher, langchain v1 agents/factory.py). Five FP patterns surfaced and were closed at the analyser level. No new rules, no new frameworks — just radical signal/noise improvements on the patterns LangGraph production code overwhelmingly uses.
- Bounded-cycle severity downgrade (
domain/rules/cycle.go).cycle_detectionnow distinguishes structural cycles (no exit edge — Critical, the graph is broken) from bounded cycles (cycle has at least one outgoing edge to a non-cycle node — Warning, depends onrecursion_limit). The "tool-calling agent" pattern (chatbot ↔ tools loop with conditional__end__exit) is now correctly classified as Warning rather than triggering Critical alarms on every LangGraph agent in the wild. Verified: langchain agents/factory.py 2 Critical → 0 Critical; agno cookbook langgraph_tools.py preserves its real Critical because the__end__branch is dropped during runtime extraction. - Multi-graph file support (
infrastructure/parser/shims/export_langgraph_server.py). Files defining severalStateGraphinstances (subgraph composition — the LangGraph-recommended pattern:builder.add_node("section", section_builder.compile())) no longer flat-merge nodes from every graph under a single entry. Both runtime (_find_state_graphs) and AST-fallback (_StateGraphASTVisitor) paths now select the LAST graph variable passed to<var>.compile()as the "main" graph — the idiomaticgraph = builder.compile()at module bottom. Falls back to the largest graph when no compile() call is detected. Verified: open_deep_research/legacy/graph.py 6 unreachable_node FPs cleared. - Cycle finding dedupe (
domain/rules/cycle.go). When a node is reached via multiple distinct back-edges (e.g.add_conditional_edges("agent", route)whereroutereturns any of{"tool", "agent", "reflect"}), the detector now emits exactly ONEcycle_detectionfinding per cycle entry node rather than N duplicates. Engineers reviewing SARIF output read duplicate findings as report churn. Verified: data-enrichment graph.py 5 findings → 3 (3 dup cycle → 1). Command(goto=...)implicit edge extraction (infrastructure/parser/shims/export_langgraph_server.py). LangGraph's runtime introspection only sees edges declared viaadd_edge/add_conditional_edges— dynamic dispatch viadef fn(...) -> Command[Literal["a", "b"]]orreturn Command(goto=...)is invisible. The shim now harvests destinations from BOTH typed-Command return annotations AND inlinereturn Command(goto="x")statements, then synthesises edges withcondition="command_goto". Applied to both AST-fallback and runtime paths so they produce symmetric graphs. Verified: open_deep_research/legacy/graph.py 4 unreachable_node FPs cleared.add_conditional_edgeslist path_map shape.add_conditional_edges("src", router_fn, ["a", "b"])(path_map shorthand — list of node names, no{"label": "node"}mapping) was previously dropped by the AST visitor. Both list and tuple forms now produce edges. Verified: open_deep_research/legacy/graph.py 1 unreachable_node FP cleared.
| OSS file | Before | After | Δ |
|---|---|---|---|
| open_deep_research/legacy/graph.py | 9 (1 C / 6 W / 2 W) | 1 (1 W) | -8 (7 FP eliminated, 1 legitimate bounded cycle remains) |
| gpt-researcher/multi_agents/agents/orchestrator.py | 1 C + 3 W | 0 C + 4 W + 3 I | bounded-cycle reclassified Critical → Warning |
| langchain-ai/data-enrichment graph.py | 5 (3 dup cycle + 2) | 3 | -2 (dup collapse) |
| langchain v1 agents/factory.py | 2 C + previous | 0 C + 5 W + 1 I | -2 Critical FPs (tool-calling pattern) |
docs/case-studies/gpt-researcher.mdupdated to reflect bounded-cycle reclassification (Critical → Warning) and the v0.8.5 reasoning. The remediation recommendation (explicitmax_revisions) is unchanged.
Per the v2 market analysis, operational ergonomics — not rule count — was the #1 adoption blocker vs Snyk / Semgrep / ESLint. v0.8.4 closes that gap.
# shingan: ignorecomments (docs/ignore-comments.md). Three scopes — line / next-line / file — with comma-separated rule names or "ignore-all". Both#(Python / YAML) and//(Go / TS) comment prefixes accepted. Applied at the orchestrator level viaapplication.FilterIgnoredFindingsso every framework benefits without per-parser changes..shingan.yamlseverity policy (docs/severity-policy.md). YAML config, ESLint / golangci-lint tradition: top-levelrules:for global per-rule severity / enable / disable, plus path-scopedoverrides:(legacy/**glob support). Auto-discovered via walk-up from CWD;--policy=<path>overrides. Resolution order: rule defaults → top-level → matching override (later wins).- PR bot (
docs/pr-bot.md). Newpr-comment: trueinput onaction.ymlposts a sticky markdown summary on pull requests (sticky-marker<!-- shingan-pr-comment-marker -->so subsequent pushes update in place — no timeline noise).pr-comment-mode:always/on-findings/on-failure. Uses the workflow's${{ github.token }}— no extra secret.
- Rules run, producing raw findings with built-in severities.
# shingan: ignorecomments suppress per-line / per-file matches..shingan.yamlpolicy adjusts severity / drops disabled rules.--baseline.json(if present) suppresses fingerprints already known.--min-confidencefilters by confidence threshold.
- Stale root
package.json(name: shingan,version: 1.0.0,license: ISC) andpackage-lock.jsondeleted — they were inconsistent withLICENSE=MITandnpm/package.json@0.8.x. The npm wrapper atnpm/is now the single source of truth.
- README + README.ja.md restructured with the v2 market analysis 1-line tagline ("Your agent can spend money, leak data, and call tools before you notice…") + a "Status: Beta" callout + a new "Where Shingan stands today" operational-features comparison table + a complete OWASP Agentic AI Top 10 (2025) coverage table.
- 3 case-study docs published under
docs/case-studies/: crewAI-examples (multi_tool 7 findings + game-builder-crew 3 findings), n8n-community-workflows (15 findings + the v0.8.2 fixes that drove them), gpt-researcher (4 findings via AST fallback including the first Critical in real OSS —cycle_detectiononplannerfrom the human-in-the-loop revision flow).
- AST-based fallback parser (ADR-014) — runtime introspection couldn't reach graphs constructed inside instance methods or decorator-driven factories (the dominant real-world pattern in
gpt-researcher.ChiefEditorAgent._create_workflow(self, agents),crewAI-examplesagents.py / tasks.py / @CrewBase classes, etc.). Both Python shims now fall through to a pure-AST visitor when:_load_*says the framework isn't importable, OR- the user file's transitive imports raise
ModuleNotFoundError, OR - the runtime path returns 0 nodes.
The visitor walks the syntax tree for
StateGraph(...).add_node(...).add_edge(...).add_conditional_edges(...).set_entry_point(...)(LangGraph) andAgent(role=...)/Task(description=...)/Crew(...)constructor calls (CrewAI), withallow_delegation=Truebidirectional edges + Process.sequential head-to-tail Task chaining. String-literal arguments are extracted; non-literal arguments become a synthetic placeholder so reachability rules still see the structure (over-approximation per ADR-008). Metadataextraction: "ast_fallback"distinguishes from runtime path.
- First Critical finding in real OSS via AST fallback:
cycle_detection(100%) onplannernode inassafelovic/gpt-researchermulti_agents/agents/orchestrator.py(StateGraph cycle in instance method without a Loop guard). - Real-OSS sweep across
crewAIInc/crewAI-examples: 15 / 40 files (37.5%) now produce ≥1 finding (was 3% pre-AST), 43 total findings across the corpus — primarilyerror_handler_checkerWarnings on Task / Agent nodes lacking conditional fallback edges.
- AST-extracted graphs use
metadata.extraction = "ast_fallback"and lower confidence (over-approximation) for non-literal node names (<dynamic>). - No regression on existing testdata fixtures: runtime path still wins when the user file constructs the graph at module top level or in a zero-arg factory function (existing v0.8.2 behaviour preserved).
- P0: UUID-keyed
connectionssilently dropped — modern n8n exports key the connection map by node UUID rather than name. The parser only matched by name, so almost every modern workflow looked nearly disconnected andunreachable_nodeproduced massive false positives (Zie619/n8n-workflows Deep Research: 38-node workflow → 4 reachable, 34 FPs). AdduuidToIDmap +resolveRefhelper that tries name first, UUID fallback. - Multi-trigger workflows treated as single-entry — workflows with >1
category="trigger"node (Telegram + Webhook + Schedule + Respond-to-Webhook) only had one entry picked bypickEntryNode, so other triggers' sub-flows reported as unreachable. Synthesise a virtual__n8n_multi_trigger_root__node connected to all triggers when ≥2 exist; single-trigger workflows keep the original behaviour. ai_*port edges now emitted — n8n's langchain AI Agent nodes route sub-resources (LLM, tools, memory, output parsers) viaai_languageModel/ai_tool/ai_memory/ai_outputParserports, notmain. These were skipped as "decoration", causing langchain-heavy workflows to show massunreachable_nodeFPs. Now emitted as edges withCondition=portNameso reachability rules count them whileerror_handler_checkercorrectly treats them as runtime-managed sub-resources (non-empty Condition = conditional branch, not missing fallback).
- P0: LangGraph and CrewAI parsers now work in the npm-distributed
shingan-lintbinary (silent breakage since v0.6.1). Thescripts/export_*_server.pyPython shims were not bundled in the npm tarball —npm install -g shingan-lint && shingan analyze --format=langgraph workflow.pywould fail withcould not locate scripts/export_langgraph_server.py. Discovered via dogfoodingshinganagainst the publiccrewAIInc/crewAI-examplesrepo.- Moved canonical shim location:
scripts/export_*.py→infrastructure/parser/shims/export_*.py. - Added
infrastructure/parser/shims_embed.go: embeds both shims into the Go binary via//go:embed shims/*.py. - Resolution order in
LocateShim/LocateShimNamednow: env-var override → walk-up search (infrastructure/parser/shims/then legacyscripts/) → embedded extraction to user cache (~/.cache/shingan-shims/v<version>/). The embedded fallback is what makes the npm distribution work. - Tests +
cmd/shingan/langgraph_e2e_test.go::shimPath()updated to find the shim in either location.
- Moved canonical shim location:
ModuleNotFoundErrorUX in Python shims — when a user's workflow imports a third-party library that isn't in the analysis env (e.g. CrewAI examples that useunstructured,langchain-community,exa_py,decouple), the parser now surfaces a friendlyRuntimeError: missing python dependency while parsing X: import Y failed. Run pip install Yinstead of a stack-trace dump. Bothexport_langgraph_server.pyandexport_crewai_server.pycarry this.
- CrewAI parser (6th supported framework) — Python
WorkflowParserfor CrewAI Crew/Agent/Task definitions, reusing the LangGraphPythonWorkerinfrastructure (ADR-013).infrastructure/parser/crewai.go+crewai_test.go:--format=crewaiforshingan analyze. Five tests including end-to-endTestCrewAIParser_SimpleSequentialandTestCrewAIParser_CircularDelegation(gated onpip install crewai).scripts/export_crewai_server.py: long-lived Python JSON-RPC worker that maps Agents →NodeTypeLLM, Tasks →NodeTypeTool, agent.tools → additional Tool nodes; emitsTask → Agentedges (uses_agent) for reachability and honoursProcess.sequentialvsProcess.hierarchical(the latter withover_approximated_dynamicconfidence on manager fan-out).infrastructure/parser/python_worker.go: extractLocateShimNamed()so multiple Python shims share the same walk-up resolution + per-shim env-var override (e.g.SHINGAN_CREWAI_SHIM).scripts/requirements-shim.txt: addcrewai>=0.50.0(Pydantic v2 only).infrastructure/factory/parser.go: registercase "crewai". Error message updated to list 6 supported formats.cmd/shingan/analyze.go: accept--format=crewai, extend directory walk (.py) to crewai alongside langgraph.domain/testutil/generate.go+cmd/shingan-gen/main.go:GenerateCrewAIGraphand--pattern=crewai-simplefor sample generation.testdata/crewai/{simple_crew,sequential_pipeline,hierarchical,multi_tool,circular_delegation}.py: five reference fixtures verified end-to-end againstcrewai==1.14.4(see docs/crewai.md for measured findings).docs/crewai.md+docs/crewai.ja.md: bilingual usage / NodeType mapping / sample table / troubleshooting reference.shingan-adr.md: ADR-013 added (CrewAI parser strategy — PythonWorker reuse).- README framework table: CrewAI flipped from Planned to Beta; roadmap split into in-progress v0.8 line and v0.9+ targets.
- n8n parser — pure Go
WorkflowParserfor n8n workflow JSON exports.infrastructure/parser/n8n.go+n8n_test.go:--format=n8nforshingan analyze. No Python or Node bridge required (n8n is JSON-DSL).- NodeType mapping: substring-based + case-insensitive —
openai/chatgpt/anthropic/claude/gemini/...→ LLM;if/switch/filter/router→ Condition;code/function/executeCommand→ Tool withcategory=code_execution;webhook/trigger→ Tool withcategory=trigger; everything else → Tool withcategory=api. - Edge mapping:
connections.<src>.main2-D array decoded intoEdge.Condition("true"/"false"/"branch_"); langchainai_*sub-connections skipped as decoration. - Entry-node detection: trigger node first, else first node with no incoming
mainedges, else first node in array. - Disabled nodes (
"disabled": true) silently dropped along with incident edges (mirrors n8n runtime). - Five reference fixtures under
testdata/n8n/:simple_chain,branching,loop,multi_step,ai_agent. domain/testutil/GenerateN8nGraph+cmd/shingan-gen --pattern=n8n-simplefor property tests / sample generation.docs/n8n.md(+docs/n8n.ja.md): bilingual usage / mapping / troubleshooting reference.
- Phase 2 batch 2: 5 new builtin rules (Factory 15 → 20)
retry_storm(Path) — Tool with retries × parallelism = blast radius. >=100 Critical (0.9 exact_static_match), >=30 Warning (0.7 heuristic_pattern), >=10 Info (0.5 heuristic_pattern). 14 tests. shingan-gen patternretry-storm.circular_dep_agents(Path) — A→B→A delegation cycle detection in multi-agent workflows. Source via Config[agent_role] / sub_agents non-empty. 2-agent Warning 0.85 / 3+ agent Warning 0.75 / self-ref Info 0.6. 13 tests. Coexists with cycle_detection (regression-tested via TestCircularDepAgents_CoexistsWithCycleDetection). shingan-gen patterncircular-dep-agents.unbounded_tool_arg(Local) — Tool args_schema / parameters / input_schema fields without maxLength/maxItems/maximum. 17 tests, capped at 5 findings/node. shingan-gen patternunbounded-tool-arg.secret_in_prompt_template(Local) — Hardcoded credentials in LLM prompt template fields (system_prompt / prompt_template / user_message_template / instruction). 18 tests. Critical 0.95 exact_static_match for AWS/OpenAI/Anthropic/GitHub/PEM, Warning 0.7 heuristic_pattern for JWT. Env-var substitutions (${VAR}, {{ENV}}) stripped before matching. shingan-gen patternprompt-secret.missing_eval_dataset(Local) — Production-flagged graphs without eval_dataset / benchmark reference. 19 tests. OnGraph aggregation (1 finding per graph). shingan-gen patterndataset-missing.- cascade: factory_test count 15 → 20 + 5 Create_* tests, MCP explain.go 5 entries, tools.go count, bench_test count, docs/lsp.md, docs/mcp-server.md, README rules table.
- Codex iter10 P1 fix:
eval_missingBFS now preserves Critical when both Condition-guarded and direct paths reach the same sink. Previously first-arrival via Condition locked in Warning even when an unguarded Critical path existed. dynamic_node_constructionrule (Phase 2 #3) — Local tier (ADR-007)、15 番目の builtin。- 走査対象: Node.Config の curated subset (
body/fn/handler/callback/code/factory/builder) の文字列値を再帰的に scan - 検出パターン:
eval(/exec(/Function(/compile(/__import__(/getattr(/setattr((regex\bX\s*\() - Severity マトリクス: eval/exec/Function → Critical (0.95, exact_static_match) / compile/import → Warning (0.85, exact_static_match) / getattr/setattr → Info (0.6, heuristic_pattern)
- Per-key collapsing: 1 つの Config 値に複数パターンマッチ時は最高 Severity 1 件に集約 (例:
getattr(...)(eval(...))→ Critical 1件) - Placeholder 抑制:
${VAR}/{{var}}のみの文字列は skip。Mixed (eval(${PAYLOAD})) は strip-then-recheck で eval( が残るため発火 —secret_exposure_scanner.placeholderPatternを共有 - 新規ファイル:
domain/rules/dynamic_node_construction.go/domain/rules/dynamic_node_construction_test.go(16 ケース) /testdata/dynamic_construction/{eval,safe}.json+README.md/docs/rules/dynamic-node-construction.md - 生成 CLI:
shingan-gen --pattern dynamic-constructionを追加 (testutil.GenerateDynamicNodeConstructionGraph) - Factory 自動登録:
init()内でregisterBuiltin()、AnalyzerFactory.Create("dynamic_node_construction")で取得可能 - 位置付け: 兄弟ルール
eval_missing(構造的攻撃面 = LLM → code_execution Tool reachability) と補完関係。文字列レベルの攻撃面を本ルールが、構造レベルを eval_missing が担当
- 走査対象: Node.Config の curated subset (
eval_missingrule (Phase 2 #2) — Path tier (ADR-007)、14 番目の builtin。- Sources:
NodeType.LLMの任意のノード (Severity は path 上の gate に依存するため source 側絞り込みは行わない) - Sinks:
NodeType.Toolのうち以下のいずれか — Config["category"] ∈ {code_execution, code_eval} / Config["tool"] ∈ {eval, exec, code_interpreter, python_runner, shell} / Name または ID が(?i)(eval|exec|code[_]?runner|python[_]?runner|shell|bash)に部分一致 - Severity マトリクス: 何も挟まない → Critical (0.9, heuristic_pattern) / 中間に NodeType.Condition → Warning (0.6, heuristic_pattern) / 中間に NodeType.Human → skip
- アルゴリズム: 各 source から forward BFS、frontier に
viaConditionフラグを持たせて per-path Severity を決定。Human ノード以降は展開停止 (PII leak rule の Human-gate 規則と同形)。 - 新規ファイル:
domain/rules/eval_missing.go/domain/rules/eval_missing_test.go(15 ケース) /testdata/eval_missing/{leak,safe}.json+README.md/docs/rules/eval-missing.md - 生成 CLI:
shingan-gen --pattern eval-missingを追加 (testutil.GenerateEvalMissingGraph) - Factory 自動登録:
init()内でregisterBuiltin()、AnalyzerFactory.Create("eval_missing")で取得可能
- Sources:
docs/rule-authoring.md— internal builtin rule writers 向け実装ガイド (#11 解消)- 13 セクション構成: tier フローチャート / Local・Path・Global テンプレート / ConfidenceReason 選択ガイド (ADR-008) / Severity 判断軸 / TDD パターン / 既存 10 ルール設計記録 /
check_confidence_reason.sh解説 / 命名規約 /registerBuiltin自動登録 (ADR-010) / v1.0 plugin 移行パス / Phase 2 で追加予定 10 ルールの当てはめ - 全 code template を
go build -tags=authoringguide_verify ./domain/rules/...でコンパイル検証 (Local / Path / Global ×domain.LocalRule/domain.PathRule/domain.GlobalRule/domain.AnalysisRuleの dual-implementation を interface assertion で確認) - README.md の "ドキュメント" セクションにリンク追加
- ADR-010 で確定した「Plugin SDK は v1.0 まで internal-only」方針に沿い、外部公開ではなく fork → builtin として upstream PR の経路を案内
- 13 セクション構成: tier フローチャート / Local・Path・Global テンプレート / ConfidenceReason 選択ガイド (ADR-008) / Severity 判断軸 / TDD パターン / 既存 10 ルール設計記録 /
model_card_mismatchLocal rule (Phase 2)- LLM ノードで
Config["model"](gpt-* / claude-* / gemini-* / o1-* / text-bison* / chat-bison*) とbase_url/providerが矛盾しているケースを検出 — 実行時に確実に 4xx で落ちる - 既知 prefix + プロバイダ/URL 不一致 → Critical / 1.0 /
exact_static_match - 既知 prefix +
providerが一致 (custom base_url 許可) → noop (legitimate proxy / Azure OpenAI / Vertex AI 想定) - 未知 prefix +
provider設定あり → Info / 0.4 /heuristic_pattern(knowledge gap surface、テーブル拡張トリガ) - 未知 prefix +
base_urlのみ → noop (false positive 抑制) domain/rules/model_card_mismatch.go+ 16 テスト (positive 3 / negative 7 / unknown 2 / meta 2 / Reason stamp 1 / nil guard 1)domain/testutil/generate.go:GenerateModelCardMismatchGraph(gpt-4o on api.anthropic.com) + 3 テストcmd/shingan-gen/main.go:--pattern model-mismatch追加testdata/model_mismatch/{wrong,correct}.json+ READMEcmd/shingan-mcp/explain.go:model_card_mismatch説明追加 (factory parity 維持)docs/model-card-mismatch.md: 検出ロジック / プロバイダテーブル / 例
- LLM ノードで
temperature_misuseLocal rule (Phase 2)- LLM ノードで
temperature > 0と決定論的タスク (structured_output / extraction / classification / code_generation) が同居しているケースを検出 - 優先度付き signal 評価:
structured_output=trueまたはresponse_format="json_object"→ Warning / 0.9 /exact_static_match→task=classification(temp>0.3) /code_generation(temp>0) → Warning / 0.7 /heuristic_pattern→task=extraction/structured_output→ Info / 0.5 /heuristic_pattern Config["task"]不在時はnode.Nameのキーワード (extract / classif / codegen) で fallbackdomain/rules/temperature_misuse.go+ 15 テスト (positive 4 / negative 4 / edge 2 / meta 2 / nil guard 1 / 全 finding に ConfidenceReason stamp 1)domain/testutil/generate.go:GenerateTemperatureMisuseGraph(structured_output + temp 0.7) + 3 テストcmd/shingan-gen/main.go:--pattern temperature-misuse追加testdata/temperature/{misuse,ok}.json+ READMEcmd/shingan-mcp/explain.go:temperature_misuse説明追加 (factory parity 維持)docs/temperature-misuse.md: 検出ロジック / Suggestion / 例
- LLM ノードで
prompt_injection_sinkrule (Phase 2 #1) — Path tier (ADR-007)、13 番目の builtin。- Sources:
Config["source"] == "user_input"ノード、または name/ID が(?i)^(user[_\-].*|.*[_\-]input|query|request|user_query|user_request)$にマッチするノード - Sinks:
NodeType.LLMで Config に template-like field (system tier:system_prompt/system/instruction(s)、user tier:prompt_template/user_message_template/user_template/prompt) を持つノード - Substitution 検出:
{{var}}/${var}/{var}3 種の構文を正規表現で検出 - Severity マトリクス: system tier × substitution あり → Critical (0.9) / system tier × なし → Warning (0.7) / user tier × あり → Info (0.5)。すべて
ConfidenceReason = heuristic_pattern - アルゴリズム: 各 sink から逆方向 BFS、
pii_leak_scannerの reverse-BFS と同型 (Human-gate 境界は持たない) - 新規ファイル:
domain/rules/prompt_injection_sink.go/domain/rules/prompt_injection_sink_test.go(12 ケース) /testdata/prompt_injection/{leak,safe}.json+README.md/docs/rules/prompt-injection-sink.md - 生成 CLI:
shingan-gen --pattern prompt-injection-sinkを追加 (testutil.GeneratePromptInjectionSinkGraph) - Factory 自動登録:
init()内でregisterBuiltin()、AnalyzerFactory.Create("prompt_injection_sink")で取得可能
- Sources:
- ADR-012: multi-file directory analysis を per-file independent graph に変更 (#9 解決)
- self-dogfood で
testdata/agentsのunreachable_node偽陽性 7件を発見、原因は merge 戦略 domain.Finding.SourceFilefield 追加 — directory モード時に file 単位 attributionapplication.GraphWithSource新規 +Orchestrator.AnalyzeMulti(inputs, rules)追加 (既存Analyzeは維持)cmd/shingan/analyze.go: directory 経路をloadAsMulti+AnalyzeMultiに置換cmd/shingan-mcp/tools.go: 同様にloadGraphsAsMulti+runAnalysisMulti、ParseFile 優先infrastructure/reporter/json.go:source_file/confidence_reasonフィールド出力 (omitempty)- 結果: testdata/agents で 14 findings (Critical 4 / Warning 8 / Info 2) → 6 findings (Critical 4 / Warning 2) へ偽陽性 8件削減
- regression test:
TestADKGo_Directory_NoSpuriousUnreachable/TestAnalyzeMulti_{StampsSourceFile,EmptyInputs,NilGraphSkipped}
- self-dogfood で
- ESLint方式 visitor pattern + 3層ルール分離 (ADR-006/007/008/010) — refactor/visitor-pattern ブランチ
domain/visitor.go—Listener/Selector/RuleContextを新規追加。Listener はOnNode[NodeType]/OnAny/OnEdge/OnGraphの 4 ハンドラ束で、走査と判定を分離する。domain/rule.go—LocalRule/PathRule/GlobalRuleの 3 interface を追加。AnalysisRuleは Deprecated 注記付きで残し、テスト double / 旧 caller は無改修で動く。domain/finding.go—ConfidenceReasonenum (exact_static_match/over_approximated_dynamic/parser_fallback/experimental_rule/heuristic_pattern) と Finding フィールドを追加 (ADR-008)。domain/rules/registry.go— internal-only builtin registry (registerBuiltin小文字、ADR-010 の Plugin SDK internal-first 戦略を反映)。application/walker.go— 1walk dispatcher。graph.Nodesmap を 1 周し、登録された全 LocalRule の listener にディスパッチする。BFS-from-entry ではなく map 走査を採用 (孤立ノードに対するルール検出を維持するため、reachability は別 GlobalRule で担当 — ADR-007 と整合)。application/path_walker.go— Path tier 用。reverse adjacency を 1 度だけ構築し、各 PathRule に goroutine で配ってシェアする。application/global_walker.go— Global tier 用。各 GlobalRule を goroutine 並列実行する。application/orchestrator.go— 3-pass 構成 (Global → Local → Path → legacy fallback) に書き換え。型 assertion で Global > Path > Local > AnalysisRule の優先順に振り分けるので、refactor 済みルールは新パイプラインへ、未対応ルール (テスト double 等) は従来 goroutine fan-out へと自動的に流れる。Analyze(graph, []AnalysisRule)の public シグネチャは維持 (CLI / MCP / web / HTTP API 互換)。- 10 ルール全部を 3 層へ振り分け & ConfidenceReason 付与
- Local (4):
deprecated_modelloop_guardredundant_llm_callsecret_exposure_scanner(OnNode[NodeTypeLLM]/OnNode[NodeTypeLoop+Control]/OnAnyを使い分け) - Path (3):
pii_leak_scanner(Sources=RAG/PII tools, Sinks=external Tool, reverse-BFS) /error_handler_checker(Sources=Tool, Sinks=LLM, 2-hop) /cost_estimation(Sources=LLM, loop subgraph DFS) - Global (3):
cycle_detectionunreachable_nodemax_parallel_branches
- Local (4):
- 各ルールが
init()内でregisterBuiltin()を呼び、AnalyzerFactory.{Create,CreateAll}はrules.AllBuiltins()をスキャンする方式に切り替え (新規ルール追加時にファクトリ編集不要)。 scripts/check_confidence_reason.sh+ Makefile targetcheck-reason/lint—domain.Finding{...}リテラルにConfidenceReasonが欠けていないかを CI でチェック (空 sentinelFinding{}は除外)。Pure Go では struct field を必須化できないので静的解析で代替 (ADR-008)。- 性能:
application/bench_test.goを 10 ルール builtins セットへ更新。N=1000 ノードで Orchestrator (3-pass + 1walk Local dispatch) 37.9ms vs 全ルール sequential fallback 85.2ms (約 55% 削減、目標 25-50% を上回る)。 - Backward compatibility: 既存テスト 355 (subtests 込みで 445) すべて green、
AnalysisOrchestrator.Analyzeシグネチャ不変、Confidence == 0.0 → 1.0正規化ロジック維持、fakeRule(AnalysisRuleのみ実装) も legacy bucket で動作。Walker / Registry の直接ユニットテストは追加せず、Orchestrator 経由の既存テストでカバー (改善余地)。
cmd/shingan-lspLSP サーバ本実装 (Phase 0 A-2 / ADR-009)- stdio JSON-RPC LSP サーバ、
go.lsp.dev/protocolv0.12 ベース - 7 ハンドラ実装:
initialize,initialized,shutdown,didOpen,didChange,didClose,hover,codeAction(残り60+ メソッドはbaseServerで no-op スタブ化) - 層1: SHA256 LRU 差分キャッシュ (
infrastructure/cache/sha256_lru.go) —(format, sha256(content))複合キー、512 entries、TTL 1時間、cache hit ≈ 10–30ms / miss ≈ 80–250ms - 層2: 長寿命 Python subprocess の health 接続点 (
infrastructure/parser/python_health.go) —python3 --version+ 任意のimport langgraph確認、30秒キャッシュ + コマンド/時計の DI で hermetic test - 層3: Degraded mode — Python 不在時に
shingan_degraded_modeInfo diagnostic 自動付与 (現在は通知のみ; Track P で LangGraph 依存ルール導入時に severity 引き上げ) - 診断変換 (
diagnostics.go):Node.Pos(1-based) → LSPRange(0-based)、未設定時は(0,0)-(0,1)フォールバック、Source = "shingan"ラベル、Code = RuleName - Hover (
hover.go): finding ごとに rule/severity/message/suggestion/confidence% を Markdown でレンダリング、複数 finding が同じ位置にあれば co-located として併記 - CodeAction (
codeaction.go): Suggestion を持つ findings を QuickFix として返却 (TextEdit は ADR-008 AutoFix フィールド導入後に追加) - テスト 13 本: ユニット (
recordingPublisherで publishDiagnostics 検証) + integration 1 本 (bidiPipeで in-memory duplex pipe を組み protocol.NewServer/NewClient 経由の handshake → didOpen → publishDiagnostics 全往復) cmd/shingan-lspを.goreleaser.yamlの 6 番目のバイナリとして追加 (linux/darwin/windows × amd64/arm64)docs/lsp.md新規 — VS Code / Cursor / Neovim / Helix / Zed セットアップ例、診断 shape マッピング表、cache TTL とパフォーマンス特性、degraded mode 解説、ADR-009 への back-linkinfrastructure/cache/新規パッケージ + 5テスト (format isolation / hit-miss / nil normalize / LRU eviction / TTL expiration)infrastructure/parser/python_health*.go新規 + 6テスト (uninitialized state / healthy / no-binary / unexpected-output / cache hit / status reflection)- 新規依存:
go.lsp.dev/protocolv0.12.0,go.lsp.dev/jsonrpc2v0.10.0,go.lsp.dev/uriv0.3.0,go.uber.org/zapv1.21.0;github.com/hashicorp/golang-lru/v2を indirect → direct に昇格
- stdio JSON-RPC LSP サーバ、
- LangGraph parser (Phase 1 主戦場、ADR-011)
infrastructure/parser/langgraph.go—WorkflowParser実装。SupportedFormat() = "langgraph"。Parse(input []byte)(in-memory) とParseFile(path)(sys.path resolution 込み) の両系統を提供infrastructure/parser/python_worker.go— long-lived Python subprocess wrapper。newline-delimited JSON-RPC、Setpgidで process group ごと kill 可能、per-call 30s timeout、goroutine-safe (mutex serialise)scripts/export_langgraph_server.py— Python shim (stdlib only)。langgraph.graph.StateGraphを import して node/edge/conditional_edges/entry_point を抽出、Shingan WorkflowGraph JSON で返却。stdout 規律 (sys.stdout = sys.stderrで stray print を吸収)、langgraph 不在でも degraded で起動継続scripts/requirements-shim.txt—langgraph>=0.2.0、pydantic>=2.0infrastructure/factory/parser.go—case "langgraph"追加cmd/shingan/analyze.go—--format=langgraphフラグ追加、ディレクトリ入力時に.pyを再帰スキャン (新規parseSourceDirectoryFilteredで.go/.pyを統一処理)、fileParsercapability 経由で path を直接 parser に渡す経路追加testdata/langgraph/{simple_chain,branching,react_loop,rag,multi_agent}.py— 5 リファレンスサンプル +expected/*.jsonゴールデンファイルdocs/langgraph.md— 設計、対応機能、Confidence/Reason、トラブルシュート、互換性infrastructure/parser/python_worker_test.go/infrastructure/parser/langgraph_test.go— protocol tests (Python あれば実行) / integration tests (langgraph 必要、無ければ skip)cmd/shingan/langgraph_e2e_test.go— E2E (shingan analyze --format=langgraphを subprocess 起動して exit code 検証、langgraph 必要時のみ実行)conditional_edgesは over-approximation: mapping 各 value をEdge.Condition付きで全候補登録 (ADR-008over_approximated_dynamic)
extensions/vscode-shinganVS Code extension MVP (Phase 2-B) —shingan-lspを spawn して diagnostics を表示する LSP client、status bar widget、3 commands (analyze file / analyze workspace / show rules)。npx vsce packageで.vsix生成可能domain.SourcePos{File, Line, Col}構造体追加 —Nodeの optional フィールドPosに付与 (Phase 2 基盤、LSP/CodeAction/VS Code 拡張の前提)SourcePos.IsZero()ヘルパー — 位置情報の有無判定規則domain/graph_test.go:TestSourcePos_IsZero追加 (6ケース table-driven)
- ADK-Go Parser (
infrastructure/parser/adkgo.go): 既存token.FileSetから位置を取得してNode.Posに埋め込みsourcePos(token.Pos) SourcePosヘルパーメソッド追加processAgentLit/processRealAPIConfig/processToolElement/extractRealSubAgents/processSubAgentの全 Node 生成経路で Pos をセットTestADKGoParser_SourcePos_BareStructLiteral/TestADKGoParser_SourcePos_RealAPI追加
- JSON Parser:
posフィールドが入力に含まれていれば自動デコード (Node.Pos のjson:"pos,omitempty"タグ経由、Parser 本体は無変更)TestJSONParser_PreservesSourcePos/TestJSONParser_NoPosField_BackwardCompat追加
- SamuraiAI Parser:
SamuraiNode.Pos *SourcePos追加、入力にあれば保持 (想定スキーマのため optional) docs/source-pos.md追加 — 設計意図、IsZero 規則、Parser 別埋め方、LSP/CodeAction との関係- Phase 2-E 差分モード & progressive adoption (feat/diff-mode)
--since=<git-ref>CLI フラグ —git diff --name-only <ref>..HEADで得た変更ファイルのみ解析。変更ゼロなら 0 findings で exit 0。--save-baseline=<path>CLI フラグ — 現在の findings を baseline JSON として永続化。--baseline=<path>CLI フラグ — baseline に含まれる findings を抑止。fingerprint は(rule, node_id, message)の組で比較。--baseline+--save-baseline併用時は filter 後の findings のみ保存(新規 finding だけを次の baseline に載せる)。domain/baseline.go—Baseline,FindingFingerprint,Contains,Fingerprint,NewBaselineFromFindingsを追加(stdlib only, I/O なし)。infrastructure/baseline/baseline_io.go—Save/Loadを Onion 原則で infrastructure 層に分離。action.yml—baseline-fileとsince入力を追加。既存フローは完全後方互換。docs/diff-mode.md— 典型ロールアウトフロー、baseline JSON スキーマ、progressive adoption cookbook。
cmd/shingan-mcp— Model Context Protocol サーバ実装 (Phase 2-C)- 公式 SDK
github.com/modelcontextprotocol/go-sdkv1.5.x を使用、stdio transport - Claude Desktop / Cursor / LangGraph Studio / Claude Code / 他 MCP クライアントから呼び出し可能
- 4 tools 公開:
shingan_analyze_graph(graph_json)— in-memory JSON graph →FindingListshingan_analyze_file(path, framework)— ファイル/ディレクトリ (json/adk-go/samurai) →FindingListshingan_explain_rule(rule_name)— 10ルールの詳細説明 (Severity根拠・例)shingan_suggest_model(node_description, input_token_estimate)— ヒューリスティック LLM モデル推奨
docs/mcp-server.md— 設定方法 (Claude Desktop / Cursor / Studio / Claude Code) と JSON 応答例
- 公式 SDK
- 既存 testdata (
testdata/**.json) はposフィールドを持たないまま動作 (TestJSONParser_NoPosField_BackwardCompatで gating) - 既存 consumer (Reporter / Orchestrator) は
Posフィールドを参照しないため挙動不変 - 注意:
Posは値型 (struct) のためjson:"pos,omitempty"タグでもWorkflowGraphを JSON 出力すると常に"pos": {...}キーが出る (空でも"pos": {})。consumer 側で未知フィールドを許容していれば問題ないが、出力サイズ最小化が必要な場合は将来*SourcePos化を検討 - 新規 CLI フラグ (
--since,--baseline,--save-baseline) は省略時は従来挙動 action.ymlのbaseline-file/since入力は省略時 no-op
max_parallel_branchesルール (Issue #1 実装)- fan-out >= 100 → Critical (Confidence=1.0)
- fan-out >= 20 → Warning (Confidence=0.9)
- fan-out >= 10 → Info (Confidence=0.7)
Config["max_concurrency"]設定済みノードはスキップtestdata/parallel/— high_fanout.json, chunked.json, max_concurrency.jsondomain/testutil:GenerateHighFanOutGraph(seed, fanout)追加cmd/shingan-gen:--pattern high-fanoutオプション追加docs/parallel-branches.md— 検出ロジック・ParallelAgent関連・max_concurrency解説
deprecated_modelルール (Issue #2): 停止済み/非推奨LLMモデルを検出modelShutdown→ Critical (confidence 1.0): 実行時に API エラーが発生するモデルmodelDeprecated→ Warning (confidence 0.9): ~6 ヶ月以内に shutdown 予定のモデル- OpenAI 7件 (shutdown) + 2件 (deprecated)、Anthropic 7件 (shutdown) + 1件 (deprecated)、Google 3件 (shutdown)、計20モデルをカバー
testdata/deprecated/:shutdown_models.json(Critical×3)、deprecated_models.json(Warning×1)、active_models.json(0件)domain/testutil/generate.go:GenerateDeprecatedModelGraph(seed)追加cmd/shingan-gen:--pattern deprecated-modelオプション追加docs/deprecated-models.md: モデル分類テーブル、マイグレーション推奨先、各プロバイダの公式 deprecation policy リンク
Finding.Confidence float64フィールド追加 (0.0–1.0,domain/finding.go)- 1.0 = 確定的検出 (DFS back-edge, BFS 到達性など)
- <0.5 = ヒューリスティック (名前ヒントベース)
- 全8ルールが各検出に Confidence を付与:
cycle_detection: 1.0 (DFS back-edge検出は確定)loop_guard: 1.0 (Config["max_iterations"]の有無は確定)unreachable_node: 1.0 (BFS到達性は確定)error_handler_checker: 0.8 (2ホップ先ヒューリスティック)redundant_llm_call: 0.9 (prompt_template完全一致)cost_estimation: 0.7 (モデル価格階層は変動あり)pii_leak_scanner: 0.6 (RAGソース) / 0.3 (名前ヒント)secret_exposure_scanner: 0.95 (Critical/Warning パターン) / 0.5 (Info汎用パターン)
--min-confidenceCLI フラグ (float64, デフォルト 0.0) — 閾値未満の Finding を除外- Orchestrator ソート順: Severity DESC → Confidence DESC → RuleName ASC
- Orchestrator: Confidence 0.0 を 1.0 に正規化 (後方互換)
- JSONReporter:
findings[*].confidenceフィールド追加、summary.high_confidence_count(>=0.9 の件数) 追加 - MarkdownReporter: Confidence 列追加 (例: "95%", "⚠ 30%"=低信頼マーク)
- SARIFReporter:
result.properties.confidenceで拡張フィールドに格納、rule.properties.precision("high"/"medium"/"low") 追加 docs/confidence-scoring.md— 設計思想、各ルール根拠、CI統合例
- Orchestrator のソート: 同一 Severity 内で Confidence 降順が第2ソートキーに (従来は RuleName のみ)
secret_exposure_scannerrule — 8つのシークレットパターンを検出 (AWS/OpenAI/Anthropic/GitHub/Slack/JWT/Generic)- Critical: AWS Access Key (
AKIA...), PEM秘密鍵, OpenAI/Anthropic APIキー - Warning: GitHub Token (
gh[pousr]_...), Slack Bot Token (xox[bpars]-...) - Info: JWT (
eyJ...), Generic パターン (password=XXX, token=XXX) - 除外ロジック:
${VAR},{{placeholder}},process.env.X,os.Getenv()は誤検知なし - 対象:
Node.Configの string / map / slice 値を再帰的にスキャン
- Critical: AWS Access Key (
testdata/secrets/exposed.json— AWS/OpenAI/Anthropic キーをハードコードしたサンプル (Critical×3)testdata/secrets/safe.json— 環境変数参照のみのサンプル (0件)domain/testutil/generate.go:GenerateSecretExposureGraph(seed)— Critical 発火パターン生成関数追加cmd/shingan-gen:--pattern secret-exposureオプション追加testdata/generated/secret-exposure-seed42.json— シード42の生成済みサンプルdocs/secret-detection.md— 検出パターン一覧、Severity判定、除外ロジック解説、v0.4 entropy scanner 予定
cmd/shingan-genCLI — 7パターンのワークフロー生成 (random, clean, buggy, infinite-loop, unreachable, pii-leak, cycle)--pattern,--size,--seed,--outputフラグ対応shingan analyze --format jsonと完全互換のJSON出力(nodes配列形式)- シード固定による再現性保証
domain/testutil/generate.go— 6つのパターン生成関数を追加GenerateCleanGraph(n, seed)— 全7ルールをパスする正常グラフGenerateInfiniteLoopGraph(seed)— loop_guard + cycle_detection 発火GenerateUnreachableGraph(n, seed)— unreachable_node 発火GeneratePIILeakGraph(seed)— pii_leak_scanner 発火GenerateCycleGraph(n, seed)— cycle_detection (非Loopノード) 発火GenerateBuggyGraph(seed)— 全7ルール同時発火
testdata/generated/— 各パターンの生成済みサンプルJSON (7ファイル、合計約64KB)docs/sample-generator.md— shingan-gen 使い方ガイド、パターン解説、教育目的活用法Makefile:gen-cli、sample-%ターゲット追加infrastructure/parser/adkgo.goにgo/typesベースのセカンドパス追加。functiontool.New[TArgs, TResults]のジェネリクス型引数をtypes.Info.Instancesで取得し、TArgs の struct 名・フィールド名から Tool カテゴリを推定。ParseFile(path string)API 経由で利用可能。ロード失敗時は自動で AST-only にフォールバックADKGoParserにWithoutTypes()オプション追加。型情報パスを無効化してAST-onlyパスを強制(テスト高速化、ネットワーク非接続環境向け)NodeTypeLoop(iota=5) — LoopAgent相当。max_iterations必須。ADK-Go のLoopAgentはこの型に解析される。NodeTypeCondition(iota=6) — if/switch/条件分岐相当。max_iterations不要。testutil.Builder.AddLoopNode(id, maxIter)/AddConditionNode(id, expression)ヘルパーメソッドErrorHandlerCheckerに2ホップ追跡 — Tool直後が Condition ノードで条件付きエッジを持つ場合、エラーハンドリングあり判定ErrorHandlerCheckerにConfig["reliable"]=trueフラグサポート — 決定的アルゴリズム(sort等)を除外loopguard.goにisLoopNode()ヘルパー関数(NodeTypeLoop + deprecated NodeTypeControl を判定)
PIILeakScannerを O(sources · (V+E)) から O(V+E) に最適化。逆方向隣接リスト事前構築 + Sink起点逆BFS により、n=1000 で 275ms → 26ms(10倍以上の改善)。既存テスト (11ケース) 互換性を維持しつつ大規模ケース2件を追加。NodeTypeControlを deprecated に変更。JSON"control"文字列は後方互換のためNodeTypeLoopとして扱う(iota値 2 は維持)。LoopGuardCheckerの対象をNodeTypeLoop/ deprecatedNodeTypeControlのみに変更。NodeTypeConditionは対象外。CycleDetectorの Loop 判定をisLoopNode()に統一。NodeTypeCondition単体のサイクルは Critical(グラフ定義誤り)のまま。ADKGoParser:LoopAgent→NodeTypeLoop(従来は NodeTypeControl)。Sequential/Parallel は NodeTypeControl のまま。SamuraiParser:"loop"→NodeTypeLoop、"condition"→NodeTypeCondition(従来は両方 NodeTypeControl)。reachability.goのnodeTypeName()に Loop/Condition ケース追加。testdata/meta/shingan_pipeline.json:parse_error_branch,format_error_branchをcondition型に変更。sort_by_severityにreliable=trueを追加。
loop_guardが条件分岐ノード (parse_error_branch,format_error_branch) を誤検知 (Critical×2)error_handler_checkerが Condition ノードを介したエラーハンドリングを見逃す誤検知 (Info×2)error_handler_checkerが決定的ツール (sort_by_severity) を誤検知 (Info×1)- 上記5件すべてが
testdata/meta/shingan_pipeline.jsonで0件になることを自己検証確認 (docs/self-dogfood.md)
- 7 analysis rules:
pii_leak_scanner(v0.3 preview) — RAG→外部送信パスでHuman gateなし
- functiontool.New() 経由で登録したToolのAST検出対応(error_handler_checker強化)
- Playwright スクリーンショット自動化スクリプト (
scripts/screenshots/、10枚) - Marp 面接プレゼンスライド15枚 (HTML生成済、
slides/pitch.md) - GitHub Action (
action.yml) —uses: hatyibei/shingan@v0.1.0 - Multi-stage Dockerfile (distroless, 4バイナリ)
- Performance benchmarks (
domain/rules/bench_test.go,application/bench_test.go,infrastructure/parser/bench_test.go) +docs/benchmarks.md - Self-dogfood verification (
docs/self-dogfood.md) — 既知誤検知5件の文書化 - 6 base analysis rules:
cycle_detection— 非Controlノードのサイクル、LoopAgent管理下のサイクルloop_guard— Control型ノードのMaxIterations未設定検出(独立ルール)unreachable_node— エントリから到達不能なLLM/Toolerror_handler_checker— 外部I/Oノード後のエラーハンドリング欠落cost_estimation— ループ内高額LLMモデル、単純タスクへの高額モデル適用redundant_llm_call— 同一prompt_template×modelの重複呼出
- 3 input formats:
json— Shingan独自のWorkflowGraph JSONadk-go— Google ADK-Go (google.golang.org/adk v1.1.0) のAST解析samurai(Alpha) — SamuraiAI想定スキーマのParser skeleton
- 3 output formats:
json(API応答向け)markdown(CLI・レポート向け)sarif(GitHub Code Scanning統合)
- 4 entry points:
cmd/shingan— CLI (cobra)cmd/api— goa v3 Design-first HTTP API + 自動生成OpenAPIcmd/runner— Vertex AI Gemini でADK-Go Agentを安全実行cmd/shingan-web— ADK Web UI + Shingan pre-execution middleware
- Onion Architecture + Factory Pattern 3箇所 (Analyzer/Parser/Reporter)
- goroutine並行ルール実行 (
sync.WaitGroup+chan []Finding) - CI: GitHub Actions (Go 1.25, lint/test/build, coverage artifact)
- Issue/PR templates, CONTRIBUTING.md
- ADR 5件 (shingan-adr.md) + docs/ (architecture, runtime-demo, sarif-output, samurai-adapter, cycle-detection-note, adk-webui-integration)
- Go + goa + Onion Architecture + Factory Pattern を採用(Kivaスタック準拠)
- Design-first API契約で OpenAPI/実装のドリフトを構造的にゼロに
- 解析ルールはstatelessでWorkflowGraph読み取り専用 → goroutine並行実行が自然に成立