DEV Community

ilya mozerov
ilya mozerov

Posted on Originally published at dev.to

The request was closed. The list still said pending.

Mishe is an agent system that does its work in short wakes and keeps its decisions in public text. A mind can hit an action that standing approvals do not cover. It writes a permission request: who owns it, what is being asked for, the capability it needs and the paths it would unblock. An operator answers with mishe access grant ID or mishe access revoke ID, and the answer is appended to the chat tape read by the access record.

Two things can end that story.

One is a decision. The answer lands on the tape, and the request becomes granted or revoked.

The other is a recovery that goes around the request entirely. An existing read-only probe works, or a different path already produced the needed result. No decision is recorded, because none was needed. The historical decision ledger correctly stays untouched. But the request is over: nothing is waiting for an answer any more.

The list could not tell those apart

mishe access list derived its state from the decision ledger alone. A request with no decision therefore showed as pending forever — including after the recovery had closed it.

That is not a cosmetic mismatch. A mind waking up reads that list to see what it owes. A human reading it sees an open question. Both were sent back to a permission that was no longer needed, and the same false obligation produced repeated messages.

The mistake was using one field for two different facts:

  • What was decided: nothing. No grant was ever recorded, and that history should stay truthful.
  • What is still owed: nothing. The work is done through another route.

A display that shows only the first fact reports an open request for work that has already finished. A fix that simply flipped the ledger to granted would have been worse: it would invent a permission nobody gave.

Keep the history, close the obligation

The change separates the two. list_requests in src/mishe_tauftauf/access.py now consults the recovered-request records and shows a resolved request as retired:

  • the request stays visible, with its original owner, task and capability;
  • the decision ledger is unchanged, so access check still reports exactly what was historically decided;
  • access decide refuses to record a new grant against a retired request;
  • access list no longer offers a stale pending row to the next reader.

A focused test pins the distinction in one place: after a recovery through an alternative, the decision state is still pending, the listing says retired, the command output contains no pending row for that request, and an attempted grant is refused. Keeping both assertions is the point. Either one alone would let a future refactor collapse the two meanings again.

The reader overview in docs/mesh.md now defines what a permission request is, where the answer goes and what retired means. A newcomer can read the lifecycle without reconstructing it from the implementation.

The general shape

Any system with a request queue and a separate record of decisions needs to ask which of those two things a screen is showing. “Was this ever granted?” and “should anyone act on this now?” are different questions. Answering the second one from the first one is convenient, and wrong exactly in the case where somebody solved the problem another way.

Retiring the request does not rewrite what happened. It says: the answer was never given, and no answer is needed. Both sentences can be true at once, and a useful tool has to be able to say both.

This piece describes a public repository change; it does not claim that every running consumer already uses it.

Top comments (0)