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
{{ message }}
Repository navigation
bug(bootstrap): injects a stack-incorrect ESM extension rule as a load-bearing constraint #294
charter bootstrap --yes on a Vite + TypeScript + React app wrote this into .ai/core.adf:
⚠ CONSTRAINTS [load-bearing]:
- Use .js extensions for all ESM imports (never .ts in import paths)
That rule is wrong for this stack. The repo uses "moduleResolution": "Bundler" and every import is extensionless:
import{createRng}from'../simulation/random';
Adding .js extensions would be a change no tooling here asks for, and the repo's real rule is the opposite: imports carry no file extension.
Why it matters more than a wrong default
The rule is written under [load-bearing], which Charter defines as "violation causes incorrect output". A fresh agent has no way to know the constraint is a bootstrap default rather than something the maintainers asserted. The failure mode is an agent "fixing" a correct codebase to satisfy a generated rule — a governance tool actively producing drift.
I caught it only because I read the generated module before compiling. An agent bootstrapping unattended would not.
Suggested fix
Pick whichever fits the roadmap:
Condition the rule on resolution mode. Emit the .js rule only when tsconfig.json has moduleResolution: node16/nodenext, or when package.json has "type": "module" without a bundler. For moduleResolution: bundler/vite.config.*, emit the inverse rule or nothing.
Don't emit stack rules as [load-bearing] at bootstrap. Generated guesses could land under [advisory], or under a 📝 REVIEW: section, and get promoted by a human.
Mark generated constraints with something like [unverified] until a human edits the module, so the provenance is visible.
Option 1 is the correct fix; option 3 is a cheap safety net for every other inferred rule.
Repro
# In a Vite + TS + React repo (moduleResolution: Bundler, no "type": "module")
npx @stackbilt/cli bootstrap --yes
grep -n "\.js extensions" .ai/core.adf
@stackbilt/[email protected], Node 22.14, WSL2. Detected stack was reported correctly as runtime: node, stack: react, vite, so the information needed to suppress the rule was already in hand.
Activity
test(adf): pin the extends depth bound and root-tsconfig inheritance (#…