Let $p$ be a prime. The *minimal ramification problem* is to ask whether or not every finite $p$-group $G$ can be realized as the Galois group of a tamely ramified extension of $\mathbb{Q}$ with exactly $r(G)$ ramified primes where $r(G)$ is the minimal number of generators of $G$. This problem has an affirmative solution for some family of $p$-groups, e.g. all Sylow $p$-subgroups of the symmetric group and of the classical groups over finite fields of characteristic prime to $p$, cf. [On the minimal ramification problem for ℓ-groups by Hershy Kisilevsky and Jack Sonn](https://www.cambridge.org/core/journals/compositio-mathematica/article/on-the-minimal-ramification-problem-for-groups/141781DB0334A033F0AC48F68B22FF43). In general, it's still open.


I'm interested in the following refined quesiton: Let $ p $ be an odd prime. Is there a finite Galois extension $ L $ of $ \mathbb{Q} $ such that


1. the Galois group $ G:=\text{Gal}(L/\mathbb{Q}) $ is a finite $ p $-group with order $ |G|> p^{9} $;
2. the extension $ K/\mathbb{Q} $ is ramified at exactly $ 3 $ primes $ q\_{1},q\_{2},q\_{3} $ where $ q\_{i}\equiv 1~\text{mod}~p $ but $ q\_{i}\not \equiv 1~\text{mod}~p^{2} $ for $ i=1,2,3 $?


Note that $L/\mathbb{Q}$ is tamely ramified at $q\_1,q\_2,q\_3$ if and only if $ q\_{i}\equiv 1~\text{mod}~p $. Moreover, the condition that "$ q\_{i}\not \equiv 1~\text{mod}~p^{2} $" is essential here. Without this condition, the answer to question is Yes from the known case of the minimal ramification problem as above.



On the refined minimal ramification problem for $p$-groups
The answer is affirmative at least for $p\ge 11$ by the following construction (for the smaller primes, the extension constructed is not of the demanded degree $>p^9$, but surely there will be some alternative construction):


Let $q\_1\equiv 1$ mod $p$, $q\_1\ne 1$ mod $p^2$, and let $K/\mathbb{Q}$ be the $C\_p$-subextension of $\mathbb{Q}(\zeta\_{q\_1})$ (unramified outside $q\_1$). Next, let's construct a suitable $C\_p$-extension $F/K$, ramified exactly at two (suitable) prime ideals $\nu\_2, \nu\_3$.
Due to the following, we want $\nu\_2, \nu\_3$ to extend (different) rational primes $q\_2, q\_3$, both split in $K(\zeta\_p)$, but not in $K(\zeta\_{p^2})$ (in particular, they are then $\equiv 1$ mod $p$, but not mod $p^2$.


A (special case of a) theorem by Gras and Munnier (<https://pmb.centre-mersenne.org/item/10.5802/pmb.a-91.pdf>) now gives sufficient conditions (on $q\_2,q\_3$) for such an extension to exist. Namely, there exists a certain finite elementary-abelian $p$-extension $L/K(\zeta\_p)$ such that a $C\_p$-extension $F/K$ as desired exists as soon as the Frobenius elements of (primes extending) $q\_2$ and $q\_3$ in $L/K(\zeta\_p)$ generate the same cyclic subgroup. But we have only imposed a condition on the Frobenius in $K(\zeta\_{p^2})/K(\zeta\_p)$ to be nontrivial, so by Chebotarev's density theorem, we can find plenty such primes $q\_2,q\_3$ (if $\zeta\_{p^2}\notin L$, the Frobenius elements could even both be chosen trivial).


So we have a (non-Galois) extension $F/\mathbb{Q}$ of degree $p^2$, ramified at exactly three primes of the prescribed shape; the same is therefore true for its Galois closure $\Omega/\mathbb{Q}$. The Galois group of this embeds into the wreath product $C\_p\wr C\_p$ (of order $p^{p+1}$) by construction, and due to the splitting of $q\_2, q\_3$ in $K/\mathbb{Q}$, we have constructed the inertia groups at $q\_2, q\_3$ to (lie in the block kernel and) act non-trivially on exactly one block of the imprimitive wreath product. It is then an easy exercise in group theory to show that the group generated by all the inertia groups is indeed the full $C\_p\wr C\_p$.


Note, however, that $r(C\_p\wr C\_p)=2$ (as remarked in the comments), so while this construction does fulfill all the requirements of the question, it is not a ``minimal ramification" realization for this particular group.


