On this page
- 1. Renderer/tool plugins
- 2. Layout is a scalar
- 3. Package metadata is separate from layout
- 4. Global resources do not require fake template entries
- 5. Ownership is resource-level
- 6. Static directories live in the template filesystem
- 7. Manifest templates represent real selection/export behavior
- 8. One project usage document remains authoritative
- 9. Generated-code dependencies
- 10. Project versus package dependency application
- 11. Actions live in the pack and appear last in normal pack documents
- 12. Common action IDs are stable vocabulary, not hidden command recipes
- 13. Action entries must carry useful information
- 14. Commands are explicit argv patterns inside the action
- 15. Candidate IDs are optional
- 16. The project owns knowledge of its real environment
- 17. Dependency requirements remain separate from dependency argv
- 18. Dependency scope args are ordered and candidate-aware
- 19. Managed package manifests do not need dependency argv expansion
- 20. Same action IDs are batching points
- 21. Engine plans; Client executes
- 22. Choice groups coordinate related command choices
- 23. Destination/unit owns project command choices
- 24. Usage action overrides inherit action semantics
- 25. Extensions are action semantics
- 26. Action ordering may cross pack boundaries
- 27. Commands may be intentionally omitted
- 28. Choice groups merge per generated unit
- 29. Destination action configuration is constrained
- 30. Action execution context is unit-scoped
- 31. Empty expansions skip only what is empty
- 32. Pack design requires a dryv.yaml Usage change
- 33. Usage reference branches are typed
- 34. dryv.lock is a Usage reproducibility companion
- 35. Compact YAML is preferred when it removes repetition
Design rules
Status: locked for this design review
These approved decisions are preserved here as design authority. They do not imply every planned feature is implemented. An implementation AI must not silently change them.
All contract work remains on v1alpha1.
1. Renderer/tool plugins
Pack plugin dependencies use the key:
plugins:
- { name: handlebars, extensions: [.hbs] }
Do not use requires: for renderer plugins.
The word needs remains reserved for capability needs between packs.
2. Layout is a scalar
Layout is not an object.
layout: unit
Inject is the default:
# layout omitted
means:
layout = inject
Explicit layout: inject may be accepted, but normal packs should omit it.
3. Package metadata is separate from layout
Do not put package metadata inside layout.
A package pack uses a separate top-level package block only for generic
runtime facts that planning actually needs.
Current proposed minimum:
layout: unit
package:
name: { $ref: "#/inputs/package_name" }
import_root: lib
Rules:
- no
ecosystemfield merely to teach Dryv npm/Dart/Python semantics; nameis the consumer-visible package identity;import_rootis optional and exists only when package-relative artifact addressing needs it;- package discovery metadata such as languages/frameworks stays in
catalog; - runtime package identity must not live only in
catalog, because catalogue metadata is not runtime authority.
The exact internal reference contract for #/inputs/<key> still needs implementation design, but package identity must remain explicit and minimal.
4. Global resources do not require fake template entries
A pack must not create manifest entries such as:
templates:
package:
ownership: managed
merely to generate root files.
Resources outside a {template_key} marker are global resources and are
emitted once per pack activation.
Example:
templates/
├── pubspec.yaml.hbs
├── analysis_options.yaml
└── lib/
└── client.dart.hbs
These are real files, not a fake package selection/template.
The same rule applies to project root files such as package.json,
pubspec.yaml, main.ts, and main.dart.
5. Ownership is resource-level
Managed is the default.
A normal resource name means:
managed
A reserved .sf control suffix means:
generate once, then user-owned
.sf is the canonical and only scaffold suffix. Do not also support
.scaffold; one spelling keeps resource identity and parsing unambiguous.
Because .sf is reserved by Dryv, a literal output filename that itself ends
in .sf cannot be represented by placing that suffix at the terminal control
position.
Use .sf (scaffold), not immutable or .im. “Immutable” suggests the user
must not edit the file, which is the opposite of scaffold behavior.
Rendered example:
templates/lib/main.dart.sf.hbs
^^ scaffold marker
^^^ renderer suffix
Output:
lib/main.dart
Raw/static example:
templates/README.md.sf
Output:
README.md
Resolution order:
- detect and strip the renderer suffix;
- detect and strip the terminal
.sfcontrol suffix from the remaining resource name; - the remaining filename is the output filename.
This allows one selection/template to own both managed and scaffold resources without a template-level ownership setting.
Do not duplicate ownership in dryv.pack.yaml.
6. Static directories live in the template filesystem
output.path is only for dynamic directory segments.
Wrong:
output:
path: [src, generated, dto]
Correct filesystem:
templates/
└── src/
└── generated/
└── dto/
└── {dto}/
└── $(name).dto.ts.hbs
with no output.path when no dynamic directory is required.
When dynamic directories are required:
templates:
controller:
$ref: "#/selections/controllers"
output:
name: $(feature.name.kebab)
path:
- $(group.name.kebab)
- $(feature.name.kebab)
symbol: $(feature.name.pascal)Controller
and:
templates/
└── src/
└── generated/
└── controllers/
└── {controller}/
└── $(name).controller.ts.hbs
produces a path conceptually like:
src/generated/controllers/<group>/<feature>/<name>.controller.ts
Every output.path segment must contain at least one allowed planning
interpolation token. Purely static path segments are rejected.
7. Manifest templates represent real selection/export behavior
A templates.<key> entry exists because the template has real planner behavior:
- it is driven by a selection; or
- it aggregates/exports planned artifacts.
Do not create registry entries solely to name static/global files, assign ownership, or model a package/project root.
8. One project usage document remains authoritative
Generator packs use dryv.pack.yaml.
The user's workspace uses one dryv.yaml.
Packs do not hide another active dryv.yaml or auto-activate other packs.
9. Generated-code dependencies
Packs explicitly declare libraries required by the code they generate.
Use compact name-to-version mappings:
dependencies:
runtime:
typeorm: ^0.3
reflect-metadata: ^0.2
dev:
some-build-tool: ^1
Rules:
- every mapping entry is exactly one dependency
nameandversion; runtimeanddevare separate sets;- version syntax is opaque to the Engine;
- Dryv does not implement npm/pub/pip/other version semantics;
- requirements are aggregated per generated unit;
- the same name and same version deduplicates;
- the same name with different declared versions is a planning conflict until an explicit future resolution model is designed;
- diagnostics and plans must show which pack contributed each requirement.
Dependencies are not renderer plugins, capability needs or executable tools.
plugins -> Dryv/template processing dependencies
needs/provides -> generated capability relationships
dependencies -> libraries imported/required by generated code
actions/commands-> external generation work and exact argv implementations
10. Project versus package dependency application
Editable project units follow the safer project behavior:
pack dependencies
-> unit dependency requirements
-> explicit installer command
-> selected package manager/runtime tool
-> tool updates the user-owned manifest and lockfile
Dryv does not directly rewrite a scaffold/handwritten package.json,
pubspec.yaml, pyproject.toml or equivalent simply to add dependencies.
Generated package units may use their merged unit dependencies while rendering their managed package manifest, because that manifest remains Dryv-owned. A normal sync command may then restore/install from that manifest.
Therefore:
project unit:
install requirements through an explicit command
package unit:
render requirements into managed manifest
then run normal dependency sync if desired
The client still owns command execution and project configuration may override or disable it.
11. Actions live in the pack and appear last in normal pack documents
A pack declares actions directly in dryv.pack.yaml.
actions:
format:
stage: files
...
install:
stage: final
...
typecheck:
stage: final
...
Rules:
- each action declares
stage: filesorstage: final(the earlierfiles:/final:grouping is replaced by this flat registry; see actions); - the action ID is the mapping key;
- mapping order is significant and is the pack's requested sequence among actions of the same stage;
- do not repeat an
id:field on the action; - stage is not duplicated inside command candidates;
- normal pack examples place
actionslast because actions are operational consequences of the pack definition.
files acts on staged generated files before compare/write. final acts after workspace write.
12. Common action IDs are stable vocabulary, not hidden command recipes
Dryv may define human-facing metadata for common action IDs such as:
format
install
typecheck
analyze
test
build
install-dev is not a separate action. dev is a dependency scope handled by the logical install action.
Dryv knowing an action ID never means Dryv knows how to execute it. There is no built-in npm/pnpm/bun/Dart recipe.
Custom action IDs are allowed. A custom action should provide name and/or description when its purpose is not obvious.
13. Action entries must carry useful information
Avoid meaningless empty declarations.
If a pack omits both name and description, the action must still carry useful behavior or requirements, such as extensions, dependencies, after, or a non-empty commands list.
An action may contain:
name— optional human title;description— optional explanation;extensions— optionalfiles-stage filtering;dependencies— optional dependency argument rule;after— optional same-stage ordering dependency;commands— optional candidate implementations.
A pack may intentionally leave execution to the project when it provides enough metadata to explain the custom requirement.
14. Commands are explicit argv patterns inside the action
There is no separate dryv.cmd.yaml.
A normal command is exact argv:
commands:
- run: [npm, install]
Repeated candidates with the same argv shape may use grouped alternatives:
commands:
- run: [(pnpm|bun|yarn), add]
- run: [npm, install]
The grouped run is explicit shorthand for:
[pnpm, add]
[bun, add]
[yarn, add]
[npm, install]
When several argv positions contain grouped alternatives, they are zipped by position, never Cartesian-expanded:
- run: [(a|b|c), (x|y|z), common]
means:
[a, x, common]
[b, y, common]
[c, z, common]
All grouped positions in one run must have the same arity.
Grouped syntax is recognized only when the whole argv item has the form (a|b|c). Other argv strings remain literal.
A command with a different argv shape gets its own run.
Grouped syntax only removes repetition. The Engine expands it to ordinary explicit candidates before selection, planning and tracing.
Commands are argv data, never shell strings.
15. Candidate IDs are optional
After grouped-run expansion, the candidate key is:
candidate.id when present
otherwise expanded run[0]
Therefore:
commands:
- run: [(pnpm|bun|yarn), add]
- run: [npm, install]
provides the candidate keys pnpm, bun, yarn and npm.
Explicit IDs remain useful for an individual command when run[0] is not a useful stable key:
commands:
- id: prettier
run: [pnpm, exec, prettier, --write, $(files)]
A grouped run normally derives its keys from its expanded first token. Do not hide several alternatives behind one explicit ID.
16. The project owns knowledge of its real environment
The pack knows what generation needs. The project/user knows what tooling the project actually uses.
A pack may expose explicit pnpm/npm/bun/yarn candidates, while dryv.yaml selects the destination's real choice.
Dryv must not silently choose based on PATH, lockfiles or installed tools.
For a one-candidate action, that candidate is used.
For a multi-candidate action, the compatible choose group's first option is the authored default unless destination usage selects another option.
Candidate declaration order does not need to repeat the choice-group option order.
17. Dependency requirements remain separate from dependency argv
Packs declare generated-code requirements as structured data:
dependencies:
runtime:
typeorm: ^0.3
reflect-metadata: ^0.2
dev:
prettier: ^3
typescript: ^5.8
runtime and dev are dependency scopes.
An action describes how scopes become argv with an ordered dependencies.args list:
install:
dependencies:
args:
- dev: { (pnpm|yarn): [-D], bun: [--dev], npm: [--save-dev] }
- $(name)@$(version)
commands:
- run: [(pnpm|bun|yarn), add]
- run: [npm, install]
A plain args item applies to every dependency scope.
A scoped item such as dev: applies only while processing that scope.
The list order is exact argv order.
Dryv does not interpret @, :, -D, --dev or package-manager semantics. The pack states those differences explicitly.
18. Dependency scope args are ordered and candidate-aware
For every non-empty dependency scope, Dryv processes dependencies.args in authored order.
Rules:
- a plain item such as
$(name)@$(version)applies to every scope; runtime:applies only to runtime dependencies;dev:applies only to dev dependencies;- missing scope configuration means no scope-specific extra argv;
- there is no need for
runtime: {}; - inside a scoped mapping, keys are selected command candidate keys;
- a grouped key such as
(pnpm|yarn)applies the same argv to both keys.
Example:
dependencies:
args:
- dev: { (pnpm|yarn): [-D], bun: [--dev], npm: [--save-dev] }
- $(name)@$(version)
For pnpm, runtime emits only dependency items while dev emits -D before the dependency items.
The action-local dependency model does not duplicate the top-level dependency requirements; it only defines their argv placement.
19. Managed package manifests do not need dependency argv expansion
A generated package may render merged dependencies into its Dryv-managed package manifest.
Its install/sync action can therefore be:
install:
commands:
- run: [(dart|flutter), pub, get]
No dependencies.args expansion is needed.
For an editable/user-owned manifest, install may consume merged dependency scopes and let the selected project tool update the manifest and lockfile.
20. Same action IDs are batching points
Within one generated unit, compatible requests for the same action ID represent one logical action.
Examples:
TypeORM -> install
class-validator -> install
NestJS -> install
can resolve to one logical install action over the unit's merged runtime/dev scopes.
One logical action may produce multiple exact process invocations. For example, install can produce one runtime invocation and one dev invocation.
Likewise compatible format or typecheck requests can resolve once per unit.
Different command definitions or contradictory ordering must not be silently combined.
21. Engine plans; Client executes
The Engine may:
- expand grouped command patterns into explicit candidates;
- merge dependencies by scope;
- merge/batch compatible logical actions;
- apply destination choices and action overrides;
- expand
$(files)and ordered dependency args; - produce one or more exact argv invocations per logical action;
- explain authored pattern, expanded candidate, scope and origin.
The Engine never starts host processes.
The Client owns executable availability checks, approval/policy, process execution and workspace I/O.
No command executes merely because its action ID is familiar.
22. Choice groups coordinate related command choices
A pack may declare reusable tool choices separately from actions:
choose:
js.package_manager: { options: [pnpm, npm, bun, yarn] }
The first option is the pack default.
Grouped command patterns expand first. Candidate keys are then derived from each expanded candidate.
commands:
- run: [(pnpm|bun|yarn), add]
- run: [npm, install]
therefore supports the four explicit candidate keys required by the choice group.
A one-candidate action needs no choice group.
Choice groups are selection vocabulary only. They contain no hidden command recipes.
23. Destination/unit owns project command choices
Project environment configuration belongs to the code destination because every contributing pack executes in the same generated unit.
destinations:
backend:
path: apps/backend
choose: { js.package_manager: pnpm }
actions:
files:
format:
commands:
- run: [pnpm, exec, biome, format, --write, $(files)]
final:
typecheck: { disable: true }
Different destinations may choose different environments.
Do not put one global package-manager choice over unrelated destinations.
24. Usage action overrides inherit action semantics
A destination action override changes only the fields it supplies.
If the merged pack action has:
format:
extensions: [.ts]
commands:
- run: [(pnpm|yarn), exec, prettier, --write, $(files)]
and usage changes only commands, the extensions filter remains inherited.
The same field-level inheritance principle applies to dependencies, name, description and ordering metadata where the Usage contract allows replacement.
A project command replacement normally supplies one exact command because the destination already knows its environment.
25. Extensions are action semantics
extensions belongs to a files action, never to an individual command candidate.
format:
extensions: [.ts, .tsx]
commands:
- run: [pnpm, exec, prettier, --write, $(files)]
When same-ID file actions from several packs batch, each pack's generated files are first filtered by that pack's declared extensions. The resulting file sets are then unioned, sorted and supplied to the merged action.
This prevents one pack's broader extension set from changing which files another pack intended its action to receive.
If destination usage explicitly overrides extensions, the override becomes the filter for the resolved project action.
An empty resolved $(files) list skips the command.
26. Action ordering may cross pack boundaries
Mapping order remains the normal sequence inside one pack.
When an action has a real dependency on another same-stage action, use:
build-runner:
after: [install]
after may refer to a same-stage action contributed by another pack in the same generated unit.
Unknown after targets are planning errors. They are not silently ignored.
Cycles are planning errors.
27. Commands may be intentionally omitted
commands is optional.
A pack may know that an action is required without knowing a safe project-specific implementation:
install:
dependencies:
args:
- $(name)@$(version)
or:
company-setup:
name: Configure generated client
description: Register generated client artifacts using project tooling.
Such an action remains unresolved until destination configuration supplies an implementation.
Do not force a pack to invent environment knowledge merely to satisfy schema validation.
28. Choice groups merge per generated unit
Choice groups are unit-scoped planning data even though packs declare them independently.
When several packs contributing to one destination declare the same group:
- option sets are merged deterministically;
- a destination-level
choosevalue is authoritative; - grouped command patterns expand before support is checked;
- every multi-candidate action bound to the group must support the selected option after expansion;
- if packs disagree on the first/default option and usage does not select one explicitly, planning reports a choice conflict.
Expanded candidate keys must be unique within one action.
29. Destination action configuration is constrained
Destination usage may configure only actions contributed to that generated unit.
destinations:
backend:
actions:
final:
typecheck: { disable: true }
Unknown action IDs are configuration errors, not silent no-ops.
A disabled action does not execute but remains visible in the plan with its contributing packs and disabling usage location.
A project command replacement should normally provide one exact command implementation because the destination already knows its environment. Pack alternatives belong in pack commands plus choose.
30. Action execution context is unit-scoped
Every final-stage command executes with the generated unit root as its working directory.
Files-stage commands operate on staged files for that same unit. The staging location must remain inside or otherwise preserve unit-relative tool configuration lookup so tools such as formatters can find project configuration deterministically.
The Engine plans working-directory intent but never touches the host filesystem or starts the process.
31. Empty expansions skip only what is empty
An empty resolved $(files) list produces no files-action invocation.
For an action using dependencies.args, each non-empty dependency scope produces its own invocation. An empty scope produces no invocation for that scope.
If every dependency scope is empty, a dependency-consuming install action produces no dependency invocation.
An action with commands but no dependency expansion follows its normal command semantics, such as a managed-package dart pub get.
32. Pack design requires a dryv.yaml Usage change
The generated-unit/action design cannot remain clean with the old usage shape.
This workspace therefore proposes a coordinated dryv/v1alpha1 change.
The new structural Usage vocabulary is:
sources:
authoring: ...
packs: ...
destinations:
ir: ...
code: ...
authoring:
source: { $ref: "#/sources/authoring/..." }
packs: ...
This is a Usage-tier change, not a pack semantic field and not Runtime IR.
Pack activations reference shared pack sources and typed code destinations instead of repeating repository configuration.
Code-destination choose and actions hold the unit environment policy established by this pack design.
The complete proposal is recorded in 10-dryv-yaml-usage-update.md.
33. Usage reference branches are typed
The proposed Usage refs are constrained by role:
authoring.source -> #/sources/authoring/
authoring.destination -> #/destinations/ir/
packs.*.source -> #/sources/packs/
packs.*.destination -> #/destinations/<code destination>
packs.*.destinations.* -> #/destinations/<code destination>
packs.*.bind.* -> #/packs/
Wrong-branch references fail validation. Dryv does not infer intended branches.
34. dryv.lock is a Usage reproducibility companion
The Usage redesign introduces a generated dryv.lock concept for exact resolution of human-friendly source refs.
Its role is to pin facts such as:
- Git commits;
- local source digests;
- resolved authoring implementation versions/digests;
- pack content digests.
The lock does not define software meaning and does not become Runtime IR.
Exact hashing/update behavior remains implementation design.
35. Compact YAML is preferred when it removes repetition
Small declarative objects should use flow style when that makes a pack easier to scan:
plugins:
- { name: handlebars, extensions: [.hbs] }
inputs:
package_name: { type: string, required: true }
needs:
schema.validation: required
schema.persistence: required
choose:
js.package_manager: { options: [pnpm, npm, bun, yarn] }
This is a style convention, not different semantics.
Expand YAML when the compressed form would make structure harder to understand.