devinside.Marcin Borecki Ideas. Systems. Evidence.

THE READING ROOM

Engineering

THE READING ROOM

Writing & investigations.

Engineering

Move the execution boundary, keep the task

The local implementation returns document A. The server implementation returns document B. Both expose a method named SearchAsync, both return three results, and both say they use the same model. The deployment diagram looks correct.

8 min read

Engineering

Read the grant before choosing the fix.

The query returns one row. Its plan builds thousands of groups along the way. A spill warning appears, and three recommendations arrive immediately: request more memory, increase parallelism, or remove the hash aggregate.

7 min read

Engineering

Rewrite the inside. Protect the wire.

The rewrite is cleaner. A string status becomes an enum. Null properties disappear. A timestamp is converted to UTC. A decimal uses a new rounding default. Every individual change looks defensible.

6 min read

Engineering

Conversation progress is not task acceptance

The HTTP request succeeds. The bot sends a sentence. The UI removes its spinner. Somewhere in that sequence, an application decides that the user's task is complete, even though the only established fact is that a conversation produced an activity.

8 min read

Engineering

Accepted is not confirmed.

There is one unit of stock. Two callers ask for it. One API confirms a reservation before responding. Another accepts both requests into a queue and decides later which one can be fulfilled.

6 min read

Engineering

Allocation is a policy, not a second invoice

Three tasks share a resource. The source record contains thirty-seven subunits. The proposed weights are three, two and two. A report divides the amount proportionally, rounds each result independently and produces sixteen, eleven and eleven.

8 min read

Engineering

Imported is not yet searchable.

The job finishes. Every input file was read. The index still contains a paragraph from an older revision, or an embedding that describes text no longer attached to it.

6 min read

Engineering

Retrieval passed. May emission still proceed?

The assistant retrieves a protected passage while the user has access. Before the answer is emitted, that access is withdrawn. The evidence remains in request-local memory. The response writer is ready. Is the application still allowed to send it?

8 min read

Engineering

The next command must earn its permission

The database opens. A connection succeeds. A command returns without error. The operator is ready to switch traffic, but the restored database belongs to another application and an external dependency still contains the wrong content.

8 min read

Engineering

The endpoint moves before correctness does.

The new database accepts a connection. The health check is green. A user repeats the operation that timed out just before the switch, and the application cannot explain whether it already happened.

6 min read

Engineering

Which boundary changed the request?

The browser requests an HTTPS URL. Nginx terminates TLS and forwards HTTP to ASP.NET Core. The application sees an HTTP request and redirects it to HTTPS. The browser follows the redirect, reaches Nginx again, and the same sequence repeats.

8 min read

Engineering

Delivery is not permission to execute

An event announces that an object changed. The application starts an agent. A second delivery of the same event starts another agent. An older event arrives later and starts a third.

8 min read

Engineering

The receiver committed. The caller did not know.

The receiver committed the operation. Before the caller saved the acknowledgement, its process stopped. After restart, the caller reads its durable job record and sees Executing. The user asks whether the task is done.

8 min read

Engineering

Forget the chat. Keep the domain record.

“The item is approved,” says the conversation. It was true when the assistant last looked. Since then, another person has changed the record, the approval has been withdrawn, and the item belongs to a newer revision.

9 min read

Engineering

Find the queue that owns progress.

Requests take longer. CPU remains low. The team increases the ThreadPool minimum because “there must not be enough threads.” Sometimes that changes the relevant boundary. Sometimes it simply creates more workers waiting for the same scarce resource.

6 min read

Engineering

The next rule exposes the hidden contract.

The function fits on one screen. It multiplies price by quantity, applies a discount and adds a delivery charge. A reviewer can understand every operator and still misunderstand the agreement.

7 min read

Engineering

More context still needs the same boundary

One team wants to retrieve a few relevant passages. Another wants to send the whole document collection to a model with a larger context window. The argument quickly becomes a contest between retrieval sophistication and model capacity.

8 min read

Engineering

A citation can be right while the claim is wrong

The answer cites the correct policy paragraph. It also says that a file may contain twenty mebibytes when the policy permits twenty million bytes. The citation is real. The number twenty is real. The conclusion is still wrong by 971,520 bytes.

8 min read

Engineering

Smaller bytes are only one cost.

An event contains an identifier, a duration and a name. JSON repeats the field names. A compact binary record does not. The binary version is smaller, so the team calls the change a telemetry optimization.

7 min read

Engineering

Following the work, not the thread

You pause a process while request A waits for an asynchronous dependency. The worker thread is executing request B. A stack viewer faithfully shows B. Where did A go?

8 min read

Engineering

An index moves work into the write path.

The query asks for documents whose region is two. Without an index on that property, the system may inspect every document. With an appropriate indexed projection, it can navigate to a much smaller candidate set.

8 min read

Engineering

An error message is not an effect check

The test sends an unauthorized request and receives Denied. It passes. The application has also written a row before returning that response. Nobody notices because the assertion inspects the message, not the state the message was supposed to protect.

8 min read

Engineering

A revised plan needs changed evidence

The agent has revised its plan three times. The first version proposed importing a file, the second proposed validating it before import, and the third proposed a more careful validation strategy. The file still has no verified schema.

9 min read

Engineering

Reserve authority before spending it

The task has an allowance of one hundred units. Tool A asks whether sixty is available. Tool B asks the same question. Both read one hundred, both receive yes, and both start work. Each local decision looks reasonable.

9 min read

Engineering

The missing attempt changes the denominator

The answer looks good. The last model attempt consumed two units of input, each priced at three accounting credits. A dashboard displays six. Someone compares that number with another system and concludes that this agent completes the task for six credits.

9 min read

Engineering

When an allocation disappears

There is a new expression in the source. There may be no corresponding heap object in the optimized execution. That is not a contradiction: source code specifies behavior, while the implementation chooses a representation that preserves it.

7 min read

Engineering

Completed is not reusable.

Operation A completes with seventeen. Before its consumer retrieves the result, the provider clears its storage and starts operation B. A delayed continuation finally runs. Which result is it asking for?

8 min read

Engineering

What survives an await?

Take a method that waits for another method, adds one to the result and returns it. There is almost no business logic to distract us.

8 min read

Engineering

The lease crosses the await.

The code rents an array, starts an asynchronous write, returns the array, and awaits the write. It looks economical. The buffer is back in the pool quickly, the method allocates little, and the application keeps moving.

8 min read

Engineering

An uncertain effect is a real state.

The operator approves sending document A to partner X. The agent changes the recipient to partner Y and executes the tool with the old approval. The tool records a successful call.

8 min read

Projects

A larger block changes more than speed.

The file is large, so the application allocates a large array. Then it adds concurrency to make the transfer faster and discovers that several other buffers are alive at the same time.

7 min read

Engineering

The diagnostic query does work too.

The service slows down, so the team records more detail. The exporter is already behind. Its queue grows, diagnostic work competes with useful work, and an attempt to understand the incident becomes another participant in it.

9 min read

Engineering

The late result must lose.

Request A starts first. Request B starts second. B finishes first and displays the answer the user currently wants. A finishes later and replaces it with an obsolete result.

7 min read

Engineering

Identity is not a metric dimension.

Two dashboards show different failure rates for the same service. One counts failed attempts. The other counts operations whose final outcome is failure. Both may be correct, but the label above each chart says only failures.

8 min read

Engineering

Accepted is not completed.

The HTTP request took a few milliseconds. The queue accepted a message. The worker produced a log line. The customer still has no result.

10 min read

Projects

The denominator changes the answer.

The cheaper system generates ten answers. Four are accepted. The more expensive system generates ten answers and eight are accepted. A chart showing cost per model call can name the wrong product decision even when every invoice line in the chart is correct.

8 min read

Engineering

The caller changes. Authority does not.

The model calls reserve_stock twice. The first call succeeds, but the response is lost. The second uses the same request identity. Should the service reserve another unit, return the existing result or refuse the call?

8 min read

Engineering

Search relevance is not permission.

The nearest document belongs to another tenant. The next nearest is an obsolete version. The correct current document is third. A retrieval pipeline takes the first result, filters it out and returns nothing.

8 min read

Engineering

A checkpoint must follow the effect.

The export has reached row 8,000 when the worker stops. The destination contains the last page, but the source checkpoint still says 6,000. Restarting from 6,000 repeats work.

10 min read

Engineering

The stopwatch has a boundary.

Implementation A is faster than B. The next chart says B is faster than A. Neither author changed the algorithm. One started the clock after construction; the other included it.

8 min read