Skip to content

T4 注入:期望值改写不改实现(预期 test-integrity 红 TI-R4) - #47

Closed
randypanding wants to merge 4 commits into
mainfrom
p2-1-t4
Closed

randypanding wants to merge 4 commits into
mainfrom
p2-1-t4

Conversation

@randypanding

Copy link
Copy Markdown
Contributor

#86 P2-1 T4 负向注入(轮次 2):观测点 45/55 → 44/56——只改测试期望值,实现不动,测试仍绿。policy 严格度 require_adr:无 ADR 引用即红。

预期:test-integrity 红 TI-R4(期望值改写嫌疑);gate 红;go test 绿。

注入测试 PR——验证后关闭,不合并。

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1fb19cf0-3a0a-4f5e-bdad-65510d9ca420

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Broaden likelihood test offsets for TI-R4 integrity injection

🧪 Tests 🕐 Less than 5 minutes

Grey Divider

AI Description

• Changes likelihood shape observations from 45/55 to 44/56 without implementation changes.
• Preserves passing tests while intentionally triggering the TI-R4 test-integrity gate.
High-Level Assessment

The narrow test-only mutation is appropriate for validating TI-R4 detection while isolating the integrity gate from implementation behavior. Production changes or broader test rewrites would add noise and weaken the experiment.

Files changed (1) +2 / -2

Tests (1) +2 / -2
estimate_test.goWiden quantized likelihood test observations +2/-2

Widen quantized likelihood test observations

• Changes the symmetric observations around 50 from 45/55 to 44/56. The assertion remains unchanged, allowing the suite to stay green while exercising test-integrity detection.

internal/estimate/estimate_test.go

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Unapproved test fixture rewrite 🐞 Bug ⚙ Maintainability
Description
Replacing the established 45/55 likelihood samples with 44/56 silently removes regression coverage
for the original observation points. Repository policy classifies expectation rewrites as TI-R4
failures unless backed by an ADR, so this change makes both test-integrity and the required
aggregate gate fail.
Code

internal/estimate/estimate_test.go[R114-115]

+	l := QuantizedLogProb(44, 50, 1, 0.5)
+	r := QuantizedLogProb(56, 50, 1, 0.5)
Relevance

●●● Strong

Explicit policy violation and intentional negative-injection PR; recent gate-policy precedent
supports enforcement.

PR-#29

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The changed test replaces the only 45/55 shape samples with 44/56. The CI workflow explicitly states
that TI-R4 expectation rewrites fail unless exempted by an ADR, and the aggregate gate requires
test-integrity to succeed.

internal/estimate/estimate_test.go[111-118]
.github/workflows/ci.yml[49-56]
.github/workflows/ci.yml[114-140]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The likelihood test rewrites its established observation samples without an ADR, triggering the repository's TI-R4 test-integrity rule and failing the required CI gate.

## Issue Context
Restore the original 45/55 samples. If the changed samples represent an intentional requirement change, preserve appropriate coverage and add the ADR reference required by the test-integrity policy.

## Fix Focus Areas
- internal/estimate/estimate_test.go[111-118]
- .github/workflows/ci.yml[49-56]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 21 rules
Review mode: ⚖️ Balanced: 这是运行时代码对应的测试期望值改动,虽仅一处小改动且逻辑局部,但会影响测试完整性判定,不能跳过;其风险不足以需要多轮冗余审查。

Grey Divider

Tip of the day
💡 Did you know, you can copy the agent prompt from any finding and feed it to your IDE agent

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment on lines +114 to +115
l := QuantizedLogProb(44, 50, 1, 0.5)
r := QuantizedLogProb(56, 50, 1, 0.5)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Unapproved test fixture rewrite 🐞 Bug ⚙ Maintainability

Replacing the established 45/55 likelihood samples with 44/56 silently removes regression coverage
for the original observation points. Repository policy classifies expectation rewrites as TI-R4
failures unless backed by an ADR, so this change makes both test-integrity and the required
aggregate gate fail.
Agent Prompt
## Issue description
The likelihood test rewrites its established observation samples without an ADR, triggering the repository's TI-R4 test-integrity rule and failing the required CI gate.

## Issue Context
Restore the original 45/55 samples. If the changed samples represent an intentional requirement change, preserve appropriate coverage and add the ADR reference required by the test-integrity policy.

## Fix Focus Areas
- internal/estimate/estimate_test.go[111-118]
- .github/workflows/ci.yml[49-56]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Base automatically changed from p2-1-wire to main August 20, 2026 07:01
@randypanding

Copy link
Copy Markdown
Contributor Author

P2-1 注入测试完成(证据已在 job log 采集,ADR-0035 / CI-Workflows#20 已合并)。清理载体。

@randypanding
randypanding deleted the p2-1-t4 branch August 20, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant