Files
wyndham-ARR/.project-docs/60-reflection/cases/2026-07-30-keep-deterministic-results-machine-to-machine.md
2026-07-31 15:11:42 +08:00

46 lines
1.8 KiB
Markdown

# Keep Deterministic Results Machine-to-Machine
## Trigger
The fixed processor produced a complete valid 135-record result, but the model-mediated MCP call submitted only 20
records. Prompt strengthening improved tool selection and fetch behavior but could not guarantee lossless serialization
of a large structured payload.
## Expected Behavior
Once deterministic code has created a schema-valid result, the receiving system should validate and ingest that exact
machine artifact without asking a model to reconstruct the payload as tool arguments.
## Actual Behavior
The result crossed an unnecessary model serialization boundary. That boundary introduced truncation, rereads and
retry ambiguity even though both the source fetch and deterministic business processing had already succeeded.
## Root Cause
- Unclear ownership of structured-result transport
- A probabilistic orchestration boundary was placed between deterministic producer and deterministic consumer
## Evidence
- `.project-docs/50-evidence/topics/2026-07-30-superagent-fetch-oss-prompt-experiment.md`
- `.project-docs/50-evidence/topics/2026-07-30-arr2-programmatic-pipeline.md`
- `arr_web/programmatic.py`
- `tests/test_arr_programmatic.py`
## Lesson
Use models to interpret ambiguous inputs or choose work when that is genuinely required. Do not use a model as the
transport encoder for a complete, machine-generated business result. Preserve the original artifact, validate it at the
system boundary, and make the database commit authoritative.
## Action
- Updated the architecture through ADR-004.
- Added programmatic success/failure vertical slices and active-runtime deployment guards.
## Promotion
Promoted to ADR-004, the ARR2.0 architecture documents, deployment contracts and regression tests. No new skill is
needed unless this pattern recurs in another project.