{"modulePath":"github.com/GoCodeAlone/workflow","version":"v0.87.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package scaffold\n\nPackage scaffold composes functional workflow scaffolds via Assembly Grammar.\n\n## Types\n\n```go\ntype ApplyResult struct {\n\tModules   []config.ModuleConfig\n\tWorkflows map[string]any\n\tGlueGaps  []string\n}\n```\nApplyResult is the Category-A wire output: the (possibly extended) module list, the emitted workflows.\\\u003cclass\u003e sections (entry-point + routes), and any glue-gaps (unselected Attaches.To targets) surfaced as NEXT\\_STEPS data.\n\n```go\nfunc GrammarWire(mods []config.ModuleConfig, g MergedGrammar, reg *schema.ModuleSchemaRegistry, alwaysSelect []string) ApplyResult\n```\nGrammarWire applies Category-A Assembly Grammar to mods (D16/D17/D18/D22/D23, + P2/P6/P8 fixes):\n\n  - Requires (by type): ensure-selected (visited-set transitive closure) + DependsOn.\n  - RouteMiddlewares (by TYPE — P8): materialize an instance (named defaultName(mwt)) so the runtime GetService resolves consistently with the emitted route reference.\n  - AlwaysSelect (P2): entry-point-class-declared types always materialized (e.g. http.router + health.checker for the http class, for v0.82.0 parity).\n  - ensure-selected materializes WITH DefaultConfig from reg (P6).\n  - Attaches.To: DependsOn + entry-point section; unselected (real type) → glue-gap; phantom → already rejected at MergeGrammar (D23).\n  - Fragment: emit the route block with RouteMiddlewares-as-defaultNames (D4 crud-route).\n\nreg is the engine ModuleSchemaRegistry (for DefaultConfig + type lookups); g is the MergeGrammar output. The function does not append to res.Modules after Pass A, so pointers indexed post-Pass-A stay valid through Pass B (⊥ storing pointers into a slice that is still being appended to — retro #1 dangling-pointer class).\n\n```go\ntype MergedGrammar map[string]schema.GrammarDecl\n```\nMergedGrammar is the per-module-type resolved grammar (engine ∪ plugins).\n\n```go\nfunc MergeGrammar(reg *schema.ModuleSchemaRegistry, inv *inventory.Inventory) (MergedGrammar, []string, error)\n```\nMergeGrammar merges engine ModuleSchemaRegistry grammar ∪ plugin Provider.Grammar. Order: engine-first, then plugins by (provider-name, module-type). Conflict policy (D2/D16/D17/D22/D23):\n\n  - scalar-field conflict = error (per-field across structs); list-field = union;\n  - engine wins for engine-registered types (D25);\n  - phantom Attaches/Requires target = load-error (D23);\n  - circular Requires = error (D17, via Tarjan SCC).\n\nReturns the merged grammar + the sorted, de-duplicated union of Category-B RuntimeHooks (for NEXT\\_STEPS documentation, D3).\n\n","path":"github.com/GoCodeAlone/workflow/capability/scaffold","name":"scaffold","synopsis":"Package scaffold composes functional workflow scaffolds via Assembly Grammar.","isRedistributable":true}
