{
  "schema_version": 1,
  "diagram_type": "architecture",
  "meta": {
    "title": "Cobra GenMan: static call graph and writer boundary",
    "subtitle": "spf13/cobra @ e392f32 · verified source anchors · interface dispatch remains unknown",
    "output": "docs/cases/cobra-genman.architecture.html",
    "visual_preset": "signal-flow",
    "quality_profile": "showcase",
    "repository": {
      "url": "https://github.com/spf13/cobra",
      "revision": "e392f3204db0445f1f4ad47448b04d8c8ad04c2a"
    }
  },
  "components": [
    {
      "id": "example_genman",
      "type": "external",
      "label": "doc_test.ExampleGenMan",
      "sublabel": "documented external caller",
      "pos": [40, 100],
      "size": [230, 76],
      "sources": [
        { "path": "doc/man_examples_test.go", "line": 33, "label": "calls doc.GenMan" }
      ]
    },
    {
      "id": "genman_tree_from_opts",
      "type": "backend",
      "label": "doc.GenManTreeFromOpts",
      "sublabel": "internal tree generator",
      "pos": [40, 300],
      "size": [230, 76],
      "sources": [
        { "path": "doc/man_docs.go", "line": 78, "label": "direct GenMan call" }
      ]
    },
    {
      "id": "genman",
      "type": "backend",
      "label": "doc.GenMan",
      "sublabel": "orchestrates header + rendering",
      "pos": [360, 200],
      "size": [210, 84],
      "tag": "static entry point",
      "sources": [
        { "path": "doc/man_docs.go", "line": 104, "label": "function definition" },
        { "path": "doc/man_docs.go", "line": 108, "label": "passes DisableAutoGenTag" },
        { "path": "doc/man_docs.go", "line": 113, "label": "renders then writes" }
      ]
    },
    {
      "id": "fill_header",
      "type": "security",
      "label": "fillHeader",
      "sublabel": "constructs man page header",
      "pos": [680, 70],
      "size": [200, 84],
      "sources": [
        { "path": "doc/man_docs.go", "line": 117, "label": "header implementation" }
      ]
    },
    {
      "id": "render_write",
      "type": "messagebus",
      "label": "md2man.Render / w.Write",
      "sublabel": "Markdown → roff → io.Writer",
      "pos": [680, 300],
      "size": [230, 84],
      "sources": [
        { "path": "doc/man_docs.go", "line": 113, "label": "w.Write(md2man.Render(b))" }
      ]
    },
    {
      "id": "writer_target",
      "type": "external",
      "label": "Static unknown: concrete io.Writer target",
      "sublabel": "runtime implementation and full callers unresolved",
      "pos": [1040, 290],
      "size": [270, 104],
      "tag": "unknown boundary",
      "sources": [
        { "path": "doc/man_docs.go", "line": 113, "label": "interface dispatch only" }
      ]
    }
  ],
  "boundaries": [
    {
      "kind": "region",
      "label": "Cobra doc package · fixed-version static evidence",
      "wraps": ["example_genman", "genman_tree_from_opts", "genman", "fill_header", "render_write"]
    },
    {
      "kind": "security-group",
      "label": "Runtime dispatch boundary",
      "wraps": ["writer_target"]
    }
  ],
  "connections": [
    {
      "id": "example-to-genman",
      "from": "example_genman",
      "to": "genman",
      "label": "doc.GenMan",
      "variant": "emphasis",
      "fromSide": "right",
      "toSide": "left"
    },
    {
      "id": "tree-to-genman",
      "from": "genman_tree_from_opts",
      "to": "genman",
      "label": "GenMan(cmd, &headerCopy, f)",
      "variant": "emphasis",
      "fromSide": "right",
      "toSide": "left"
    },
    {
      "id": "genman-to-header",
      "from": "genman",
      "to": "fill_header",
      "label": "DisableAutoGenTag",
      "variant": "security",
      "fromSide": "top",
      "toSide": "left"
    },
    {
      "id": "genman-to-render",
      "from": "genman",
      "to": "render_write",
      "label": "b := genMan(cmd, header)",
      "variant": "emphasis",
      "fromSide": "right",
      "toSide": "left"
    },
    {
      "id": "render-to-unknown-writer",
      "from": "render_write",
      "to": "writer_target",
      "label": "target unknown",
      "variant": "dashed",
      "fromSide": "right",
      "toSide": "left"
    }
  ],
  "cards": [
    {
      "dot": "cyan",
      "title": "Verified callers",
      "items": [
        "ExampleGenMan calls doc.GenMan at man_examples_test.go:33",
        "GenManTreeFromOpts calls GenMan directly at man_docs.go:78"
      ]
    },
    {
      "dot": "emerald",
      "title": "Header ownership",
      "items": [
        "GenMan passes cmd.DisableAutoGenTag to fillHeader at line 108",
        "fillHeader constructs the header at man_docs.go:117"
      ]
    },
    {
      "dot": "violet",
      "title": "Static-analysis limit",
      "items": [
        "Line 113 renders Markdown and calls io.Writer.Write",
        "Concrete writer implementations and the complete runtime caller set remain unknown"
      ]
    }
  ]
}
