برنامهریزی، تحلیل و عملیات پلتفرم · فصل ۵ — Virtual Cast، Canon Boundary و Repair Workflow · 218
Repair Diagnostics and Isolated Reproduction
Design an isolated diagnostic workflow that freezes the failing input and environment, records a reproducible oracle and trace, narrows the suspect change set, and separates application-owned behavior from model/provider/sandbox behavior before any patch is accepted. میتواند برای «Repair Diagnostics و Isolated Reproduction» model، signal و guardrail لازم را در یک workflow محدود تعریف و ارزیابی کند.
Lesson summary
Design an isolated diagnostic workflow that freezes the failing input and environment, records a reproducible oracle and trace, narrows the suspect change set, and separates application-owned behavior from model/provider/sandbox behavior before any patch is accepted.
میتواند برای «Repair Diagnostics و Isolated Reproduction» model، signal و guardrail لازم را در یک workflow محدود تعریف و ارزیابی کند.
This lesson produces
میتواند برای «Repair Diagnostics و Isolated Reproduction» model، signal و guardrail لازم را در یک workflow محدود تعریف و ارزیابی کند.
Who it is for
Foundation
Use a guided C05 evidence matrix and one worked negative case.
Repair
Re-run only the failed owned dimension with a smaller deterministic synthetic fixture.
Experienced
Start from conflicting persona/canon/diagnostic/release signals; require explicit trade-offs, uncertainty and provenance.
Prerequisites
1. Problem: fixing inside the full system can hide causality
Repairing a failure directly in the full system can change multiple variables at once and erase the original causal boundary. This lesson produces Isolated Reproduction & Diagnostic Evidence Packet v1: a diagnostic packet that keeps failing input, environment, oracle, trace, suspect range, and boundary owner explicit and auditable.
2. Lesson boundary
PLN-027 does not own release/canary decisions; PLN-028 owns that outcome. It also does not absorb the PLN-026 canon boundary. The owned task is to reduce a failure to the smallest reproducible boundary and distinguish application/SDK-owned behavior from behavior that requires a real model, network, or sandbox provider.
3. External FACT versus local DESIGN
git bisect uses binary search between known old/good and new/bad revisions to narrow the revision that changed a property, but it depends on a test oracle that can classify candidates. OpenAI Agents SDK testing provides deterministic provider-neutral doubles that exercise application/SDK orchestration without real model or sandbox-provider requests. Those doubles do not prove real provider behavior. Packet fields and typed states here are MAKNOW DESIGN.
4. Separate incident and symptom from hypothesis
incident_id and symptom_id identify what was observed; diagnostic_hypothesis is provisional explanation. Changing the hypothesis must not rewrite incident identity. Diagnosis starts from observable failure evidence, not a preferred cause story.
5. Freeze the failing input
The failing input needs stable identity or a hash. If the prompt, tool input, attachment, or event sequence changes during testing, the new result is not the same reproduction. Bind failing_input_hash to a fixture and trace.
6. Environment fingerprint and dependency lock
Record runtime, dependency lock, config hash, agent-definition hash, and tool-contract hash. Changing two dependencies at once destroys attribution. If the reproduction environment does not match the failing environment, do not emit success; keep the state at HOLD.
7. The oracle must be explicit and stable
An oracle defines expected versus actual behavior. “The answer looks wrong” is not a reproducible oracle. It must be deterministic enough to classify bisect candidates consistently. A flaky oracle yields INCONCLUSIVE.
8. Trace and fixture make evidence replayable
fixture_id and trace_id must be traceable. The trace shows calls and state transitions leading to failure. Keep the fixture minimal; copying production state increases privacy risk and diagnostic noise.
9. Last known good and first bad candidate
With a valid revision boundary, last_known_good and first_bad_candidate define a suspect_range. git bisect can reduce that range only when candidates are buildable/testable and the oracle remains stable.
10. Name the boundary owner
Useful owners include APPLICATION_SDK, MODEL_PROVIDER, SANDBOX_PROVIDER, NETWORK/PROTOCOL, and UNKNOWN. If a scripted double is clean while a real provider reproduces the failure, reclassify the boundary to the provider; an offline green test cannot exonerate provider-owned behavior.
11. What does a test double prove?
A test double is strong evidence for tool routing, handoffs, guardrails, retries, normalized sandbox calls, and application orchestration. Real sandbox lifecycle, filesystem fidelity, process execution, resource limits, and isolation belong in provider integration tests. Do not promote SESSION_LOCAL success into provider or production proof.
12. Baseline — failure inside the application/SDK boundary
Incident INC-517 reproduces after a dependency upgrade with the same failing input, same environment fingerprint, and a stable oracle. The scripted model also reproduces the tool-argument normalization failure; last-known-good=r140, first-bad=r147. With one changed variable, matching environment, and stable oracle, the packet reaches REPRODUCED and is bisect-ready.
| case_id | environment | oracle_stable | changed_variables | boundary_owner | state | bisect_ready | integration_required | reason |
|---|---|---|---|---|---|---|---|---|
| baseline | env:py3.13-sdk0.9.4 | True | 1 | APPLICATION_SDK | REPRODUCED | True | False | EVIDENCE_PACKET_CLOSED |
| two_dependencies_changed | env:py3.13-sdk0.9.4 | True | 2 | APPLICATION_SDK | INCONCLUSIVE | False | False | MULTIPLE_VARIABLES_CHANGED |
| provider_double_overclaim | scripted-sandbox:memory | True | 1 | SANDBOX_PROVIDER | EXTERNAL_UNTRUSTED | True | True | SCRIPTED_DOUBLE_CANNOT_PROVE_PROVIDER_BEHAVIOR |
| flaky_oracle | env:py3.13-sdk0.9.4 | False | 1 | APPLICATION_SDK | INCONCLUSIVE | False | False | FLAKY_ORACLE |
| environment_mismatch | env:py3.12-sdk0.8.9 | True | 1 | APPLICATION_SDK | HOLD | True | False | ENVIRONMENT_FINGERPRINT_MISMATCH |
| missing_provenance | env:py3.13-sdk0.9.4 | True | 1 | APPLICATION_SDK | UNKNOWN | True | False | DECISIVE_EVIDENCE_MISSING |
| stale_evidence | env:py3.13-sdk0.9.4 | True | 1 | APPLICATION_SDK | STALE | True | False | STALE_DIAGNOSTIC_EVIDENCE |
| transfer_real_provider | real-sandbox:v7 | True | 1 | SANDBOX_PROVIDER | HOLD | True | True | REAL_PROVIDER_BOUNDARY_REQUIRES_INTEGRATION_REPRO |
13. Dangerous shortcuts
(1) Change two dependencies together → INCONCLUSIVE. (2) Use a scripted sandbox to claim a real provider is fixed/broken → EXTERNAL_UNTRUSTED/HOLD. (3) Feed a flaky oracle into bisect → a narrowed range is not reliable causal evidence. (4) Ignore environment mismatch → HOLD.
14. Transfer — failure exists only with the real sandbox provider
The scripted double is clean, but the same fixture fails with the real sandbox provider. Do not copy the offline conclusion. Reclassify boundary_owner to SANDBOX_PROVIDER, set integration_required=true, and design the smallest integration reproduction that preserves the relevant lifecycle/filesystem/process/isolation behavior. Until that exists, the state remains HOLD.
15. Lab, assessment, and freshness
Run python run_checks.py under lab/PLN-027-LAB1/learner/. Eight fixtures cover Baseline, Two Dependencies Changed, Provider-double Overclaim, Flaky Oracle, Environment Mismatch, Missing Provenance, Stale Evidence, and Real-provider Transfer. Git and OpenAI Agents SDK FACT claims were rechecked on 2026-09-16; canonical changes require a new version.
Assessment
There is no answer key in this lesson pack; answer it yourself and mark honestly. "Needs review" sends the lesson to your review queue.
Q1 boundary
Q2 application
Q3 diagnosis
Q4 oracle
Q5 transfer
Q6 authority
Assessment rubric
Full credit requires: exact lesson boundary; stable failing input/environment identity; explicit expected/actual oracle; correct use of bisect only with stable classification; correct distinction between scripted SDK evidence and real-provider integration evidence; and a typed non-success state when decisive evidence is missing.
References & freshness
Case studies
Lab files
دستور python run_checks.py را اجرا کنید. Fixtureها و evaluator کاملاً قابل مشاهدهاند. توضیح دهید هر Case چرا State خود را میگیرد و اولین Evidence Boundary نیازمند اصلاح چیست. آزمایش کاملاً آفلاین و مصنوعی است و هیچ تماس مدل یا Provider ندارد.