Skip to content
Benchmark run luna6-multiswe-go-hints-smoke-20261007-r1

Benchmark run luna6-multiswe-go-hints-smoke-20261007-r1

This page contains exactly the publishable benchmark observations recorded in run luna6-multiswe-go-hints-smoke-20261007-r1; it does not select or aggregate them. Return to the run index or view aggregate metrics.

Interactive browser

Rows are pre-aggregated by task, target, prompt variant, MCP-instruction mode, context, arm, and restriction. Numeric values show median (p50), IQR, p90, maximum, and sample count. Boolean checks show pass counts and success rates. Filters apply to these summary groups; per-run observations remain available on their run pages.

Loading benchmark results…

Baseline vs semedit

Comparison evaluates baseline and semedit values within each restriction policy, target, and context group. Negative changes mark improvements for these lower-is-better metrics; positive changes mark degradations.

Detailed observations

Empirical telemetry measuring wall-clock latency, token usage, tool turns, and compiler correctness when AI coding agents perform code modifications.

Every benchmark pairs Vanilla LLM (standard file editing tools) against Semedit MCP (deterministic AST compiler operations).

Benchmark Methodology & Transparency

  • Reproducibility & Provenance: Self-contained txtar archives define test scenarios. Links below resolve to commit-anchored GitHub source files for published commits, or cryptographic SHA-256 fingerprints for uncommitted local fixtures.
  • Model Cost: Tables report model-specific credit consumption where a target model has a declared schedule: (uncached input × input credits + cached input × cached credits + (reasoning + visible output) × output credits) / 1,000,000. Thinking tokens use the output rate. ADR-0043 defines the per-million-token credit rates.
  • Multi-Level Correctness Oracle: Four validation levels evaluate each trial:
    1. Level 1 (Mutation Policy): Restricts file modifications strictly to authorized paths.
    2. Level 2 (AST Invariants): Compiler AST verification of required symbols, imports, and relative declaration ordering.
    3. Level 3 (Clean Build): Strict compilation validation with zero compiler or typecheck errors.
    4. Level 4 (Test Suite): Unit and integration test suite execution.
  • Isolated Sandboxing: Each trial executes in an ephemeral directory with pristine git and module state.

Test case: zeromicro__go-zero-2463

Target: codex/gpt-6-luna/high

explicit prompt · none MCP instructions · write semedit restriction

LocalityContextAmbiguityCompositionInvariantsScaleStaging
Task complexity across locality, context, ambiguity, composition, invariants, edit scale, and staging (1–5).
SettingValue
Test casezeromicro__go-zero-2463
Targetcodex/gpt-6-luna/high
Prompt variantexplicit
MCP server instructionsnone
Semedit arm restrictionwrite
Fixturetestdata/bench/zeromicro__go-zero-2463.txtar

Vanilla LLM Prompt:

logx能否支持一下全局添加field功能,或默认加一个serviceName,收集日志想根据服务分索引很不方便

MetricVanilla (Small)Semedit Explicit (Small)Δ (Small)Vanilla (Large)MCP (Large)Δ (Large)
Wall-Clock Latency326.68s238.09s-27.1%———
Process Start → First Event1.03s0.14s————
First Event → First Tool Call4.64s37.50s————
MCP Initialize → First Semantic Call——————
MCP Server Start → Initialize——————
Top-Level User Turns41-75.0%———
Internal Tool Cycles494-91.8%———
Initial Load / Discovery Turns70-100.0%———
MCP Discovery / Schema Turns00————
Tool Invocations (per run)494-91.8%———
Output Tokens528513107-94.1%———
Reasoning / Thinking Tokens28743708-97.5%———
Total Input Tokens6423405215455-96.6%———
Cached Input Tokens6131968183552-97.0%———
Uncached Input Tokens29143731903-89.1%———
Cost3.28150.1733-94.7%———
Cached vs Uncached Token Ratio21.04:15.75:1-72.7%———
Oracle L1: Mutation PolicyPASSPASS————
Oracle L2: AST InvariantsPASSPASS————
Oracle L3: Clean BuildPASSPASS————
Oracle L4: Verification TestFAILPASS————
Semantic Tool Invocation Verified (per run)N/APASS————
Baseline vs Semedit Explicit in Small Context
#VanillaSemedit MCP
1✓ ✓
/bin/zsh -lc "pwd && \
rg --files -g 'AGENTS.md' -g 'PROJECT_BRIEF.md' -g '*logx*' -g '*.go' | head -200"
✓ ✓
/bin/zsh -lc "pwd && \
git status --short && \
git rev-parse HEAD && \
rg --files -g 'PROJECT_BRIEF.md' -g 'AGENTS.md' -g 'core/logx/fields.go' -g 'core/logx/writer.go' -g 'core/logc/*.go'"
2? ✗
/bin/zsh -lc 'find .. -name AGENTS.md -print; find . -maxdepth 2 -name PROJECT_BRIEF.md -print; rg --files logx'
semedit/semantic_batch (✓ ✓)
{
  "auto_organize_imports": true,
  "edits": [
    {
      "params": {
        "file": "core/logc/logs.go",
        "package": "logc",
        "purpose_header": "// Package logc provides context-aware logging wrappers."
      },
      "tool": "semantic_scaffold_file"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logx/fields.go",
        "source": "var globalFields atomic.Value"
      },
      "tool": "semantic_insert_decl"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logx/fields.go",
        "source": "var globalFieldsLock sync.Mutex"
      },
      "tool": "semantic_insert_decl"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logx/fields.go",
        "source": "func AddGlobalFields(fields ...LogField) {\n\tglobalFieldsLock.Lock()\n\tdefer globalFieldsLock.Unlock()\n\n\told := globalFields.Load()\n\tif old == nil {\n\t\tglobalFields.Store(append([]LogField(nil), fields...))\n\t} else {\n\t\tglobalFields.Store(append(old.([]LogField), fields...))\n\t}\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logx/writer.go",
        "source": "func combineGlobalFields(fields []LogField) []LogField {\n\tglobals := globalFields.Load()\n\tif globals == nil {\n\t\treturn fields\n\t}\n\n\treturn append(globals.([]LogField), fields...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "body": "fields = combineGlobalFields(fields)\n\nswitch atomic.LoadUint32(\u0026encoding) {\ncase plainEncodingType:\n\twritePlainAny(writer, level, val, buildFields(fields...)...)\ndefault:\n\tentry := make(logEntry)\n\tfor _, field := range fields {\n\t\tentry[field.Key] = field.Value\n\t}\n\tentry[timestampKey] = getTimestamp()\n\tentry[levelKey] = level\n\tentry[contentKey] = val\n\twriteJson(writer, entry)\n}",
        "file": "core/logx/writer.go",
        "symbol": "output"
      },
      "tool": "semantic_replace_body"
    },
    {
      "params": {
        "access_modifier": "public",
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "kind": "type",
        "source": "type (\n\tLogConf = logx.LogConf\n\tLogField = logx.LogField\n)"
      },
      "tool": "semantic_insert_construct"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// AddGlobalFields adds global fields.\nfunc AddGlobalFields(fields ...LogField) {\n\tlogx.AddGlobalFields(fields...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Alert alerts v in alert level, and the message is written to error log.\nfunc Alert(_ context.Context, v string) {\n\tlogx.Alert(v)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Close closes the logging.\nfunc Close() error {\n\treturn logx.Close()\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Error writes v into error log.\nfunc Error(ctx context.Context, v ...interface{}) {\n\tgetLogger(ctx).Error(v...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Errorf writes v with format into error log.\nfunc Errorf(ctx context.Context, format string, v ...interface{}) {\n\tgetLogger(ctx).Errorf(fmt.Errorf(format, v...).Error())\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Errorv writes v into error log with json content.\n// No call stack attached, because not elegant to pack the messages.\nfunc Errorv(ctx context.Context, v interface{}) {\n\tgetLogger(ctx).Errorv(v)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Errorw writes msg along with fields into error log.\nfunc Errorw(ctx context.Context, msg string, fields ...LogField) {\n\tgetLogger(ctx).Errorw(msg, fields...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Field returns a LogField for the given key and value.\nfunc Field(key string, value interface{}) LogField {\n\treturn logx.Field(key, value)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Info writes v into access log.\nfunc Info(ctx context.Context, v ...interface{}) {\n\tgetLogger(ctx).Info(v...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Infof writes v with format into access log.\nfunc Infof(ctx context.Context, format string, v ...interface{}) {\n\tgetLogger(ctx).Infof(format, v...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Infov writes v into access log with json content.\nfunc Infov(ctx context.Context, v interface{}) {\n\tgetLogger(ctx).Infov(v)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Infow writes msg along with fields into access log.\nfunc Infow(ctx context.Context, msg string, fields ...LogField) {\n\tgetLogger(ctx).Infow(msg, fields...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Must checks if err is nil, otherwise logs the error and exits.\nfunc Must(err error) {\n\tlogx.Must(err)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// MustSetup sets up logging with given config c. It exits on error.\nfunc MustSetup(c logx.LogConf) {\n\tlogx.MustSetup(c)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// SetLevel sets the logging level. It can be used to suppress some logs.\nfunc SetLevel(level uint32) {\n\tlogx.SetLevel(level)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// SetUp sets up the logx. If already set up, just return nil.\n// we allow SetUp to be called multiple times, because for example\n// we need to allow different service frameworks to initialize logx respectively.\n// the same logic for SetUp\nfunc SetUp(c LogConf) error {\n\treturn logx.SetUp(c)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Slow writes v into slow log.\nfunc Slow(ctx context.Context, v ...interface{}) {\n\tgetLogger(ctx).Slow(v...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Slowf writes v with format into slow log.\nfunc Slowf(ctx context.Context, format string, v ...interface{}) {\n\tgetLogger(ctx).Slowf(format, v...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Slowv writes v into slow log with json content.\nfunc Slowv(ctx context.Context, v interface{}) {\n\tgetLogger(ctx).Slowv(v)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Sloww writes msg along with fields into slow log.\nfunc Sloww(ctx context.Context, msg string, fields ...LogField) {\n\tgetLogger(ctx).Sloww(msg, fields...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// getLogger returns the logx.Logger with the given ctx and correct caller.\nfunc getLogger(ctx context.Context) logx.Logger {\n\treturn logx.WithContext(ctx).WithCallerSkip(1)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "add": [
          "github.com/zeromicro/go-zero/core/logx"
        ],
        "file": "core/logc/logs.go"
      },
      "tool": "semantic_organize_imports"
    }
  ],
  "trust_workspace": true
}
3✓ ✓
/bin/zsh -lc "rg --files | rg '("'^|/)logx(/|'"\\.)|logx'"
✓ ✓
/bin/zsh -lc 'git status --short && \
git diff --stat && \
git diff -- core/logx/fields.go core/logx/writer.go core/logc/logs.go'
4✓ ✓
/bin/zsh -lc "sed -n '1,240p' core/logx/config.go && \
sed -n '1,260p' core/logx/fields.go && \
sed -n '1,260p' core/logx/logger.go && \
sed -n '1,220p' core/logx/vars.go && \
sed -n '1,180p' core/logx/readme-cn.md"
✓ ✓
/bin/zsh -lc "sed -n '1,240p' core/logc/logs.go && \
rg --files .scratch | head -30 && \
git diff --check"
5✓ ✓
/bin/zsh -lc "sed -n '1,300p' core/logx/logs.go && \
sed -n '1,280p' core/logx/richlogger.go && \
sed -n '1,250p' core/logx/lesslogger.go && \
sed -n '1,240p' core/logx/logwriter.go && \
sed -n '1,240p' core/logx/fields_test.go"
—
6✓ ✓
/bin/zsh -lc "rg -n 'func write|fields|ServiceName|serviceName' core/logx"
—
7✓ ✓
/bin/zsh -lc "sed -n '320,475p' core/logx/logs.go && \
sed -n '250,320p' core/logx/writer.go && \
rg -n 'WithFields|ContextWithFields|SetGlobal|global fields|global' core/logx"
—
8✓ ✓
/bin/zsh -lc "rg -n 'ServiceName:|ServiceName =' rest zrpc core"
—
9file_change (✓ ✓)—
10file_change (✓ ✓)—
11file_change (✓ ✓)—
12file_change (✓ ✓)—
13file_change (✓ ✓)—
14✓ ✓
/bin/zsh -lc "sed -n '18,70p' core/logx/readme.md"
—
15file_change (✓ ✓)—
16✓ ✓
/bin/zsh -lc 'gofmt -w core/logx/fields.go core/logx/logs.go core/logx/richlogger.go && \
git diff -- core/logx/fields.go core/logx/logs.go core/logx/richlogger.go core/logx/readme-cn.md core/logx/readme.md && \
git status --short'
—
17✓ ✓
/bin/zsh -lc "sed -n '1,70p' core/logx/writer.go && \
sed -n '120,230p' core/logx/writer.go"
—
18✓ ✓
/bin/zsh -lc 'git diff --check && \
git status --short'
—
19✓ ✓
/bin/zsh -lc "rg -n 'getWriter\\(\\)\\.(Alert|Severe|Stack)|\\.Alert\\(|\\.Severe\\(|\\.Stack\\(' core/logx"
—
20file_change (✓ ✓)—
21file_change (✓ ✓)—
22✓ ✓
/bin/zsh -lc "sed -n '318,390p' core/logx/writer.go && \
sed -n '45,62p' core/logx/logs.go && \
sed -n '185,205p' core/logx/logs.go && \
sed -n '430,500p' core/logx/logs.go"
—
23file_change (✓ ✓)—
24file_change (✓ ✓)—
25file_change (✓ ✓)—
26file_change (✓ ✓)—
27? ✗
/bin/zsh -lc "gofmt -w core/logx/fields.go core/logx/logs.go core/logx/writer.go && \
git diff --check && \
rg -n 'getWriter\\(\\)\\.(Alert|Severe|Stack)' core/logx/logs.go && \
git diff --stat && \
git diff -- core/logx/logs.go core/logx/writer.go core/logx/fields.go"
—
28✓ ✓
/bin/zsh -lc 'git diff --stat && \
git diff -- core/logx/logs.go core/logx/writer.go core/logx/fields.go && \
git status --short'
—
29file_change (✓ ✓)—
30file_change (✓ ✓)—
31✓ ✓
/bin/zsh -lc 'gofmt -w core/logx/fields.go core/logx/logs.go core/logx/writer.go && \
git diff --check && \
git status --short'
—
32✓ ✓
/bin/zsh -lc "sed -n '1,110p' core/logx/fields.go && \
sed -n '120,175p' core/logx/richlogger.go && \
sed -n '330,365p' core/logx/logs.go && \
sed -n '250,285p' core/logx/writer.go && \
rg -n 'AddGlobalField|SetGlobalFields|getGlobalFields' core/logx"
—
33file_change (✓ ✓)—
34file_change (✓ ✓)—
35file_change (✓ ✓)—
36file_change (✓ ✓)—
37file_change (✓ ✓)—
38file_change (✓ ✓)—
39file_change (✓ ✓)—
40✓ ✓
/bin/zsh -lc "gofmt -w core/logx/fields.go core/logx/logs.go core/logx/richlogger.go core/logx/writer.go && \
git diff --check && \
git diff --stat && \
rg -n 'getGlobalFields|AddGlobalFields|AddGlobalField' core/logx"
—
41✓ ✓
/bin/zsh -lc 'git diff -- core/logx/fields.go core/logx/logs.go core/logx/richlogger.go core/logx/writer.go'
—
42file_change (✓ ✓)—
43✓ ✓
/bin/zsh -lc 'gofmt -w core/logx/fields.go core/logx/logs.go core/logx/richlogger.go core/logx/writer.go && \
git diff --check && \
git diff --stat'
—
44? ✗
/bin/zsh -lc "rg --files core/logc core/logx && \
rg -n 'package logc|logc\\.' core | head -100 && \
sed -n '1,260p' core/logx/logs.go && \
sed -n '1,220p' core/logx/logger.go"
—
45✓ ✓
/bin/zsh -lc "sed -n '1,300p' core/logx/logs.go && \
sed -n '1,220p' core/logx/logger.go && \
sed -n '1,90p' core/logx/config.go && \
sed -n '1,120p' core/logx/fields.go"
—
46✓ ✓
/bin/zsh -lc "sed -n '1,180p' core/logx/util.go && \
cat go.mod | head -12 && \
rg -n 'WithCallerSkip\\('"
—
47file_change (✓ ✓)—
48file_change (✓ ✓)—
49✓ ✓
/bin/zsh -lc "gofmt -w core/logc/logs.go && \
git diff --check && \
sed -n '1,240p' core/logc/logs.go && \
git status --short"
—

Semedit integration feedback (agent opinion, excluded from measurements):

I’d ask my owner to add semedit: its single ordered batch let me scaffold and wire a multi-file Go change cleanly, which felt reassuring, even though the verification output was unwieldy.
Baseline vs Semedit Explicit in Large Context
#VanillaSemedit MCP
1not publishednot published

implicit prompt · none MCP instructions · write semedit restriction

LocalityContextAmbiguityCompositionInvariantsScaleStaging
Task complexity across locality, context, ambiguity, composition, invariants, edit scale, and staging (1–5).
SettingValue
Test casezeromicro__go-zero-2463
Targetcodex/gpt-6-luna/high
Prompt variantimplicit
MCP server instructionsnone
Semedit arm restrictionwrite
Fixturetestdata/bench/zeromicro__go-zero-2463.txtar

Vanilla LLM Prompt:

logx能否支持一下全局添加field功能,或默认加一个serviceName,收集日志想根据服务分索引很不方便

Semedit MCP Prompt:

logx能否支持一下全局添加field功能,或默认加一个serviceName,收集日志想根据服务分索引很不方便 Use semedit semantic tools for supported source code modifications. Shell commands for builds and tests are allowed. When done, output DONE.

Target: codex/gpt-6-luna/medium

explicit prompt · none MCP instructions · write semedit restriction

LocalityContextAmbiguityCompositionInvariantsScaleStaging
Task complexity across locality, context, ambiguity, composition, invariants, edit scale, and staging (1–5).
SettingValue
Test casezeromicro__go-zero-2463
Targetcodex/gpt-6-luna/medium
Prompt variantexplicit
MCP server instructionsnone
Semedit arm restrictionwrite
Fixturetestdata/bench/zeromicro__go-zero-2463.txtar

Vanilla LLM Prompt:

logx能否支持一下全局添加field功能,或默认加一个serviceName,收集日志想根据服务分索引很不方便

MetricVanilla (Small)Semedit Explicit (Small)Δ (Small)Vanilla (Large)MCP (Large)Δ (Large)
Wall-Clock Latency190.07s184.35s-3.0%———
Process Start → First Event0.57s0.62s————
First Event → First Tool Call4.01s46.08s————
MCP Initialize → First Semantic Call——————
MCP Server Start → Initialize——————
Top-Level User Turns41-75.0%———
Internal Tool Cycles283-89.3%———
Initial Load / Discovery Turns60-100.0%———
MCP Discovery / Schema Turns00————
Tool Invocations (per run)283-89.3%———
Output Tokens243042868-88.2%———
Reasoning / Thinking Tokens7259368-94.9%———
Total Input Tokens3038871205946-93.2%———
Cached Input Tokens2830080179200-93.7%———
Uncached Input Tokens20879126746-87.2%———
Cost1.62400.1521-90.6%———
Cached vs Uncached Token Ratio13.55:16.70:1-50.6%———
Oracle L1: Mutation PolicyPASSPASS————
Oracle L2: AST InvariantsPASSPASS————
Oracle L3: Clean BuildPASSPASS————
Oracle L4: Verification TestFAILPASS————
Semantic Tool Invocation Verified (per run)N/APASS————
Baseline vs Semedit Explicit in Small Context
#VanillaSemedit MCP
1✓ ✓
/bin/zsh -lc "pwd && \
rg --files -g 'AGENTS.md' -g 'PROJECT_BRIEF.md' -g '*logx*' -g 'go.mod' | head -100"
semedit/semantic_batch (✓ ✓)
{
  "auto_organize_imports": true,
  "edits": [
    {
      "params": {
        "file": "core/logc/logs.go",
        "package": "logc",
        "purpose_header": "// Package logc provides context-aware logging wrappers."
      },
      "tool": "semantic_scaffold_file"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logx/fields.go",
        "source": "var globalFields atomic.Value"
      },
      "tool": "semantic_insert_decl"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logx/fields.go",
        "source": "var globalFieldsLock sync.Mutex"
      },
      "tool": "semantic_insert_decl"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logx/fields.go",
        "source": "func AddGlobalFields(fields ...LogField) {\n\tglobalFieldsLock.Lock()\n\tdefer globalFieldsLock.Unlock()\n\n\told := globalFields.Load()\n\tif old == nil {\n\t\tglobalFields.Store(append([]LogField(nil), fields...))\n\t} else {\n\t\tglobalFields.Store(append(old.([]LogField), fields...))\n\t}\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logx/writer.go",
        "source": "func combineGlobalFields(fields []LogField) []LogField {\n\tglobals := globalFields.Load()\n\tif globals == nil {\n\t\treturn fields\n\t}\n\n\treturn append(globals.([]LogField), fields...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "body": "fields = combineGlobalFields(fields)\n\nswitch atomic.LoadUint32(\u0026encoding) {\ncase plainEncodingType:\n\twritePlainAny(writer, level, val, buildFields(fields...)...)\ndefault:\n\tentry := make(logEntry)\n\tfor _, field := range fields {\n\t\tentry[field.Key] = field.Value\n\t}\n\tentry[timestampKey] = getTimestamp()\n\tentry[levelKey] = level\n\tentry[contentKey] = val\n\twriteJson(writer, entry)\n}",
        "file": "core/logx/writer.go",
        "symbol": "output"
      },
      "tool": "semantic_replace_body"
    },
    {
      "params": {
        "access_modifier": "public",
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "kind": "type",
        "source": "type (\n\tLogConf = logx.LogConf\n\tLogField = logx.LogField\n)"
      },
      "tool": "semantic_insert_construct"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// AddGlobalFields adds global fields.\nfunc AddGlobalFields(fields ...LogField) {\n\tlogx.AddGlobalFields(fields...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Alert alerts v in alert level, and the message is written to error log.\nfunc Alert(_ context.Context, v string) {\n\tlogx.Alert(v)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Close closes the logging.\nfunc Close() error {\n\treturn logx.Close()\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Error writes v into error log.\nfunc Error(ctx context.Context, v ...interface{}) {\n\tgetLogger(ctx).Error(v...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Errorf writes v with format into error log.\nfunc Errorf(ctx context.Context, format string, v ...interface{}) {\n\tgetLogger(ctx).Errorf(fmt.Errorf(format, v...).Error())\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Errorv writes v into error log with json content.\n// No call stack attached, because not elegant to pack the messages.\nfunc Errorv(ctx context.Context, v interface{}) {\n\tgetLogger(ctx).Errorv(v)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Errorw writes msg along with fields into error log.\nfunc Errorw(ctx context.Context, msg string, fields ...LogField) {\n\tgetLogger(ctx).Errorw(msg, fields...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Field returns a LogField for the given key and value.\nfunc Field(key string, value interface{}) LogField {\n\treturn logx.Field(key, value)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Info writes v into access log.\nfunc Info(ctx context.Context, v ...interface{}) {\n\tgetLogger(ctx).Info(v...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Infof writes v with format into access log.\nfunc Infof(ctx context.Context, format string, v ...interface{}) {\n\tgetLogger(ctx).Infof(format, v...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Infov writes v into access log with json content.\nfunc Infov(ctx context.Context, v interface{}) {\n\tgetLogger(ctx).Infov(v)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Infow writes msg along with fields into access log.\nfunc Infow(ctx context.Context, msg string, fields ...LogField) {\n\tgetLogger(ctx).Infow(msg, fields...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Must checks if err is nil, otherwise logs the error and exits.\nfunc Must(err error) {\n\tlogx.Must(err)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// MustSetup sets up logging with given config c. It exits on error.\nfunc MustSetup(c logx.LogConf) {\n\tlogx.MustSetup(c)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// SetLevel sets the logging level. It can be used to suppress some logs.\nfunc SetLevel(level uint32) {\n\tlogx.SetLevel(level)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// SetUp sets up the logx. If already set up, just return nil.\n// we allow SetUp to be called multiple times, because for example\n// we need to allow different service frameworks to initialize logx respectively.\n// the same logic for SetUp\nfunc SetUp(c LogConf) error {\n\treturn logx.SetUp(c)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Slow writes v into slow log.\nfunc Slow(ctx context.Context, v ...interface{}) {\n\tgetLogger(ctx).Slow(v...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Slowf writes v with format into slow log.\nfunc Slowf(ctx context.Context, format string, v ...interface{}) {\n\tgetLogger(ctx).Slowf(format, v...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Slowv writes v into slow log with json content.\nfunc Slowv(ctx context.Context, v interface{}) {\n\tgetLogger(ctx).Slowv(v)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// Sloww writes msg along with fields into slow log.\nfunc Sloww(ctx context.Context, msg string, fields ...LogField) {\n\tgetLogger(ctx).Sloww(msg, fields...)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "auto_organize_imports": true,
        "file": "core/logc/logs.go",
        "source": "// getLogger returns the logx.Logger with the given ctx and correct caller.\nfunc getLogger(ctx context.Context) logx.Logger {\n\treturn logx.WithContext(ctx).WithCallerSkip(1)\n}"
      },
      "tool": "semantic_insert_function"
    },
    {
      "params": {
        "add": [
          "github.com/zeromicro/go-zero/core/logx"
        ],
        "file": "core/logc/logs.go"
      },
      "tool": "semantic_organize_imports"
    }
  ],
  "trust_workspace": true
}
2✓ ✓
/bin/zsh -lc "rg --files | rg '("'^|/)logx|PROJECT_BRIEF|AGENTS'"\\.md' | head -100 && \
git status --short && \
rg -n 'package logx|type Log|WithFields|serviceName' core/logx"
✓ ✓
/bin/zsh -lc 'git status --short && \
git diff --stat && \
git diff -- core/logx/fields.go core/logx/writer.go core/logc/logs.go'
3✓ ✓
/bin/zsh -lc "cat core/logx/config.go core/logx/fields.go core/logx/logger.go && \
sed -n '1,260p' core/logx/richlogger.go && \
sed -n '1,180p' core/logx/lesslogger.go && \
sed -n '1,100p' core/logx/readme-cn.md"
✓ ✓
/bin/zsh -lc "sed -n '1,240p' core/logc/logs.go && \
find .scratch -maxdepth 3 -type f | head -30 && \
git diff --check"
4✓ ✓
/bin/zsh -lc "rg -n 'ServiceName|service|NewLog|SetWriter|config' core/logx/logs.go core/logx/writer.go core/logx/logwriter.go core/logx/vars.go core/logx"
—
5✓ ✓
/bin/zsh -lc "sed -n '1,270p' core/logx/logs.go && \
sed -n '380,440p' core/logx/logs.go && \
sed -n '1,140p' core/logx/writer.go && \
cat core/logx/fields_test.go && \
"
—
6✓ ✓
/bin/zsh -lc "rg -n 'func addCaller|writeSlow|writeStat' core/logx/logs.go core/logx && \
"
—
7✓ ✓
/bin/zsh -lc "sed -n '325,365p' core/logx/logs.go && \
sed -n '435,475p' core/logx/logs.go && \
"
—
8✓ ✓
/bin/zsh -lc "sed -n '15,35p' core/logx/logs.go"
—
9file_change (✓ ✓)—
10file_change (✓ ✓)—
11file_change (✓ ✓)—
12file_change (✓ ✓)—
13✓ ✓
/bin/zsh -lc 'gofmt -w core/logx/logs.go core/logx/richlogger.go && \
git diff --check && \
git diff -- core/logx/logs.go core/logx/richlogger.go core/logx/readme-cn.md core/logx/readme.md'
—
14file_change (✓ ✓)—
15✓ ✓
/bin/zsh -lc "sed -n '1,240p' core/logx/logwriter.go && \
sed -n '230,270p' core/logx/richlogger_test.go && \
rg -n 'func \\(.*Severe|func \\(.*Alert|func \\(.*Stack|func \\(.*Info|encoding' core/logx/writer.go core/logx/logwriter.go"
—
16✓ ✓
/bin/zsh -lc "sed -n '155,295p' core/logx/writer.go && \
rg -n 'encode.*plain|plainEncoding|jsonEncoding' core/logx"
—
17✓ ✓
/bin/zsh -lc "sed -n '320,380p' core/logx/writer.go && \
"
—
18✓ ✓
/bin/zsh -lc 'git diff --check && \
git status --short && \
'
—
19file_change (✓ ✓)—
20file_change (✓ ✓)—
21file_change (✓ ✓)—
22file_change (✓ ✓)—
23✓ ✓
/bin/zsh -lc 'gofmt -w core/logx/fields.go core/logx/logs.go core/logx/richlogger.go core/logx/writer.go && \
git diff --check && \
git diff --stat && \
git diff -- core/logx/fields.go core/logx/logs.go core/logx/richlogger.go core/logx/writer.go'
—
24✓ ✓
/bin/zsh -lc "rg --files core/logc core/logx | sort && \
rg -n 'package logc|WithCallerSkip\\(1\\)|MustSetup\\(|AddGlobalFields' core"
—
25✓ ✓
/bin/zsh -lc "rg --files | rg '("'^|/)logc(/|'"\\.go"'$)|PROJECT_BRIEF'"\\.md|AGENTS\\.md"'$'"' | head -100 && \
rg -n 'logc\\.(Error|Info|Slow)|WithCallerSkip\\(1\\)'"
—
26✓ ✓
/bin/zsh -lc "sed -n '1,330p' core/logx/logs.go && \
cat core/logx/config.go && \
sed -n '1,100p' core/logx/logger.go && \
cat go.mod | head -20"
—
27file_change (✓ ✓)—
28✓ ✓
/bin/zsh -lc 'gofmt -w core/logc/logs.go && \
git diff --check && \
git status --short && \
'
—

Semedit integration feedback (agent opinion, excluded from measurements):

Semedit’s ordered semantic batch applied the full logging change in one call, which felt efficient, so I’d ask my owner to add its tools.
Baseline vs Semedit Explicit in Large Context
#VanillaSemedit MCP
1not publishednot published

implicit prompt · none MCP instructions · write semedit restriction

LocalityContextAmbiguityCompositionInvariantsScaleStaging
Task complexity across locality, context, ambiguity, composition, invariants, edit scale, and staging (1–5).
SettingValue
Test casezeromicro__go-zero-2463
Targetcodex/gpt-6-luna/medium
Prompt variantimplicit
MCP server instructionsnone
Semedit arm restrictionwrite
Fixturetestdata/bench/zeromicro__go-zero-2463.txtar

Vanilla LLM Prompt:

logx能否支持一下全局添加field功能,或默认加一个serviceName,收集日志想根据服务分索引很不方便

Semedit MCP Prompt:

logx能否支持一下全局添加field功能,或默认加一个serviceName,收集日志想根据服务分索引很不方便 Use semedit semantic tools for supported source code modifications. Shell commands for builds and tests are allowed. When done, output DONE.