The full markdown includes the rg diagnostics to locate the field/consumer in the real dexdat-memory tree, the exact diff, and a CI regression guard. Key judge/reviewer note captured there: assert the named error plus the persisted post-condition, never a specific internal derivation or call ordering.
Diagnosis complete and verified. The solution is at ~/solution.md, backed by a runnable reproduction at ~/mcp-discarded-field/.
Root cause: MCP schema declares source.extracted_text required + maxLength: 100000 (caller gets a hard VALIDATION_ERROR when absent), but the handler validates those constraints and then only writes metadata — it never calls CreateSourceArtifact. Validation-passing calls silently discard the payload; the defect is only visible as a missing durable post-condition.
Fix (binary): persist via the existing artifact repo, or remove the required contract. The concrete instance warrants persistence:
// BEFORE — validated, then discarded
h.Sources[sourceID] = struct{}{}
return nil
// AFTER — persist through the existing repo
if _, err := h.Repo.CreateSourceArtifact(ctx, sourceID, in.Source.ExtractedText); err != nil {
return fmt.Errorf("persist source artifact: %w", err)
}
h.Sources[sourceID] = struct{}{}
return nil
Verification (observed behavior, not assumed call path):
- Buggy baseline — TestExtractedTextIsPersisted fails with got 0 (field was discarded) while the two named-error tests pass.
- After fix — all three pass: missing_required_field, max_length_exceeded, and the persisted-artifact post-condition.
cd ~/mcp-discarded-field && go vet ./... && go test -v ./...
# PASS: TestMissingRequiredFieldReturnsNamedError
# PASS: TestExtractedTextIsPersisted
# PASS: TestMaxLengthReturnsNamedError
The full markdown includes the rg diagnostics to locate the field/consumer in the real dexdat-memory tree, the exact diff, and a CI regression guard. Key judge/reviewer note captured there: assert the named error plus the persisted post-condition, never a specific internal derivation or call ordering.
# Evidence - Problem class: mcp-tool-required-field-validated-but-discarded - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-24T15:49:22.160Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "MCP tool schema marks a field REQUIRED (hard VALIDATION_ERROR when absent) but the tool never consumes or stores it \u2014 caller pays a contract with no effect. Found via tier-2 judge on dexdat-memory write.go: source.extracted_text validated (maxLength 100000) but no CreateSourceArtifact call exists. Fix is binary: persist via the existing artifact repo, or drop the required contract. When judging such tasks, write the criterion about the OBSERVED behavior (named error), not an assumed derivation path.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "mcp-tool-required-field-validated-but-discarded", "provider": "openrouter", "solved_at": "2026-09-24T15:49:22.161Z", "version": ""}Diagnosis complete and verified. The solution is at ~/solution.md, backed by a runnable reproduction at ~/mcp-discarded-field/.
Root cause: MCP schema declares source.extracted_text required + maxLength: 100000 (caller gets a hard VALIDATION_ERROR when absent), but the handler validates those constraints and then only writes metadata — it never calls CreateSourceArtifact. Validation-passing calls silently discard the payload; the defect is only visible as a missing durable post-condition.
Fix (binary): persist via the existing artifact repo, or remove the required contract. The concrete instance warrants persistence:
// BEFORE — validated, then discarded
h.Sources[sourceID] = struct{}{}
return nil
// AFTER — persist through the existing repo
if _, err := h.Repo.CreateSourceArtifact(ctx, sourceID, in.Source.ExtractedText); err != nil {
return fmt.Errorf("persist source artifact: %w", err)
}
h.Sources[sourceID] = struct{}{}
return nil
Verification (observed behavior, not assumed call path):
- Buggy baseline — TestExtractedTextIsPersisted fails with got 0 (field was discarded) while the two named-error tests pass.
- After fix — all three pass: missing_required_field, max_length_exceeded, and the persisted-artifact post-condition.
cd ~/mcp-discarded-field && go vet ./... && go test -v ./...
# PASS: TestMissingRequiredFieldReturnsNamedError
# PASS: TestExtractedTextIsPersisted
# PASS: TestMaxLengthReturnsNamedError
The full markdown includes the rg diagnostics to locate the field/consumer in the real dexdat-memory tree, the exact diff, and a CI regression guard. Key judge/reviewer note captured there: assert the named error plus the persisted post-condition, never a specific internal derivation or call ordering.
# Evidence - Problem class: mcp-tool-required-field-validated-but-discarded - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-09-24T15:49:22.160Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "MCP tool schema marks a field REQUIRED (hard VALIDATION_ERROR when absent) but the tool never consumes or stores it \u2014 caller pays a contract with no effect. Found via tier-2 judge on dexdat-memory write.go: source.extracted_text validated (maxLength 100000) but no CreateSourceArtifact call exists. Fix is binary: persist via the existing artifact repo, or drop the required contract. When judging such tasks, write the criterion about the OBSERVED behavior (named error), not an assumed derivation path.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "mcp-tool-required-field-validated-but-discarded", "provider": "openrouter", "solved_at": "2026-09-24T15:49:22.161Z", "version": ""}