Is it only a coincidence that that the non-commutative product $(A + aa)^3$ sort of enumerates the possible start rules of in-between grammars from $S \to aaaaaa$ all the way to $\{S \to A^3, A \to aa \}$:
$$ (A + aa)^3 = A^3 + A a^4 + a^4 A + a^2 A a^2 + A a^2 A + a^2 A^2 + A^2 a^2 + a^6 $$
Now replace $+$ with comma or treat string addition as language union.
? If we let commutation of the symbols happen, then the integer coefficients count the symmetries.
Can we generalize this to more than one letter? What does it mean?
A more complex example. Let $s = abcabcab$, which obviously has two smallest grammars. Define the characteristic polynomial of a grammar $G$ recursively beginning at the start rule $S$. Define it for a variable $A \to a_0A_1a_1\cdots A_na_n \in G$ (where $a_i$ are constant strings) as $a_0\prod (A_i + \chi(A_i))a_i$, where $\chi(A_i)$ is the characteristic polynomial of $A_i \to G(A_i)$ is the rule for variable $A_i$. Allow commutation between strings $t,s \in \Sigma_G^*$ iff $G^k(s) = G^k(t)$ for some $k \geq 1$, in other words they expand to the same string. Thus the characteristic polynomial is recursively defined. Use integer coefficients where possible. These integer coefficients indicate how many paths in a smallest grammar algorithm (leading to $G$) are essentially the same at some step $i$ in the algorithm.