Base-promoted rearrangement of β-ketoester
This problem has probably been on everyone's mechanistic chemistry exam at some time or another. Does the alkyl (allyl) just "jump" from one side of the carbonyl group to the other? In most examples, the allyl group is a saturated alkyl group. Under such circumstances I am in full agreement with @orthocresol as to the mechanism of the process (1 --> 9). The reaction is not catalytic in methoxide and requires sufficiently concentrated alkali to assure sufficient ester enolate, lest the reaction stops at the diester 4. Notice that the red hydrogens in &beta;-ketoester 1 retain their position in the product 9.



While @Carlson Miller suggested the formation of an enolate, his proposal brings up an interesting possibility in this particular example. The ensuing mechanisms are improbable in protic media but imagine running the reaction with a kinetic base ((NaH, (TMS)2NNa, LDA) in an aprotic solvent is intriguing. There are two possible mechanisms for the reaction. First, enolate 10 can fragment to a ketene-ester enolate that must lose methoxide and generate diketene 11. At this point the reaction is stoichiometric in diketene and methoxide. These two species lead to enolate 12. Bimolecular hydrogen exchange affords the more stable enolate 8. Although I am not particularly enamored with this option, it is nonetheless possible in spite of the limited amount of base relative to the protic reaction. Incidently, any product of intramolecular ketene dimerization would be susceptible to opening by methoxide. This mechanistic pathway, as with the protic reaction, retains the red hydrogens in their original location. 



However, the more likely pathway for enolate 10 is via an oxy-Cope-like rearrangement. Although enolate formation is the driving force for the oxy-Cope-like rearrangement (13 --> 14), the rearrangement of enolate 10 gives the more stable enolate of the &beta;-ketoester 8. In this case, the red vinylic hydrogens of ketoester 1 are now located on the methylene group of the allyl residue. Indeed, the allyl group does "jump" in the oxy-Cope.
Enolate 16 is generally formed by alkylation of the dianion of an acetoacetic ester with an allyl halide. Is anyone in SE-land aware of the transformation 15 --> 16?