# Diagnose the boundary before changing the agent

Original LockedIn Labs practice · 25 October 2026 · 20–30 minutes

A useful deployed engineer can explain what happened, what remains unknown and
which observation would change the next decision. Practise that skill with four
short incident packets. No account, cloud service or model is needed.

These are authored, synthetic scenarios. A and B adapt the published local
networking and queue recordings. C and D introduce new situations for reasoning;
they are not executed incidents or evidence of a deployed service.

## Start with two maps

The networking lab follows HTTP/1.1 over TCP and TLS:

```text
service name → address:port → TCP → verified TLS → HTTP request/response
               where?       reach?   expected peer?  application decision?
```

The queue lab has two independently observable records:

```text
message received → business result + operation receipt → acknowledgement
                   one local SQLite transaction          broker state
                             ↑                               |
                             └── inspect before repeating ──┘
```

A timeout, a settled message and a successful HTTP status answer different
questions. None alone establishes that the intended customer task is complete.

## Record your first answer

Before looking at the reference, copy this table for each packet. Keep your first
answer when revising; use the difference to find a missing concept.

| Decision | Your answer |
| --- | --- |
| What is the requested business action? | |
| Which observation is established by this packet? | |
| What plausible conclusion is still unsupported? | |
| What is the smallest useful next check, and where would you run it? | |
| Which tempting repair would you reject, and why? | |
| What would you tell the receiving engineer now? | |

## Packet A — a connection without an HTTP request

The client connects to fixed loopback address `127.0.0.1` at the fixture's port.
Name lookup and TCP complete. The expected TLS peer is `wrong.localhost`; the
certificate names `localhost`. TLS reports a name verification failure. The
HTTP stage is not run and the fixture records zero HTTP handler entries.

A teammate proposes changing the HTTP resource path or retrying the model.
Explain why neither is the next repair supported by this packet. Separate the
address used to connect from the identity the client intended to verify.

## Packet B — a settled message without a result

The queue reports one successful delivery and a settled message. The local
database contains zero drafts and zero operation receipts. The event order is
receive, acknowledge, stop before writing. A second receive attempt gets no job.

A dashboard calls this job completed because the queue is settled. Explain
what that label conceals. Decide what the local model can recover automatically
and what a receiving operator would still have to reconcile.

## Packet C — a private endpoint that refuses a request

In this proposed deployment scenario, the worker resolves a service name,
connects and validates the expected TLS peer. It receives HTTP 403. A gateway
sits before the application. The packet contains no correlated gateway or
application event and no verified account or resource policy decision.

An architect's laptop can read the resource. A teammate suggests opening wider
network access or disabling certificate verification. State what this response
does establish, what it does not locate, and the next evidence you would seek
from the worker's actual environment.

## Packet D — a remote submission with no observed result

In this proposed integration, the worker submits an instruction to an external
service under business operation `north / J-12:send:v1`. The client times out
before receiving a result. A local row says only `submission attempted`.
There is no destination receipt or confirmed status. The broker later redelivers
the job. The destination's replay and status-query behavior is not supplied.

Choose the next investigation before recommending a retry. Explain why a fresh
key, a local transaction or an expired delivery interval does not resolve the
remote outcome. Describe what you would report if the destination cannot supply
evidence or an applicable replay guarantee.

---

## Reference reasoning — compare after your attempt

### A: locate the failed identity check

The client reached a TCP endpoint but rejected its certificate name before
sending HTTP. In this fixture, `wrong.localhost` is the expected peer string;
it was not the hostname resolved for the socket. Confirm the intended service
identity and its approved endpoint/certificate configuration. Keep verification
enabled. Changing the resource path cannot fix a check that stops before HTTP.
Changing a model prompt does not repair this transport identity mismatch.

Once corrected, rerun the bounded request and inspect the HTTP result separately.
That future check has no result in this packet. This is the published
`wrong-name` case in the [networking lab](/training/guides/networking#3-predict-the-first-stopping-point).

### B: distinguish queue settlement from business evidence

The acknowledgement happened before the draft existed. This local model no
longer offers that message for redelivery; waiting for expiry does not create
the missing result. Its recorded database state supports zero local effects.
It does not authorize blindly recreating work in a different production system.
An operator must inspect the intended action, actual result stores and any
downstream effects before choosing a recovery path.

Contrast the published `reuse-effect` case: two deliveries leave one committed
draft because the second attempt checks the same tenant, operation and input.
A receipt and draft share a transaction there; merely placing the same key on
two rows does not prevent duplication. Reproduce both in the
[queue lab](/training/guides/queues#2-run-four-delivery-cases).

### C: locate who refused, then inspect the policy

The worker received an HTTP refusal over a verified connection. That is different
from the TLS failure in A. It does not prove the origin application handled the
request: the gateway may have generated the response. Identify the responding
component using permitted request correlation and bounded logs, then inspect the
intended principal, resource, tenant and applicable policy at that component.
Do not copy credentials or request payloads into the handoff.

The laptop's successful route may use different identity, routing or policy.
Check from the worker environment. Preserve TLS verification and justified
network restrictions while investigating. This packet does not establish which
configuration is wrong or justify granting broader access.

### D: retain an unknown outcome honestly

The client did not observe the destination's result. The action may have occurred;
the packet does not prove either success or failure. Preserve the original
business identity and intended input. Find the destination's documented operation
lookup, idempotency scope, retention period and conflict behavior. Query or replay
only when that contract supports it for this operation and time window.

A local transaction cannot atomically include an unrelated remote effect. A new
key can describe a second action, and delivery expiry does not prove the previous
worker stopped. If the destination cannot resolve the outcome or support a safe
replay, stop automatic repetition and route the uncertainty to an accountable
operator with the available evidence. Do not relabel `attempted` as `completed`.

## Explain the cloud translation

Choose one explicit delivery mode. Translate receive, expiry and settlement;
do not translate broker vocabulary into an application exactly-once promise.

| Mode | Temporary state | Handling confirmation |
| --- | --- | --- |
| Amazon SQS standard | Visibility timeout | Delete the handled message |
| Google Cloud Pub/Sub pull | Outstanding delivery with an acknowledgement deadline | Acknowledge on the subscription |
| Azure Service Bus Peek-Lock | Message lock | Complete the message |

Keep delivery tokens separate from business receipts. For example, an SQS
ReceiptHandle belongs to a particular delivery and changes on another receive.
It is used to request deletion of the message with the current delivery's handle,
not as a stable identity for the draft.
SQS standard may deliver duplicates even during a visibility period. Pub/Sub's
optional exactly-once pull mode has specific regional and acknowledgement
guarantees; it does not make a remote business write part of that acknowledgement.

Document the configured client behavior, failed settlement response, retry limit,
retention, duplicate policy and owner of unresolved work. The modes have different
guarantees; inspect the selected service rather than copying the local model.

## Produce a useful engineering handoff

Write six sentences: requested action, observed boundary, unsupported inference,
next check, condition for retry or escalation, and current customer-facing status.
Ask a peer to change one fact—for example, add a confirmed destination receipt to
D—and explain how your decision changes. The reference supports self-review; it
does not certify competence. Keep the first answer and the corrected reasoning.

Primary references checked 25 October 2026:

- [Python 3.12 TLS verification](https://docs.python.org/3.12/library/ssl.html)
- [Amazon SQS visibility timeout](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html)
- [Amazon SQS delivery handles](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_DeleteMessage.html)
- [Google Cloud Pub/Sub subscriptions](https://docs.cloud.google.com/pubsub/docs/subscription-overview)
- [Google Cloud Pub/Sub exactly-once mode](https://docs.cloud.google.com/pubsub/docs/exactly-once-delivery)
- [Azure Service Bus locks and settlement](https://learn.microsoft.com/en-us/azure/service-bus-messaging/message-transfers-locks-settlement)
