Skip to content

fix: what an operation's run() works through, the house hands it — a plugin's only entity by default, and judged when the code lands - #148

Merged
rodrigoteamx merged 5 commits into
mainfrom
hp/greenhouse/t-0092-what-run-asks-for-the-house-resolves
Oct 8, 2026
Merged

rodrigoteamx merged 5 commits into
mainfrom
hp/greenhouse/t-0092-what-run-asks-for-the-house-resolves

Conversation

@rodrigoteamx

@rodrigoteamx rodrigoteamx commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Found in the reference run: stage I went red with the real resident, and one of its two causes is this.

What happened

The resident scaffolded four operations of a plugin with one entity, naming the entity in none, and wrote three run() against Milpa\Data\RepositoryInterface. Every judge passed — syntax, namespace, static conformance — the trials were promoted, the house booted. The battery's first call answered: «Service "Milpa\Data\RepositoryInterface" is not registered in the container».

Reproduced without a model in a lab house, on devtools 0.44.0: the same walk lands green and the call fails the same way. The operation's own contract says its state lives in the store of its plugin's entity; its run() could not reach it.

Why

RepositoryInterface is registered by nobody, and should not be: there is one repository per entity, under the id make entity gives it. What hands it to run() is the entry that lists the operation in its plugin's operations(). make what=operation wrote that entry with the entity only when entity= was given; without it, the entry resolved by class and the scaffold said nothing about state. And nothing asked, when a body landed, whether its entry could hand it what it takes — the house only found out at the first call.

The house already has this rule for a controller a route names (it is built through the container before it lands). An operation the catalogue offers had no such judge.

What changes

The property: what an operation's run() works through, the house hands it — judged when the code lands, not at its first call.

  • A plugin's only entity is the one run() receives, without being named. With several, none is guessed: the scaffold says there are several and that entity= names one. With none, nothing is wired, as before.
  • implement and edit ask the booted house. For a class that is an operation the house offers, the entry that lists it is asked for each thing run() takes — the house's own act, in the same child process that already builds controllers, without running run(). If it cannot hand one, the body does not land and the original survives byte for byte.
  • The refusal says the way, in order. For a repository: that it is reached by its entity, the plugin's entities, and the exact {find, replace} of the entry — the whole entry, because the resolver alone is the same in every one — then the same implement again. For anything else nobody registered: its type, registered in boot().
  • An operation the booted house does not offer — its plugin not registered yet — lands, and the result says that what its run() works through went unjudged.
  • The entity's scaffold, the make contract and the governed-authoring skill say how an operation reaches a repository.

What it does not do

  • Two repositories in one run(): what run() takes is found by type, so one entry hands one. The scaffold does not guess between entities and the refusal names them.
  • The probe reads the resolver from the handler DeclaredOperation::from() returns; a test pins that shape against the installed milpa/command, so a change there goes red here.
  • It is the judge of resolution, not of behaviour: a body that is handed its repository and does the wrong thing with it still needs its test.

Checked

  • 15 tests: 11 written red first; 3 pin what does not change and passed from the start; 1 was written after the code, for a mutant that survived. The suite: 828 tests green; PHPStan, the formatter and the DocBlock gate clean.
  • 24 hand mutants, all killed. One survived the first pass and showed a missing test — a class beside the entities that is not one.
  • Measured in a lab house with the scripted stand-in walking the resident's path: greenhouse evidence/1154. Published, the call fails; with this, it saves and reads; and the refusal's own words, followed literally, work.

@rodrigoteamx
rodrigoteamx merged commit d6869c0 into main Oct 8, 2026
2 checks passed
rodrigoteamx added a commit that referenced this pull request Oct 8, 2026
rodrigoteamx added a commit that referenced this pull request Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant