Brilliant! This uses A Posteriori logic but isn't a standard AP problem, and it isn't a standard "no last move by Black" retro either. Instead it seems to be a hybrid of the two types, which I haven't seen before. Could this be an original problem type!?
Can you solve this puzzle?
Well, it is a standard A.P. type which used to be known as "A.P. after Keym" (inventor Werner Keym). There appears to be a habit these days to omit the subtype and refer to all such problems as simply "A.P.".
But .... it is just half a Keym solution. The "common" reasoning is that black cannot just decide to start but that some kind of independent arbiter is required. The arbiter says: "of course white can start because it's legal" but "black has equal right of starting provided it's justified later". Because both can start, the full solution consists of two partial solutions (PRA):
- solve the problem with black on move plus the a posteriori justification.
- and, solve the problem with white on move without requirements beyond legality
The stipulation would be #2 A.P. (after Keym)
Here is a version of your problem with both halves filled in; many ways to do it but this one is still a miniature:
Note that in my theory - I am 25 years ahead of the pack - your original version is named "A.P. after Keym RS" and the current one "A.P. after Keym PRA" because the relationship between these 2 subsubtypes is the same as between RS and PRA in standard retro-logic. So your original already has a reserved seat in my theory. Hope you enjoy that!

@Rocky64 Thanks!
@Arisktotle Thanks for explaining it! So the black-to-move part uses AP but because PR is used to find out who to move first, it becomes both.
For your puzzle , would the stipulation become 2 Mate in 2# A.P. after Keym PRA?
Well, sofar the "AP after Keym RS-type" is only defined in my dictionary so everyone will assume it's PRA without further notice. Perhaps they caught up with me in the past 10 years but I didn't keep track of the progress of a stone age culture.
Your last version is outside miniature range but appears correct. From a technical viewpoint it is unsatisfying that black can start with either 1. .. a6 or 1. .. a5 with identical continuations though they aren't duals.
Oops! Your last version is cooked! Blacks last move could be ...Kh3xBg3 or ...Kh3xPg3. Back to the drawing board.
A rich friend of yours died and promised you his castle. But the will shows that the castle goes to his divorced wife. You believe that the will was obsolete and there is an up-to-date will in a vault inside the castle leaving the building to you. So you decide to gamble by breaking into the castle, crack the vault and retrieve the true will. After the act you are caught by the police. Now there are two possibilities:
- The will you found does not change a thing. You end up in jail for illegal break-in and theft.
- The will gives you the castle and replaces the obsolete will. The house you broke into turns out to be your own. No illegal break in, no jailtime, only profit!
This is a posteriori logic. It's dubious and probably won't hold up in court. There are however many situations in life which are judged after a delayed show of evidence. In chess, it is a puzzle type. You do something you are commonly not allowed to do (like play an e.p. move) and then follow it up with a permitted act (like castling) which also happens to prove that you did have the right to play e.p. at the earlier point where you did. Same as with the castle break in and the content of the will.
In this particular puzzle the initial rule violation is to allow black to move first in a diagram while it is commonly white who starts. At a later stage white castles thereby proving that black was indeed on move in the diagram.
Didn't I say it's complicated? Well, it is. You can join one of the many composition clubs in the world if you want to know more. It's kind of hard to fully explain in a single chess.com post

For a less metaphorical explanation of the AP rule , see this blog:
Chess problem conventions re castling and capturing en passant
Thanks for the long explanation! That really sounds complicated 😅
Reading Rocky's blog will give you a simpler technical approach. Most chess players and problemists consider a posteriori puzzles weird because these violate the way they commonly reason. I gave the story to illustrate how they can be seen as "reasonable".

A Posteriori is great, Aristotle, but your “PRA” is behaving very differently from PRA in castling & e.p. Absent a refined definition, I prefer to say that one (in adversarial stip) or both players (in co-operative stip) are trying a steal. This gets them a white disadvantage card from the old board game Totopoly, and none of their horses can win the race unless they discharge the forfeit by castling or some other act that would have been impossible pre-steal
A Posteriori is great, Aristotle, but your “PRA” is behaving very differently from PRA in castling & e.p. Absent a refined definition, I prefer to say that one (in adversarial stip) or both players (in co-operative stip) are trying a steal. This gets them a white disadvantage card from the old board game Totopoly, and none of their horses can win the race unless they discharge the forfeit by castling or some other act that would have been impossible pre-steal
Good to hear from you again! Actually, the PRA "ïnterpretation" is not mine but Frolkins (provided memory ..) and I suppose Keyms as well. It is now hard to retrieve that data from the PDB as the "after Keym" labels appear to have been removed from those problems!
Actually the PRA-relationship is even stronger than for e.p. and castling as the mutual exclusion is stronger: Either white is on move (without castling right) or black is on move (with castling permission). The partials are based on the absolute certainly that only one side can be on move, the castling condition only applies to the AP-justification part of the stipulation! Whether or not the justification happens determines whether there is one or two (partial) solutions. There are compositions with both.
My innovation is not the PRA- but the RS-implementation for the "AP after Keym" type. It says that the move always goes to the non-default party provided it can deliver AP-justification. If it fails then the starting move returns to the default party which gets the opportunity to meet the stipulation without need for justification. Always one solution! By pure luck Graywing13s construction turned out to be of the "AP after Keym RS" type though he knew nothing about that. Under the PRA-type, of course, one part would be missing! Sort of validates that RS is a useful subsubtype.
Note:
I can't recognize the steal metaphor due to my unfamiliarity with that game. The basic "AP type Petrovic" has several refined definitions in my theory including the metaphor in post #10. The definition missing so far is the "second order fuzzy logic" definition based on dual group membership. Every potential castling position is member of the game group where 0-0 is rightful and member of the game group where 0-0 is not rightful. Some day a mathematician will pop up who can do the rest better than me! The "AP type after Keym" is more complex as it handles two different logical types simultaneously. Therefore : "AP type Petrovic" is preferred for getting insight in the AP-process. But since "AP after Keym" already exists, we have to deal with it somehow
Based on @Arisktotle 's retro composition (First place a piece on g3..... then checkmate)
I can never be bothered to read the rules on anything, so I'll warn you beforehand that this composition may be a complete violation of A Posteriori and retro rules. Hope you like it!