You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Domain logic needed by more than one service crate has nowhere to live in this workspace. Today the choices are: put it in dpp-core, or copy it. There is no third option, and copying is what happens.
The shape of the problem
dpp-common is the only crate every service reaches, and it is declared shared infrastructure — event bus, telemetry, mTLS, request-id, URL guards. It carries no dpp-domain dependency at all. Putting a regulatory predicate there would mean adding a core dependency to the crate that holds mtls.rs, which is a category error even when it compiles.
dpp-types is engine-wide data (operator config, auth, audit, API keys) and is not reachable from dpp-plugin-host.
So for logic that is about the domain rather than about deployment, and that two service crates both need, there is no legal home.
Why this is worth a decision rather than vigilance
Duplicated shapes are now handled: the OpenAPI contract test compares every published shape against the type behind it, and every_published_object_shape_has_a_name makes an unnamed one fail the build. A copied struct cannot drift silently.
Duplicated rules have no equivalent. There is no shape to compare — four copies of a predicate are four individually correct files. They compile, they pass, and they diverge the first time someone adds a condition to one of them. Nothing in CI can see it.
This has now happened three times in different forms:
PROTECTED_PATCH_FIELDS restated and drifting three entries short of the canonical list, making protected fields writable on the only backend that ships.
A query parameter spelled three ways across the description, the handler and a test, agreeing only by coincidence while the name was a single word.
The first two were shapes and are now gated. The third is a rule, and moving it to core is the right fix for that one predicate — but it is a fix per instance, not a fix for the cause. The next shared predicate will hit the same wall.
What to decide
Three options, roughly:
Everything domain-shaped goes to core. Consistent with the Golden Rule, and correct where the logic really is a statement about the law. The cost is that every such change becomes cross-repo: a core release plus a repin before the engine can use it. That is a heavy cycle for logic that is genuinely about how this engine gates, not about what the law says.
Add an engine-side domain crate that sits below the services and above dpp-common — a home for logic that is domain-shaped but is the engine's own policy rather than core's law. Cost: a new crate, and a boundary question on every future addition ("is this core's or ours?"), which is the question that is currently unanswerable and would at least become answerable.
Accept the duplication and rely on review. Cheapest today. The record above suggests it does not hold.
I would not decide this from inside a feature branch. Flagging it as the cause behind a defect class rather than proposing a fix.
Not urgent
Nothing is broken right now. All four copies of the #208 predicate agree, and that one is being consolidated into core. This is about what happens the fourth time, not the third.
Domain logic needed by more than one service crate has nowhere to live in this workspace. Today the choices are: put it in
dpp-core, or copy it. There is no third option, and copying is what happens.The shape of the problem
dpp-commonis the only crate every service reaches, and it is declared shared infrastructure — event bus, telemetry, mTLS, request-id, URL guards. It carries nodpp-domaindependency at all. Putting a regulatory predicate there would mean adding a core dependency to the crate that holdsmtls.rs, which is a category error even when it compiles.dpp-typesis engine-wide data (operator config, auth, audit, API keys) and is not reachable fromdpp-plugin-host.So for logic that is about the domain rather than about deployment, and that two service crates both need, there is no legal home.
Why this is worth a decision rather than vigilance
Duplicated shapes are now handled: the OpenAPI contract test compares every published shape against the type behind it, and
every_published_object_shape_has_a_namemakes an unnamed one fail the build. A copied struct cannot drift silently.Duplicated rules have no equivalent. There is no shape to compare — four copies of a predicate are four individually correct files. They compile, they pass, and they diverge the first time someone adds a condition to one of them. Nothing in CI can see it.
This has now happened three times in different forms:
PROTECTED_PATCH_FIELDSrestated and drifting three entries short of the canonical list, making protected fields writable on the only backend that ships.The first two were shapes and are now gated. The third is a rule, and moving it to core is the right fix for that one predicate — but it is a fix per instance, not a fix for the cause. The next shared predicate will hit the same wall.
What to decide
Three options, roughly:
Everything domain-shaped goes to core. Consistent with the Golden Rule, and correct where the logic really is a statement about the law. The cost is that every such change becomes cross-repo: a core release plus a repin before the engine can use it. That is a heavy cycle for logic that is genuinely about how this engine gates, not about what the law says.
Add an engine-side domain crate that sits below the services and above
dpp-common— a home for logic that is domain-shaped but is the engine's own policy rather than core's law. Cost: a new crate, and a boundary question on every future addition ("is this core's or ours?"), which is the question that is currently unanswerable and would at least become answerable.Accept the duplication and rely on review. Cheapest today. The record above suggests it does not hold.
I would not decide this from inside a feature branch. Flagging it as the cause behind a defect class rather than proposing a fix.
Not urgent
Nothing is broken right now. All four copies of the #208 predicate agree, and that one is being consolidated into core. This is about what happens the fourth time, not the third.