On this page

Packs define code emission

Template packs turn Canonical Dryv Runtime IR into generated representation. They own how software meaning becomes source code, configuration, documentation, packages, project fragments, or complete projects.

Packs consume meaning. They do not redefine it.

Layout and ownership

Each dryv.pack.yaml has one layout: inject (the default), package, or project. An inject pack contributes files to an existing destination. Package and project layouts describe reusable package or application output. The layout is declared in the manifest; the repository folder name is organizational.

Templates normally produce Dryv-managed files. A resource filename with .sf immediately before its renderer extension, such as main.ts.sf.hbs, produces a scaffold: Dryv creates it only when absent and does not overwrite the project's later edits.

Packs may declare logical generation actions. A project's dryv.yaml defines reusable concrete actions under top-level actions.files and actions.final; code destinations select them in order. The Engine resolves the action plan, while the client runs the resulting argv in the project environment.

What a pack declares

A reusable pack can declare:

  • which canonical concepts it is interested in;
  • why items are selected, grouped, or skipped;
  • which template is associated with an invocation;
  • which bounded context a template requires;
  • which artifacts and symbols are planned;
  • generated dependencies between planned artifacts;
  • renderer requirements;
  • output destinations;
  • pack options and project bindings.

These declarations make generation explainable before rendering begins.

The same vocabulary end to end

Pack selection uses the same canonical vocabulary as authoring and Runtime IR.

A pack can reason about Schema, Operation, Event, Workflow, View, Policy, and other canonical concepts.

Target roles such as controller, entity, DTO, repository, screen, page, or SDK model are usually representation choices made by a pack.

Selection is explicit

Templates should not run because of hidden filename conventions or renderer magic.

A pack explicitly selects canonical subjects and defines the scope of an invocation. That lets Dryv explain:

  • what matched;
  • what did not match;
  • why the template was selected;
  • how selected subjects were partitioned into generation work.

Template context is bounded

A template does not receive a live reference to the entire semantic graph.

The engine prepares ordinary JSON-compatible context from:

  • the selected canonical subject;
  • explicitly exposed relationships;
  • derived runtime facts;
  • pack options;
  • project bindings;
  • planned artifacts and generated dependencies;
  • deterministic helpers where justified;
  • trace and provenance information.

Bounded context improves explainability, memory use, renderer portability, security, hashing, and cache invalidation.

Renderers stay semantically narrow

A renderer has a deliberately small contract:

text
template + bounded context + renderer options
                 ↓
              renderer
                 ↓
       rendered content + diagnostics

The renderer does not own semantic selection, canonical meaning, artifact planning, dependency resolution, or filesystem mutation.

Current renderer implementations

Dryv currently has template-server implementations for:

  • Jinja;
  • Handlebars;
  • Liquid;
  • Mustache.

Renderer support is separate from generated output language.

A Handlebars pack can emit TypeScript. A Jinja pack can emit Python, YAML, Rust, Markdown, or another textual representation. The pack owns the target representation.

Generated symbols and dependencies

A planned artifact can declare that it exports a generated symbol. Another artifact can declare that it requires that symbol.

The planner resolves the providing artifact and logical dependency. The template then renders target-language syntax such as import, use, extends, or implements.

That separation keeps dependency meaning explicit without teaching the core runtime every target language's syntax.

Portable packs

A portable pack should make its requirements visible:

  • renderer requirements;
  • required project bindings;
  • supported options;
  • selected canonical subjects;
  • output behavior;
  • generated dependencies.

A user should be able to understand what a pack needs before running it.

Search in