Explore: scaffold base code from the structured model (skill-based, evidence-gated)

Aperta
#7 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Tranquilla
Stack tecnologico
go
Ambito
tooling

Direzione di ricerca

Inizia esaminando le evidenze e i test di #5, poiché questa esplorazione è subordinata al mantenimento dei suoi artefatti basati sulle skill. Se tali evidenze supportano la prosecuzione, definisci il confine dello scaffolding di proprietà della skill senza aggiungere un backend linguistico o un contratto di rigenerazione. Registra la decisione risultante in audits/; il successo significa una domanda dimostrata e un modello chiaro di ownership.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement question

Summary

Explore generating base code scaffolding (types/structs, enums, relationship-shaped fields) from the structured parts of a model. This is the most ambitious "wire code in from the model" idea — and the one with the weakest cost/benefit. Filing it to capture the design constraints, not as committed work. Gated on evidence from #5.

Hard constraints established up front

Not modelith generate --lang go in the binary. A --lang flag is an implicit promise of ts/python/java backends — each a golden-fixture suite (the example renders to one .md; this would be N language outputs), each with per-language idiom debates (pointer vs value, Optional[T] vs zero-value, how n:n materializes), each a place CI breaks. That combinatorial surface contradicts modelith's lean-binary character (~1KLOC, 4 direct deps).

The output is structurally anemic — by design of the source. From Attribute{Name, Type, Description, Derived, Derivation} and Relationship{Entity, Cardinality, Ownership, Role} you can emit little more than:

type Project struct {
    Status             ProjectStatus
    EnabledPolicyCount int       // derived — stub, derivation is prose
    Users              []*User   // n:n
    Policies           []*Policy  // 1:n, owned
}

No field is a domain type (the model is primitive-by-design because it's prose-first), no validation (invariants are prose), no behavior (actions are a {name, actor, preserves} label, not a signature). That's a struct any engineer writes in 90 seconds — and will immediately edit. Generating it richer would require adding types/signatures/grammar to the model, i.e. turning modelith into an IDL and abandoning "communication-first."

Regeneration = drift. Unlike the rendered .md (disposable, byte-compared, nobody edits it), generated code accretes hand edits the moment it exists. Owning that lifecycle imports the exact DO NOT EDIT / .gen.go / partial-file machinery that codegen tools carry — larger than modelith's current codebase.

If it's ever pursued

Do it as a skill, not a binary subcommand: the skill drops scaffolding into the user's repo and the user owns the file from birth. No regeneration contract → no drift lifecycle → no language-backend matrix baked into the CLI. Same human-in-the-loop shape as #5.

Gate

Only pursue after #5 demonstrates the skill-based, human-in-the-loop model produces artifacts engineers keep. If #5's tests are valuable but scaffolding demand never materializes, this can stay closed indefinitely — that's an acceptable outcome, not a failure.

Background

Descends from "Tier 1" of a three-tier design discussion. A skeptic pass recommended cutting it from the binary entirely; retained here as a scoped, evidence-gated exploration so the constraints aren't rediscovered later. Consider recording the decision in audits/.

🤖 Generated with Claude Code

Lingua principale
Go
Stelle
32
Fork
5
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di stacklok/modelith

Tutte le issue di stacklok/modelith

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.