Skip to content

Code Analysis Go Direct Calls

Tu Shaokun edited this page Nov 7, 2026 · 2 revisions

Go direct source functions and known callers

Validated in Draft, not in Labs: #1256, source 4ff07af962f5dc613f3b570d42c17a016b06e480, evidence/package head 561957dd275f6d33991865c4c6db36b1c4b87dab. Native stack #1257 contains source-first baseline #1255 → Go #1256, on top of #1252. Original A1/A2, Java/Python/JS/TS commits and PR ownership remain retained. No merge, approval, release or live installation.

A real next step for a developer

Before: --language go fails at selection, extract/adapter-unknown, exit 2.

After: in fixed Cobra, the normal CLI follows doc_test.ExampleGenMan → doc.GenMan (doc/man_docs.go:104) → fillHeader:117. The upstream change adds DisableAutoGenTag forwarding. A paired question identifies the changed definitions and lists seven captured direct GenMan references in each version. The originally frozen external example and production tree-generator calls have valid source navigation. Five further test references were subsequently source-checked separately.

Still unknown: which io.Writer.Write implementation executes, complete runtime callers and whether every selected source package compiles. Read coverage even when --fail-on never exits 0.

Full fixed-source report and commands · Replay script · Parity.

Real sources and finite score

  • Cobra 41fd44e1df83ad6acd8e14b304d5f2a2ae1d62f5 → e392f3204db0445f1f4ad47448b04d8c8ad04c2a: changed GenMan/fillHeader, cross-package external test and same-package direct references.
  • Chi 71307f9b7e4e9527638bc951c42b782cd1560331: two ordinary-import chi.RouteContext calls in middleware/strip.go reach context.go:27; next.ServeHTTP stays unknown.
  • Supplemental grpc-go 98a0092952dd4d8443229c3a335ec592d9c40c9b: clientconn.go:757 iresolver.GetConfigSelector → internal/resolver/config_selector.go:141; Attributes.Value method dispatch stays unknown.

Source and ZIP each produce 9 correct / 0 wrong / 0 missed targets / 0 omitted calls / 5 reasonable unknowns. Nine means versioned observations of six distinct physical call sites, not nine definitions, whole-project accuracy or a blind evaluation. Parent target coverage is unavailable because language selection fails.

Source-oracle correction: the original frozen Chi presenter alias expectation was incorrect. _examples/versions/go.mod declares module versions, inconsistent with the GitHub presenter imports. Root-module capture also excludes that nested module. The original manifest remains immutable; this is an oracle error/unknown boundary, not an analyzer success or miss. grpc is separately labeled supplemental source evidence, inspected after the generic helper began but before candidate execution.

Build scope and unknowns

Go uses the installed standard-library parser, AST, build constraints and type-binding APIs with captured bytes. No external module download, project build or project-code execution occurs in the analyzer. Root go.mod defines module identity; ordinary/alias imports and same-package cross-file free functions can bind to captured declarations. Imported package source membership is distinct from a per-symbol definition target.

Actual local scope: Go 1.27.2, Darwin/arm64, empty custom tags, Go release tags recorded, tests included, cgo disabled. Production, internal tests and external tests have separate variants. Explicit GOOS/GOARCH/tags/tests are configurable. coverage.languageScope/raw facts list source files, exclusions, packages, metadata and incomplete typing; parse failures are separate. Workspaces, replace, vendor, nested modules, cgo/generated build output and ambient GOFLAGS are not loaded.

External declarations—including standard-library types—are not loaded, so type information is incomplete. Diagnostic counts across package/test variants may repeat; they are not unique project defects. Receiver declarations are inventoried, but method/interface/function-variable dispatch, closures as direct targets, struct/type/field navigation and complete impact remain unsupported. Metadata/source freshness is checked; whole-tree atomic capture/new files after capture are not established.

Go 1.18+ compiler required; only installed 1.27.2 tested locally. Missing Go gives structured extract/go-unavailable, exit 2, with installation/ARCHIFY_GO guidance. Existing installation size 270 MiB; tiny helper measured 2.46s with an empty compiler cache, 0.27s reusing it. Fresh download/install cost unmeasured. Separate fixed Cobra/Chi test-package compilation succeeded without executing binaries; Cobra downloaded five pinned modules. This comparison supports the limited source backend choice, not a performance claim.

Verification status

Layer Evidence
Local focused tests 57 pass; six Go checks cover aliases, shadows, duplicates, test/package/build identity, UTF-16 positions, metadata freshness and missing compiler.
Local module suite 349 pass / 1 fail / 0 skipped. ts-snapshot.test.mjs:89 installed-configuration assertion fails identically on the fixed parent; cause unresolved.
Source/ZIP CLI Six commands per distribution, all exit 0. Four raw-facts files byte-identical; saved/paired questions equal after only installation/output/workflow path normalization.
Package 160 tracked module files match; six Go checks pass from extracted ZIP. Two canonical builds equal, SHA-256 534a2a17a2f7b813270878a8de47e9914126535fe591bcd441475760a915b85a.
Remote CI Run 42383373703, exact head 561957dd2: Linux/Node 22 module suite 350/350 pass, including six Go checks. Overall run failed only README Classic artifact drift in full-regression (2) plus its aggregate Node 22 gate; exact expected/actual hashes match parent run 42381100752. All other executed jobs passed.
Merge/release/install None; maintainer decision remains required.

Runtime CLI Node 26.12.0; canonical build Node 22.23.3 / bundled zlib. Local macOS only; Windows path normalization is implemented; remote package-smoke/portability checks passed, but their logs do not establish Go-specific runtime tests. Local macOS TS snapshot assertion failure does not reproduce in Linux/Node22 CI; its cause remains unestablished. Development fixture/audit corrections and the superseded first candidate ZIP are retained/disclosed in the full report.

Next: frozen Rust crate-local explicit/use/use-as paths, then Cargo workspace boundary; report cfg/features, macros and trait dispatch from evidence. After both first rounds, prioritize actual wrong targets, misses and interrupted investigations across all supported languages.

Clone this wiki locally