session/replaytest: add multi-backend replay consistency harness#2272
session/replaytest: add multi-backend replay consistency harness#2272ltyfulan9 wants to merge 4 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughEnglishOverviewAdds a reusable Public API and compatibilityNew exported Go API surface (new package; no existing APIs changed):
Questions to review:
Behavioral and operational risks
Recommended validationRun (as applicable to your environment): go test ./session/replaytest/...
go test -race ./session/replaytest/...
go test -count=10 ./session/replaytest/...
go vet ./session/replaytest/...
go test ./...
# SQLite integration (CGO required)
cd session/replaytest/sqlite
CGO_ENABLED=1 go test ./Specifically verify:
中文变更概览新增可复用的 公共 API 与兼容性新增一个规模较大的“新包”公共 Go API(未改动既有 API):
建议重点评审问题:
行为与运维风险
建议验证按环境执行: go test ./session/replaytest/...
go test -race ./session/replaytest/...
go test -count=10 ./session/replaytest/...
go vet ./session/replaytest/...
go test ./...
# SQLite 集成(需要 CGO)
cd session/replaytest/sqlite
CGO_ENABLED=1 go test ./重点确认:
WalkthroughChangesReplay consistency harness
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| } | ||
| close(start) | ||
| wg.Wait() | ||
| return errors.Join(errs...) |
There was a problem hiding this comment.
StepConcurrent leaves e.session stale, so a following summary omits branch events. Reload after successful joins before returning.
中文
StepConcurrent 会让 `e.session` 保持旧状态,因此后续摘要会漏掉分支事件。成功等待所有分支后先重新加载再返回。| require ( | ||
| github.com/mattn/go-sqlite3 v1.14.32 | ||
| trpc.group/trpc-go/trpc-agent-go v1.6.1-0.20260311094958-7b74ee59e339 | ||
| trpc.group/trpc-go/trpc-agent-go/memory/sqlite v0.0.0 |
There was a problem hiding this comment.
The v0.0.0 sibling requirements make this module fail for consumers because dependency replace directives are ignored. Use published sibling versions here.
中文
这些 `v0.0.0` 同级依赖会让消费者构建失败,因为依赖模块中的 replace 会被忽略。这里改用已发布的同级模块版本。There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
session/replaytest/runner.go (1)
29-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument the zero-value contract of
Runner's exported fields.
Mode(empty →ComparisonReference),Reference(empty →backends[0].Namein reference mode; must be empty in consensus mode), andNow(nil →time.Now) all carry meaningful default semantics that are currently only discoverable by readingRun. Add per-field Godoc so external consumers can rely on a stable contract.As per path instructions: "whether defaults, zero values, nil inputs ... are defined where relevant" and "Require exported declaration comments to begin with the declared name and describe the caller-visible contract."
中文
为
Runner的导出字段补充零值契约文档。Mode(空 →ComparisonReference)、Reference(reference 模式下空 →backends[0].Name;consensus 模式下必须为空)、Now(nil →time.Now)都带有重要的默认语义,目前只能通过阅读Run才能得知。建议为每个字段添加 Godoc,使外部使用者能依赖稳定契约。依据 path instructions:需说明默认值/零值/nil 行为,且导出声明注释应以声明名开头并描述调用方可见的契约。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@session/replaytest/runner.go` around lines 29 - 33, Document each exported Runner field with Godoc comments beginning with its field name: state that Mode’s zero value selects ComparisonReference, Reference defaults to backends[0].Name in reference mode and must be empty in consensus mode, and Now uses time.Now when nil.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@session/replaytest/sqlite/factory.go`:
- Around line 89-99: Update openDB to call db.SetMaxOpenConns(1) immediately
after sql.Open succeeds, before db.Ping, so SQLite access uses a single pooled
connection and serializes writers. Preserve the existing error handling and
close behavior.
In `@session/replaytest/sqlite/go.mod`:
- Around line 12-39: Update the go.mod dependency graph so
google.golang.org/grpc resolves to v1.79.3 and go.opentelemetry.io/otel/sdk
resolves to v1.43.0, including any required related module updates. Run go mod
tidy in this module and commit the resulting go.mod/go.sum changes so indirect
dependencies no longer select the vulnerable versions.
---
Nitpick comments:
In `@session/replaytest/runner.go`:
- Around line 29-33: Document each exported Runner field with Godoc comments
beginning with its field name: state that Mode’s zero value selects
ComparisonReference, Reference defaults to backends[0].Name in reference mode
and must be empty in consensus mode, and Now uses time.Now when nil.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a9ab47d3-0110-4763-b75f-8d5b5ca8f215
⛔ Files ignored due to path filters (1)
session/replaytest/sqlite/go.sumis excluded by!**/*.sum
📒 Files selected for processing (18)
session/replaytest/DESIGN.mdsession/replaytest/README.mdsession/replaytest/backend.gosession/replaytest/cases.gosession/replaytest/compare.gosession/replaytest/consensus.gosession/replaytest/doc.gosession/replaytest/fault.gosession/replaytest/normalize.gosession/replaytest/replaytest_test.gosession/replaytest/report.gosession/replaytest/runner.gosession/replaytest/sqlite/README.mdsession/replaytest/sqlite/factory.gosession/replaytest/sqlite/go.modsession/replaytest/sqlite/integration_test.gosession/replaytest/testdata/session_memory_summary_track_diff_report.jsonsession/replaytest/types.go
| func openDB(path string) (*sql.DB, error) { | ||
| dsn := "file:" + filepath.ToSlash(path) + "?_busy_timeout=5000&_foreign_keys=on" | ||
| db, err := sql.Open("sqlite3", dsn) | ||
| if err != nil { | ||
| return nil, err | ||
| } | ||
| if err := db.Ping(); err != nil { | ||
| return nil, errors.Join(err, db.Close()) | ||
| } | ||
| return db, nil | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🌐 Web query:
mattn go-sqlite3 database/sql concurrent writes SQLITE_BUSY SetMaxOpenConns(1)
💡 Result:
When using mattn/go-sqlite3, the SQLITE_BUSY (database is locked) error typically occurs because SQLite does not support concurrent write transactions to the same database file [1][2]. While Go's database/sql package manages a connection pool that is safe for concurrent use, SQLite's underlying limitations require specific configuration to handle these collisions effectively [1][3]. The most common and effective strategies to mitigate SQLITE_BUSY are: 1. Use Write-Ahead Logging (WAL) Mode: Configure your database connection to use WAL mode by appending _journal_mode=WAL to your connection string [4][5][2]. This allows multiple readers to operate concurrently with a single writer, significantly reducing locking issues [1][4][5]. 2. Limit Write Connections: Since SQLite does not support concurrent writes, it is highly recommended to throttle your write-side connection pool to a single connection using db.SetMaxOpenConns(1) [1][4][5]. This effectively serializes write access at the application level before it reaches the database [6][3]. 3. Implement a Busy Timeout: Append a _busy_timeout parameter to your connection string (e.g.,?_busy_timeout=5000 for a 5000ms timeout) [7][6][8]. This instructs SQLite to automatically retry lock acquisition for the specified duration before returning a SQLITE_BUSY error [6][9][8]. 4. Use Separate Pools for Reads and Writes: A recommended best practice is to maintain two separate sql.DB instances [1][4][2]: - A Read-Write pool: Throttled to SetMaxOpenConns(1), using _txlock=immediate to start transactions with BEGIN IMMEDIATE, which helps avoid deadlocks [1][4][2]. - A Read-Only pool: Configured for concurrent access as needed, using BEGIN DEFERRED [1][2]. Avoid using cache=shared mode, as it is generally discouraged by SQLite maintainers and can complicate concurrency [4][2]. Always ensure your connection string starts with the file: prefix to correctly interpret these parameters [4][2].
Citations:
- 1: Possible solutions to the concurrency problems mattn/go-sqlite3#1179
- 2: Database is locked -- Why do we inform people to enabled shared cache mode? mattn/go-sqlite3#632
- 3: https://go.dev/doc/database/manage-connections
- 4: [Advice Needed] What is a proper way to query concurrently? mattn/go-sqlite3#1022
- 5: https://engineered.at/articles/resolve-database-is-locked-with-go-and-sqlite
- 6: database is locked mattn/go-sqlite3#274
- 7: https://github.com/mattn/go-sqlite3/wiki/FAQ
- 8: Implement support for busy handler mattn/go-sqlite3#290
- 9: database is locked mattn/go-sqlite3#274
Serialize SQLite writers with a single connection.
openDB uses the default database/sql pool, so SQLite can open multiple connections here. The parallel concurrent_interleaving case can then hit SQLITE_BUSY/lock contention even with _busy_timeout; cap the pool with db.SetMaxOpenConns(1) (and enable WAL if parallel reads are needed).
中文
将 SQLite 写入串行化,限制为单连接。
openDB 使用默认的 database/sql 连接池,SQLite 可能因此同时打开多个连接。并行的 concurrent_interleaving 用例会更容易遇到 SQLITE_BUSY/锁竞争,即使设置了 _busy_timeout 也可能受影响;建议用 db.SetMaxOpenConns(1) 限制连接池(如果还需要并发读,可再启用 WAL)。
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@session/replaytest/sqlite/factory.go` around lines 89 - 99, Update openDB to
call db.SetMaxOpenConns(1) immediately after sql.Open succeeds, before db.Ping,
so SQLite access uses a single pooled connection and serializes writers.
Preserve the existing error handling and close behavior.
| require ( | ||
| github.com/cenkalti/backoff/v4 v4.3.0 // indirect | ||
| github.com/go-ego/gse v1.0.0 // indirect | ||
| github.com/go-logr/logr v1.4.2 // indirect | ||
| github.com/go-logr/stdr v1.2.2 // indirect | ||
| github.com/google/uuid v1.6.0 // indirect | ||
| github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect | ||
| github.com/vcaesar/cedar v0.20.2 // indirect | ||
| go.opentelemetry.io/otel v1.29.0 // indirect | ||
| go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.29.0 // indirect | ||
| go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.29.0 // indirect | ||
| go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.29.0 // indirect | ||
| go.opentelemetry.io/otel/metric v1.29.0 // indirect | ||
| go.opentelemetry.io/otel/sdk v1.29.0 // indirect | ||
| go.opentelemetry.io/otel/trace v1.29.0 // indirect | ||
| go.opentelemetry.io/proto/otlp v1.3.1 // indirect | ||
| go.uber.org/multierr v1.10.0 // indirect | ||
| go.uber.org/zap v1.27.0 // indirect | ||
| golang.org/x/net v0.34.0 // indirect | ||
| golang.org/x/sys v0.30.0 // indirect | ||
| golang.org/x/text v0.21.0 // indirect | ||
| google.golang.org/genproto/googleapis/api v0.0.0-20240822170219-fc7c04adadcd // indirect | ||
| google.golang.org/genproto/googleapis/rpc v0.0.0-20240822170219-fc7c04adadcd // indirect | ||
| google.golang.org/grpc v1.65.0 // indirect | ||
| google.golang.org/protobuf v1.34.2 // indirect | ||
| gopkg.in/yaml.v3 v3.0.1 // indirect | ||
| trpc.group/trpc-go/trpc-a2a-go v0.2.5 // indirect | ||
| ) |
There was a problem hiding this comment.
🔒 Security & Privacy | 🔴 Critical | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
gh api graphql -f query='
{
grpc: securityVulnerabilities(first: 3, ecosystem: GO, package: "google.golang.org/grpc") {
nodes { advisory { ghsaId summary severity } firstPatchedVersion { identifier } vulnerableVersionRange }
}
otel: securityVulnerabilities(first: 3, ecosystem: GO, package: "go.opentelemetry.io/otel/sdk") {
nodes { advisory { ghsaId summary severity } firstPatchedVersion { identifier } vulnerableVersionRange }
}
}'Repository: trpc-group/trpc-agent-go
Length of output: 1430
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '\n## session/replaytest/sqlite/go.mod\n'
cat -n session/replaytest/sqlite/go.mod
printf '\n## parent go.mod replace/import context\n'
grep -nE 'replace|google.golang.org/grpc|go.opentelemetry.io/otel/sdk' -n go.mod session/replaytest/sqlite/go.mod || true
printf '\n## files mentioning google.golang.org/grpc or go.opentelemetry.io/otel/sdk\n'
rg -n 'google\.golang\.org/grpc|go\.opentelemetry\.io/otel/sdk' -g 'go.mod' -g '!**/vendor/**' .
printf '\n## module tree for nested replaytest module (if any)\n'
find session/replaytest/sqlite -maxdepth 2 -name go.mod -o -name go.sum | sortRepository: trpc-group/trpc-agent-go
Length of output: 12903
Bump the vulnerable gRPC/OpenTelemetry pins
google.golang.org/grpc v1.65.0 is in a CRITICAL authorization-bypass range, and go.opentelemetry.io/otel/sdk v1.29.0 is in a HIGH PATH-hijack range. Update the parent module graph to grpc v1.79.3 and otel/sdk v1.43.0, then re-run go mod tidy here so these indirect entries stop pulling the vulnerable versions.
🧰 Tools
🪛 OSV Scanner (2.4.0)
[HIGH] 29-29: go.opentelemetry.io/otel/sdk 1.29.0: OpenTelemetry Go SDK Vulnerable to Arbitrary Code Execution via PATH Hijacking in go.opentelemetry.io/otel/sdk
(GO-2026-4394)
[HIGH] 29-29: go.opentelemetry.io/otel/sdk 1.29.0: OpenTelemetry Go SDK Vulnerable to Arbitrary Code Execution via PATH Hijacking
[HIGH] 29-29: go.opentelemetry.io/otel/sdk 1.29.0: opentelemetry-go: BSD kenv command not using absolute path enables PATH hijacking
[CRITICAL] 37-37: google.golang.org/grpc 1.65.0: Authorization bypass in gRPC-Go via missing leading slash in :path in google.golang.org/grpc
(GO-2026-4762)
[CRITICAL] 37-37: google.golang.org/grpc 1.65.0: gRPC-Go has an authorization bypass via missing leading slash in :path
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@session/replaytest/sqlite/go.mod` around lines 12 - 39, Update the go.mod
dependency graph so google.golang.org/grpc resolves to v1.79.3 and
go.opentelemetry.io/otel/sdk resolves to v1.43.0, including any required related
module updates. Run go mod tidy in this module and commit the resulting
go.mod/go.sum changes so indirect dependencies no longer select the vulnerable
versions.
Source: Linters/SAST tools
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2272 +/- ##
===================================================
- Coverage 89.85876% 89.85183% -0.00693%
===================================================
Files 1150 1159 +9
Lines 203417 205367 +1950
===================================================
+ Hits 182788 184526 +1738
- Misses 12914 13039 +125
- Partials 7715 7802 +87
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add a typed replay matrix covering 11 session, memory, summary, track, concurrency, and recovery scenarios. Normalize backend-generated values while preserving causal order and semantic timestamps. Keep the CGO-backed SQLite adapter in a nested module and emit validated JSON diff reports. Fixes trpc-group#2001 RELEASE NOTES: Added a reusable replay consistency harness for session and memory backends.
Compare successful backend snapshots pairwise without assuming a named reference is correct. Report only conclusive single-backend outliers while preserving ambiguous and insufficient outcomes. Validate pair matrices, exclusion evidence, status accounting, and reserved paths so generated reports remain internally consistent.
0942c2f to
583e908
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
session/replaytest/sqlite/go.mod (1)
20-25: 🔒 Security & Privacy | 🔴 Critical | ⚡ Quick winUpdate the vulnerable indirect dependencies before merging.
go.opentelemetry.io/otel/sdk v1.29.0is affected by a high-severity PATH-hijacking vulnerability, andgoogle.golang.org/grpc v1.65.0is affected by a critical authorization-bypass vulnerability. Patched versions are OpenTelemetryv1.40.0+and gRPCv1.79.3+. (github.com)Please update the OpenTelemetry module family and gRPC dependency, run
go mod tidy, and commit the resulting module graph.中文
合并前请升级存在漏洞的间接依赖。
go.opentelemetry.io/otel/sdk v1.29.0受高危 PATH 劫持漏洞影响,google.golang.org/grpc v1.65.0受严重授权绕过漏洞影响。修复版本分别为 OpenTelemetryv1.40.0+和 gRPCv1.79.3+。(github.com)请升级 OpenTelemetry 模块族和 gRPC 依赖,运行
go mod tidy,并提交更新后的模块依赖图。Also applies to: 35-35
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@session/replaytest/sqlite/go.mod` around lines 20 - 25, Update the OpenTelemetry module family currently pinned at v1.29.0 to v1.40.0 or newer, and upgrade google.golang.org/grpc to v1.79.3 or newer wherever it appears in the module graph. Run go mod tidy afterward and commit the resulting go.mod and go.sum dependency updates.Sources: MCP tools, Linters/SAST tools
🧹 Nitpick comments (1)
session/replaytest/normalize.go (1)
168-176: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winHardcoded
"tracks"state key vs.sessionconstants — prefer a shared constant.This block uses the exported
session.StateAppPrefix/session.StateUserPrefixconstants but hardcodes the literal"tracks"key. If thesessionpackage owns a constant for the tracks state key, use it so this filter can't silently drift out of sync when the owning package changes its internal key.Verify whether
sessionexposes a constant for this key:#!/bin/bash rg -nP 'const|var' --type=go session -g '!**/replaytest/**' | rg -i 'track' rg -nP '"tracks"' --type=go session -g '!**/replaytest/**' -C2中文
硬编码的
"tracks"状态键与session常量不一致——建议使用共享常量。此处已使用导出的
session.StateAppPrefix/session.StateUserPrefix常量,却把"tracks"写成字面量。若session包已提供对应的 tracks 状态键常量,请改用它,避免上游内部键更名时此过滤逻辑无声失效。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@session/replaytest/normalize.go` around lines 168 - 176, Update normalizeState to replace the hardcoded "tracks" comparison with the existing exported tracks state-key constant from the session package, after verifying its exact name. Keep the session.StateAppPrefix and session.StateUserPrefix filtering unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@session/replaytest/quality_test.go`:
- Line 40: Replace the intentionally invalid "memroy" capability with the same
clearly non-typo literal, such as "not-a-capability", at
session/replaytest/quality_test.go lines 40-40 and
session/replaytest/replaytest_test.go lines 94-94, preserving the
unknown-capability test behavior in both sites.
---
Duplicate comments:
In `@session/replaytest/sqlite/go.mod`:
- Around line 20-25: Update the OpenTelemetry module family currently pinned at
v1.29.0 to v1.40.0 or newer, and upgrade google.golang.org/grpc to v1.79.3 or
newer wherever it appears in the module graph. Run go mod tidy afterward and
commit the resulting go.mod and go.sum dependency updates.
---
Nitpick comments:
In `@session/replaytest/normalize.go`:
- Around line 168-176: Update normalizeState to replace the hardcoded "tracks"
comparison with the existing exported tracks state-key constant from the session
package, after verifying its exact name. Keep the session.StateAppPrefix and
session.StateUserPrefix filtering unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 58eef773-4a29-48ab-bad8-ec2c58ba352e
⛔ Files ignored due to path filters (1)
session/replaytest/sqlite/go.sumis excluded by!**/*.sum
📒 Files selected for processing (19)
session/replaytest/DESIGN.mdsession/replaytest/README.mdsession/replaytest/backend.gosession/replaytest/cases.gosession/replaytest/compare.gosession/replaytest/consensus.gosession/replaytest/doc.gosession/replaytest/fault.gosession/replaytest/normalize.gosession/replaytest/quality_test.gosession/replaytest/replaytest_test.gosession/replaytest/report.gosession/replaytest/runner.gosession/replaytest/sqlite/README.mdsession/replaytest/sqlite/factory_test.gosession/replaytest/sqlite/go.modsession/replaytest/sqlite/integration_test.gosession/replaytest/testdata/session_memory_summary_track_diff_report.jsonsession/replaytest/types.go
🚧 Files skipped from review as they are similar to previous changes (11)
- session/replaytest/doc.go
- session/replaytest/report.go
- session/replaytest/sqlite/README.md
- session/replaytest/README.md
- session/replaytest/DESIGN.md
- session/replaytest/sqlite/integration_test.go
- session/replaytest/testdata/session_memory_summary_track_diff_report.json
- session/replaytest/backend.go
- session/replaytest/consensus.go
- session/replaytest/fault.go
- session/replaytest/types.go
| unknownCapabilityBackend := right | ||
| unknownCapabilityBackend.Name = "unknown-capability" | ||
| unknownCapabilityBackend.Capabilities = FullCapabilities() | ||
| unknownCapabilityBackend.Capabilities["memroy"] = true |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Rename the intentional unknown-capability literal to avoid tripping the typos CI check. Both sites use "memroy" as a deliberately-invalid capability, but it is a near-miss of memory and the CI typos check flags it. A clearly non-typo token (e.g. "not-a-capability") keeps the test intent and keeps the gate green.
session/replaytest/quality_test.go#L40: changeunknownCapabilityBackend.Capabilities["memroy"] = trueto a non-typo capability literal.session/replaytest/replaytest_test.go#L94: changeRequires: []Capability{CapabilitySession, "memroy"}to the same non-typo literal.
中文
将故意使用的“未知能力”字面量改名,以避免触发 typos CI 检查。 两处都用 "memroy" 作为故意无效的能力,但它与 memory 极为相近,CI 的 typos 检查会将其标记。改成明显不是拼写错误的标记(如 "not-a-capability")既保留测试意图,又能让检查通过。
session/replaytest/quality_test.go#L40:将Capabilities["memroy"] = true改为非拼写错误的能力字面量。session/replaytest/replaytest_test.go#L94:将Requires中的"memroy"改为相同的非拼写错误字面量。
🧰 Tools
🪛 GitHub Check: typos
[warning] 40-40:
"memroy" should be "memory".
📍 Affects 2 files
session/replaytest/quality_test.go#L40-L40(this comment)session/replaytest/replaytest_test.go#L94-L94
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@session/replaytest/quality_test.go` at line 40, Replace the intentionally
invalid "memroy" capability with the same clearly non-typo literal, such as
"not-a-capability", at session/replaytest/quality_test.go lines 40-40 and
session/replaytest/replaytest_test.go lines 94-94, preserving the
unknown-capability test behavior in both sites.
Source: Linters/SAST tools
Summary
normalization, strict allowed differences, and validated JSON reports
backends
Consensus behavior
Consensus mode compares every successful backend pair without assuming that a
named reference implementation is correct. It reports a backend as an outlier
only when exactly one backend disagrees with all others while the remaining
backends agree with each other.
Two-backend disagreements remain ambiguous. Failed or unsupported backends are
excluded from the semantic matrix while retaining explicit execution evidence.
Verification
go test ./session/replaytestgo test -race ./session/replaytestgo test ./session/replaytest -count=20go vet ./session/replaytestgo test ./session/...go test ./...go test -race ./...Closes #2001