Skip to content

Latest commit

 

History

History
1044 lines (950 loc) · 84.8 KB

CHANGELOG.md

File metadata and controls

1044 lines (950 loc) · 84.8 KB

Changelog

All notable changes to Shingan are documented here. Format follows Keep a Changelog, versioning follows SemVer.

[Unreleased]

Security

  • 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/net v0.60.0, golang.org/x/text v0.42.0, google.golang.org/grpc v1.83.1, go.opentelemetry.io/otel* v1.45.0 (sdk/log v0.21.0). The new dependency set requires go 1.26.0, so the minimum Go for go install is now 1.26 (older toolchains auto-download it under the default GOTOOLCHAIN=auto). CI, release, CodeQL, the composite action and the Docker builder image all use 1.26.

Changed

  • shingan analyze is easier to call. The path can be given positionally (shingan analyze workflow.json, shingan analyze ./agents/); --input still works. When --format is omitted the format is auto-detected from the extension + content and falls back to json when nothing matches, so every invocation that worked before still works — but an n8n export no longer fails with unknown node type string "n8n-nodes-base.…" under the old json default. Explicit --format auto stays strict (errors on unknown input) for hooks. When --output is omitted, findings print as Markdown on a terminal and as JSON when stdout is piped/redirected or --output-file is set (scripts and CI see no change). -o is 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 like package.json are 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's node_modules was previously walked file by file.
  • The pre-commit hook now defaults to --format auto instead of hard-coding --format langgraph, so it works on non-LangGraph projects without config.

Added

  • 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, and unbounded_tool_arg never fired on @langchain/langgraph workflows (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/.stream string args, and prompt-named const bindings) → config.system_prompt; and tool zod schemas (tool(fn,{schema:z.object({…})}) resolved through a ToolNode aggregate) → config.args_schema as 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 an unreachable_node FP) and degrades gracefully on exotic zod / unresolvable prompts (ADR-015). Verified: hardcoded AKIA…/sk-… in a prompt and an unbounded z.string() arg now fire; process.env.… prompts and z.string().max(4000) args stay clean.

Fixed

  • Modern OpenAI keys were not detected by secret_in_prompt_template / secret_exposure (#53). sk-proj-…, sk-svcacct-… and sk-admin-… keys carry -/_ in the body, which the legacy sk-[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 a VERSION build-arg injected into version.Version, and the release workflow passes the tag from docker/metadata-action.

  • tool_description_missing fired on LangGraph's prebuilt ToolNode (#39). The aggregate dispatcher's descriptions live on the wrapped tools; both the langgraph-js and Python LangGraph shims now tag it config.tool_dispatcher and the rule skips it (security rules such as unbounded_tool_arg still 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: / the else of if True:) is no longer drawn as an edge. Leaves with no body return at all are still kept.

  • --format auto directory detection broke ties by Go map order; ties now resolve lexicographically. The auto-detect notice is written to the command's stderr writer instead of os.Stderr directly.

  • 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-less addConditionalEdges(node, router) whose router returns its destination via a ternary (cond ? "answer" : "rewrite", in a concise-arrow body or via a const t = …; return t binding) 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_node false 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) or addConditionalEdges(START, …)), the shim kept only one successor as the entry and dropped the rest, so the others fired false unreachable_node at 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-StateGraph collapse — a file declaring multiple new 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 set entry_ambiguous (mirrors the pydantic-graph multi-Graph fix), so reachability skips rather than inventing unreachable findings.
    • llamaindex externally-injected HITL events — a @step consuming a human-in-the-loop event injected via ctx.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 false unreachable_node across the wild repos (Magic-Resume, tiangong) → 0; cycle_detection (correct bounded warnings) unchanged.

[0.9.1] - 2026-06-04

Changed

  • 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 placeholder your-gcp-project-id with 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), and cmd/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.yml ran go install …/cmd/shingan@latest, so even a workflow that pinned uses: hatyibei/shingan@v0.9.0 silently ran the newest CLI — non-reproducible CI and a supply-chain footgun. The install step now derives the CLI version from github.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 local uses: ./ refs. Closes #30.

Changed (potentially breaking for baseline files)

  • 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 で書き出す。

Added

  • 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-agents parser (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 + typescript bootstrap wholesale. One node per declared new Agent({...}) / Agent.create({...}) (alias-aware on the @openai/agents import), keyed by the agent's name (or binding name); handoffs: [b, handoff(c)] becomes directed edges agentA→B, agentA→C, and tools: [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 set entry_ambiguous. Like AutoGen / Mastra there is no exit sentinel: has_exit_branch is never set, so a pure handoff loop stays Critical and a loop with a structural handoff out of the cycle downgrades to Warning via cycleHasExit. Validated on wild @openai/agents repos (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.RuleWithMessageTemplate interface — ルール作者が安定した MessageTemplateID() を提供できる optional API。orchestrator が該当ルールの finding に Finding.MessageTemplateID を stamp し、baseline digest が文言変更 に影響されなくなる。
  • Multi-arch container image published to GHCR. git push --tags now also builds and pushes ghcr.io/hatyibei/shingan (linux/amd64 + linux/arm64) in a dedicated docker release job that runs after goreleaser, so a Docker build/push failure can't roll back the already-published binaries or npm package. The README's docker pull ghcr.io/hatyibei/shingan now resolves; the Dockerfile cross-compiles per TARGETARCH (a plain docker build still works for single-arch local use).

Docs

  • 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) and application → plugin (rule-catalog rendering), where plugin further pulls domain/rules / version / x/mod/semver. A faithful refactor would ripple into the public plugin SDK surface, so — per the lower-risk option — the real graph is documented (new ADR-017 + a §7 in docs/architecture.md / .ja.md and 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.md to the v0.9 implementation. The architecture docs were frozen at v0.1: they referenced a non-existent domain/analyzer package, "five analysis rules", a hardcoded 5-rule AnalyzerFactory map, and model/ / rule/ sub-packages that don't exist. Corrected to reality — the domain package + domain/rules (22 built-in rules self-registered via init() → rules.AllBuiltins()), the registry-based factory, 11 framework parsers total (5 added in v0.9), the LocalRule/PathRule/ GlobalRule tier 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 (matches go.mod + CI), SECURITY.md supported versions 0.1.x → 0.9.x, and docs/severity-policy.md corrected to state that a malformed policy is a fail-fast hard error (exit non-zero before any analysis) rather than a non-fatal fallback — matching cli/analyze.go.

Security

  • npm postinstall integrity check is now fail-CLOSED. npm/scripts/postinstall.js previously warned and continued when the downloaded archive's sha256 didn't match (or when checksums.txt was 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/missing checksums.txt, OR a missing checksum entry. The only escape hatch is the existing, explicit, opt-in SHINGAN_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 pure verifyChecksum() and covered by npm/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/net to v0.55.0, the Go toolchain to 1.25.11, and added a govulncheck CI gate. govulncheck flagged GO-2026-5026 (Punycode/IDNA label-rejection bug in golang.org/x/net/idna) as reachable in v0.54.0 — the trace runs through signal.Notify → idna.ToASCII in cmd/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/tls session resumption, crypto/x509 name-constraint / error-string DoS, several net/*), fixed across 1.25.6–1.25.11. The Go toolchain is bumped to 1.25.11 across all CI jobs + release, plus a toolchain go1.25.11 directive in go.mod so go install …/cmd/shingan (the GitHub Action path) and local builds get the same patched stdlib the release ships. A dedicated govulncheck CI job (pinned to govulncheck@v1.3.0, not @latest, for reproducibility) runs govulncheck ./... 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.

Fixed

  • 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 false unreachable_node at confidence 1.0 (X-Zero-L/pydantic-ai-deep-research: 4 FPs). The shim now tracks node sets per Graph() decl; ≥2 declared graphs → entry_ambiguous so reachability correctly skips (cycle_detection etc. unaffected).
    • autogen: _resolve_ref now resolves self.<attr> agent references (ast.Attribute) — recovering entire class-based DiGraphBuilder graphs that were silently dropped (Austinggg/CreAgentive, the canonical idiom) — and no longer registers a for-loop control variable as a phantom node (hugocool/FateForger: false unreachable_node on a node literally named agent).
    • mastra: a bounded .dountil(...).map(...) loop was flagged Critical "graph definition error" because the node-less .map/.sleep continuation 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 the addNode(…, { ends: [...] }) option lost both outgoing edges → false unreachable_node on tools. resolveHandlerFn now unwraps .bind() + resolves this.method against class methods, and the ends:[...] option is parsed into edges (agentailor/fullstack-langgraph-nextjs-agent; the ReAct+human-approval cycle is now modeled).
    • llamaindex: an aliased Context param (ctx: AnyContext) and StartEvent/StopEvent subclasses collapsed whole workflows to 0 edges (zylon-ai/private-gpt: 6/7 files). The shim now treats any ctx/context param as the Context regardless of annotation and matches event classes by base leaf, recovering the real workflow graphs.
  • .shingan.yaml overrides[].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)

[0.9.0] - 2026-06-01

Added

  • Six new framework parsers — TypeScript joins shingan's language scope. --format gained:

    • 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's pydantic_graph (BaseNode.run()).
    • llamaindex — LlamaIndex Workflows (event-driven @step methods).
    • autogen — Microsoft AutoGen GraphFlow (DiGraphBuilder).

    Each maps its framework onto the framework-agnostic WorkflowGraph IR, so the existing 22 rules run unchanged. The TypeScript shims require node and install their typescript dependency 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.

  • NodeTypeTask IR node type — a leaf unit of agent work (CrewAI Task, and analogous "step" units in other frameworks), distinct from NodeTypeTool. 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 demo subcommand — runs a small embedded workflow through the full analyzer pipeline and prints a real markdown findings report. No input file needed; exits with the standard 0/1/2 semantics so it doubles as a one-line install smoke test. The bundled sample (cli/embedded/demo.json) intentionally triggers loop_guard (Critical) + unreachable_node (Warning) so the demo exits 2.

  • Guided banner when shingan runs with zero args — replaces cobra's default "wall-of-usage" with a four-line pointer at shingan demo / shingan analyze --input / shingan --help. Closes the "I ran npx shingan-lint and nothing useful happened" UX gap.

  • --help examples — shingan --help and shingan analyze --help now ship copy-pasteable example blocks via cobra's Example: field, covering JSON, ADK-Go, LangGraph, SARIF output, and --since diff mode.

Fixed

  • 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 -> ProNode whose 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 the return 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_checker fired on every CrewAI Task (65 findings across 15 repos) because Tasks were emitted as NodeTypeTool. Tasks are now NodeTypeTask, so the tool-oriented rules no longer match them. (Real agent tools stay NodeTypeTool.)
    • unreachable_node flagged every agent (52 findings across 8 repos) in crews that hit the AST fallback (real projects fail to import crewai_tools → chromadb → opentelemetry, forcing the degraded path). The AST visitor now wires Task→Agent edges, resolving the CrewBase indirection chain agent=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 ## Install in both README.md and README.ja.md either failed with required flag(s) "input" not set (npx shingan-lint analyze --format=langgraph ./agents/, pnpm exec shingan analyze --since main) or pointed at testdata/buggy.json which is not shipped via npm. Rewritten around shingan demo + a self-contained cat > workflow.json <<EOF heredoc so every code block on the landing page actually runs.
  • npm/README.md updated to use shingan demo as the first example and replace the broken --since main / testdata/... paths.

[0.8.7] - 2026-05-11

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.

Fixed

  • LangGraph parser: AST fallback now unrolls for <var> in [<str-literal>, …]: graph.add_edge(<var>, "T") (and the add_edge( "S", <var>) mirror). Closes a false-positive unreachable_node pair on starpig1129/AI-Data-Analysis-MultiAgent (a.k.a. DATAGEN, 1.7K★) where QualityReview and NoteTaker were flagged unreachable despite the for-loop wiring Visualization/Search/Coder/Report → QualityReview and the conditional from there to NoteTaker. The unrolling is deliberately narrow: literal list/tuple iterators only, single Name target only, all-string-constant elements only — anything dynamic falls through to plain generic_visit so 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 no Task(...) or Crew(...) at module top level. Closes the false-positive unreachable_node triad (Programmer/Tester/Reviewer) on theyashwanthsai/Devyan whose agents.py is a definition-only module imported by the entrypoint. CrewAI's mental model is task-centric: the graph is Crew.tasks order; Agents are resources bound by Task(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.

Testing

  • New regression fixture testdata/langgraph/for_loop_edges.py + TestLangGraphParser_ForLoopEdges covering the DATAGEN pattern.
  • New regression fixture testdata/crewai/agents_only_module.py + TestCrewAIParser_AgentsOnlyModuleSkipped covering the Devyan pattern.

[0.8.6] - 2026-05-09

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.

Security

  • 🔴 GHA shell-injection fix (action.yml). Eight ${{ inputs.* }} expressions previously template-substituted directly into a bash 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's env: block as INPUT_* vars; the run: block references them as $INPUT_* (opaque strings, no template-time substitution).
  • 🟠 Go stdlib vuln upgrade (govulncheck baseline). Bumped go directive 1.25.0 → 1.25.3, refreshed golang.org/x/net, pinned go-version: 1.25.3 in 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).

Architecture

  • Node.HasExitBranch typed field replaces the Config["has_end_branch"]=true cross-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 typed domain.Node field, the cycle rule reads the typed field, the Config map remains as a wire-format detail at the shim level only. Integration test TestLangGraphParser_EndSentinelExit runs 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.

Fixed — LangGraph parser

  • Router-Literal mapping omitted: add_conditional_edges("src", router_fn) (no third arg) now reads router_fn's -> Literal[...] return annotation to discover destinations. Dogfood: executive-ai-assistant cleared 11 false-positive unreachable_node warnings on route_after_triage-style routers.
  • END-sentinel exit recognition: routers returning Literal[END, "back_to_loop"], Command(goto=END), or list/dict path_maps containing END now mark the source as having a structural exit (Node.HasExitBranch=true). cycle_detection uses the flag to downgrade Critical → Warning when the only exit is a sentinel. Dogfood: company-researcher's route_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 on OpenAIError("Missing credentials").
  • tools_condition builtin: add_conditional_edges("agent", tools_condition) now resolves correctly even though the function lives in langgraph.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 in waiting_edges separately from edges; the shim now merges them and _normalise_edge expands ((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 to add_conditional_edges no longer needs to be a bare Name/ Attribute. The resolver also unwraps a or b (_ast.BoolOp) and functools.partial(fn, …) to recover the underlying function name.
  • Two-pass visit (prepass_collect_dispatch): pre-walks every FunctionDef to populate _command_goto_map BEFORE the main visit traverses builder calls. Modules whose make_graph() factory is defined ABOVE the router function (the most common layout) no longer hit a visit-order race that drops conditional destinations.

Fixed — CrewAI parser

  • 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.

Fixed — n8n parser

  • 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-positive unreachable_node warnings before this fix.

Net dogfood signal

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)

Docs

  • README new "Real-world LangGraph dogfood (v0.8.5+)" section with finding counts on seven production LangGraph repos.
  • docs/langgraph.md syntax 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.

[0.8.5] - 2026-05-09

Fixed — Dogfood-driven LangGraph FP elimination

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_detection now 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 on recursion_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 several StateGraph instances (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 idiomatic graph = 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) where route returns any of {"tool", "agent", "reflect"}), the detector now emits exactly ONE cycle_detection finding 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 via add_edge / add_conditional_edges — dynamic dispatch via def fn(...) -> Command[Literal["a", "b"]] or return Command(goto=...) is invisible. The shim now harvests destinations from BOTH typed-Command return annotations AND inline return Command(goto="x") statements, then synthesises edges with condition="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_edges list 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.

Net dogfood signal/noise

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

  • docs/case-studies/gpt-researcher.md updated to reflect bounded-cycle reclassification (Critical → Warning) and the v0.8.5 reasoning. The remediation recommendation (explicit max_revisions) is unchanged.

[0.8.4] - 2026-05-09

Added — Operational trust trio (Phase 0.5)

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: ignore comments (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 via application.FilterIgnoredFindings so every framework benefits without per-parser changes.
  • .shingan.yaml severity policy (docs/severity-policy.md). YAML config, ESLint / golangci-lint tradition: top-level rules: for global per-rule severity / enable / disable, plus path-scoped overrides: (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). New pr-comment: true input on action.yml posts 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.

Resolution order at runtime (later steps see fewer findings)

  1. Rules run, producing raw findings with built-in severities.
  2. # shingan: ignore comments suppress per-line / per-file matches.
  3. .shingan.yaml policy adjusts severity / drops disabled rules.
  4. --baseline.json (if present) suppresses fingerprints already known.
  5. --min-confidence filters by confidence threshold.

Fixed

  • Stale root package.json (name: shingan, version: 1.0.0, license: ISC) and package-lock.json deleted — they were inconsistent with LICENSE=MIT and npm/package.json@0.8.x. The npm wrapper at npm/ is now the single source of truth.

Docs

  • 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_detection on planner from the human-in-the-loop revision flow).

[0.8.3] - 2026-05-09

Added

  • 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-examples agents.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) and Agent(role=...) / Task(description=...) / Crew(...) constructor calls (CrewAI), with allow_delegation=True bidirectional 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). Metadata extraction: "ast_fallback" distinguishes from runtime path.
  • First Critical finding in real OSS via AST fallback: cycle_detection (100%) on planner node in assafelovic/gpt-researcher multi_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 — primarily error_handler_checker Warnings on Task / Agent nodes lacking conditional fallback edges.

Notes

  • 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).

[0.8.2] - 2026-05-09

Fixed (n8n parser dogfood round 2)

  • P0: UUID-keyed connections silently 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 and unreachable_node produced massive false positives (Zie619/n8n-workflows Deep Research: 38-node workflow → 4 reachable, 34 FPs). Add uuidToID map + resolveRef helper 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 by pickEntryNode, 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) via ai_languageModel / ai_tool / ai_memory / ai_outputParser ports, not main. These were skipped as "decoration", causing langchain-heavy workflows to show mass unreachable_node FPs. Now emitted as edges with Condition=portName so reachability rules count them while error_handler_checker correctly treats them as runtime-managed sub-resources (non-empty Condition = conditional branch, not missing fallback).

[0.8.1] - 2026-05-09

Fixed

  • P0: LangGraph and CrewAI parsers now work in the npm-distributed shingan-lint binary (silent breakage since v0.6.1). The scripts/export_*_server.py Python shims were not bundled in the npm tarball — npm install -g shingan-lint && shingan analyze --format=langgraph workflow.py would fail with could not locate scripts/export_langgraph_server.py. Discovered via dogfooding shingan against the public crewAIInc/crewAI-examples repo.
    • 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 / LocateShimNamed now: env-var override → walk-up search (infrastructure/parser/shims/ then legacy scripts/) → 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.

Improved

  • ModuleNotFoundError UX 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 use unstructured, langchain-community, exa_py, decouple), the parser now surfaces a friendly RuntimeError: missing python dependency while parsing X: import Y failed. Run pip install Y instead of a stack-trace dump. Both export_langgraph_server.py and export_crewai_server.py carry this.

[0.8.0] - 2026-05-07

Added

  • CrewAI parser (6th supported framework) — Python WorkflowParser for CrewAI Crew/Agent/Task definitions, reusing the LangGraph PythonWorker infrastructure (ADR-013).
    • infrastructure/parser/crewai.go + crewai_test.go: --format=crewai for shingan analyze. Five tests including end-to-end TestCrewAIParser_SimpleSequential and TestCrewAIParser_CircularDelegation (gated on pip install crewai).
    • scripts/export_crewai_server.py: long-lived Python JSON-RPC worker that maps Agents → NodeTypeLLM, Tasks → NodeTypeTool, agent.tools → additional Tool nodes; emits Task → Agent edges (uses_agent) for reachability and honours Process.sequential vs Process.hierarchical (the latter with over_approximated_dynamic confidence on manager fan-out).
    • infrastructure/parser/python_worker.go: extract LocateShimNamed() so multiple Python shims share the same walk-up resolution + per-shim env-var override (e.g. SHINGAN_CREWAI_SHIM).
    • scripts/requirements-shim.txt: add crewai>=0.50.0 (Pydantic v2 only).
    • infrastructure/factory/parser.go: register case "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: GenerateCrewAIGraph and --pattern=crewai-simple for sample generation.
    • testdata/crewai/{simple_crew,sequential_pipeline,hierarchical,multi_tool,circular_delegation}.py: five reference fixtures verified end-to-end against crewai==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.

[0.7.0] - 2026-05-06

Added

  • n8n parser — pure Go WorkflowParser for n8n workflow JSON exports.
    • infrastructure/parser/n8n.go + n8n_test.go: --format=n8n for shingan 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 with category=code_execution; webhook/trigger → Tool with category=trigger; everything else → Tool with category=api.
    • Edge mapping: connections.<src>.main 2-D array decoded into Edge.Condition ("true"/"false"/"branch_"); langchain ai_* sub-connections skipped as decoration.
    • Entry-node detection: trigger node first, else first node with no incoming main edges, 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-simple for 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 pattern retry-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 pattern circular-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 pattern unbounded-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 pattern prompt-secret.
    • missing_eval_dataset (Local) — Production-flagged graphs without eval_dataset / benchmark reference. 19 tests. OnGraph aggregation (1 finding per graph). shingan-gen pattern dataset-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_missing BFS 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_construction rule (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 が担当
  • eval_missing rule (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") で取得可能
  • 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 の経路を案内
  • model_card_mismatch Local 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 + README
    • cmd/shingan-mcp/explain.go: model_card_mismatch 説明追加 (factory parity 維持)
    • docs/model-card-mismatch.md: 検出ロジック / プロバイダテーブル / 例
  • temperature_misuse Local 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) で fallback
    • domain/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 + README
    • cmd/shingan-mcp/explain.go: temperature_misuse 説明追加 (factory parity 維持)
    • docs/temperature-misuse.md: 検出ロジック / Suggestion / 例
  • prompt_injection_sink rule (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") で取得可能
  • ADR-012: multi-file directory analysis を per-file independent graph に変更 (#9 解決)
    • self-dogfood で testdata/agents の unreachable_node 偽陽性 7件を発見、原因は merge 戦略
    • domain.Finding.SourceFile field 追加 — directory モード時に file 単位 attribution
    • application.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}
  • 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 — ConfidenceReason enum (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.Nodes map を 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_model loop_guard redundant_llm_call secret_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_detection unreachable_node max_parallel_branches
    • 各ルールが init() 内で registerBuiltin() を呼び、AnalyzerFactory.{Create,CreateAll} は rules.AllBuiltins() をスキャンする方式に切り替え (新規ルール追加時にファクトリ編集不要)。
    • scripts/check_confidence_reason.sh + Makefile target check-reason / lint — domain.Finding{...} リテラルに ConfidenceReason が欠けていないかを CI でチェック (空 sentinel Finding{} は除外)。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-lsp LSP サーバ本実装 (Phase 0 A-2 / ADR-009)
    • stdio JSON-RPC LSP サーバ、go.lsp.dev/protocol v0.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_mode Info diagnostic 自動付与 (現在は通知のみ; Track P で LangGraph 依存ルール導入時に severity 引き上げ)
    • 診断変換 (diagnostics.go): Node.Pos (1-based) → LSP Range (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-link
    • infrastructure/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/protocol v0.12.0, go.lsp.dev/jsonrpc2 v0.10.0, go.lsp.dev/uri v0.3.0, go.uber.org/zap v1.21.0; github.com/hashicorp/golang-lru/v2 を indirect → direct に昇格
  • 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.0
    • infrastructure/factory/parser.go — case "langgraph" 追加
    • cmd/shingan/analyze.go — --format=langgraph フラグ追加、ディレクトリ入力時に .py を再帰スキャン (新規 parseSourceDirectoryFiltered で .go/.py を統一処理)、fileParser capability 経由で 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-008 over_approximated_dynamic)
  • extensions/vscode-shingan VS 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-sdk v1.5.x を使用、stdio transport
    • Claude Desktop / Cursor / LangGraph Studio / Claude Code / 他 MCP クライアントから呼び出し可能
    • 4 tools 公開:
      • shingan_analyze_graph(graph_json) — in-memory JSON graph → FindingList
      • shingan_analyze_file(path, framework) — ファイル/ディレクトリ (json/adk-go/samurai) → FindingList
      • shingan_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 応答例

Backward Compatibility

  • 既存 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

[0.5.0] - 2026-04-15

Added

  • 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.json
    • domain/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 リンク

[0.4.0] - 2026-04-15

Added

  • 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-confidence CLI フラグ (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統合例

Changed

  • Orchestrator のソート: 同一 Severity 内で Confidence 降順が第2ソートキーに (従来は RuleName のみ)

[0.3.0] - 2026-04-15

Added

  • secret_exposure_scanner rule — 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 値を再帰的にスキャン
  • 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 予定

[0.2.0] - 2026-04-15

Added

  • cmd/shingan-gen CLI — 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 を判定)

Changed

  • 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 / deprecated NodeTypeControl のみに変更。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 を追加。

Fixed

  • 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)

[0.1.0] - 2026-04-15

Added

  • 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/Tool
    • error_handler_checker — 外部I/Oノード後のエラーハンドリング欠落
    • cost_estimation — ループ内高額LLMモデル、単純タスクへの高額モデル適用
    • redundant_llm_call — 同一prompt_template×modelの重複呼出
  • 3 input formats:
    • json — Shingan独自のWorkflowGraph JSON
    • adk-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 + 自動生成OpenAPI
    • cmd/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)

Notable architectural decisions

  • Go + goa + Onion Architecture + Factory Pattern を採用(Kivaスタック準拠)
  • Design-first API契約で OpenAPI/実装のドリフトを構造的にゼロに
  • 解析ルールはstatelessでWorkflowGraph読み取り専用 → goroutine並行実行が自然に成立