@chrisdudek/yg 4.0.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +331 -575
- package/graph-schemas/yg-architecture.yaml +33 -6
- package/graph-schemas/yg-aspect.yaml +16 -5
- package/graph-schemas/yg-flow.yaml +16 -4
- package/graph-schemas/yg-node.yaml +20 -12
- package/package.json +1 -1
|
@@ -1,12 +1,39 @@
|
|
|
1
1
|
# yg-architecture.yaml — Schema for architecture constraints
|
|
2
2
|
# File: .yggdrasil/yg-architecture.yaml
|
|
3
|
-
#
|
|
3
|
+
#
|
|
4
|
+
# Defines the project's type system: what kinds of nodes exist, how they can
|
|
5
|
+
# relate, and which aspects apply by default. This is the foundation of the
|
|
6
|
+
# graph — every node declares a type, and every type must be defined here.
|
|
7
|
+
#
|
|
8
|
+
# Changes to this file affect the entire graph and should be confirmed with the user.
|
|
4
9
|
# All properties except description are optional — absence means no enforcement.
|
|
10
|
+
# When a constraint is absent, anything is allowed. When present, only listed
|
|
11
|
+
# values are permitted.
|
|
5
12
|
|
|
6
13
|
node_types:
|
|
7
14
|
<type-id>:
|
|
8
|
-
description: <string> # required — what this type is for
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
description: <string> # required — what this type is for, when to use it
|
|
16
|
+
|
|
17
|
+
aspects: [<aspect-id>] # optional — aspects automatically applied to every node
|
|
18
|
+
# of this type (channel 3 in aspect resolution).
|
|
19
|
+
# These also cascade to children of nodes of this type
|
|
20
|
+
# (channel 4). Use for invariants that ALL nodes of
|
|
21
|
+
# this type must satisfy.
|
|
22
|
+
|
|
23
|
+
parents: [<type-id>] # optional — allowed parent node types in the hierarchy.
|
|
24
|
+
# If omitted, this type can appear under any parent.
|
|
25
|
+
# If specified, nesting under an unlisted parent type
|
|
26
|
+
# triggers a parent-type-forbidden error.
|
|
27
|
+
|
|
28
|
+
relations: # optional — allowed relation targets by relation type.
|
|
29
|
+
# If a relation type is listed, only the specified
|
|
30
|
+
# target types are allowed. Unlisted relation types
|
|
31
|
+
# are unrestricted. If omitted entirely, all relations
|
|
32
|
+
# are allowed.
|
|
33
|
+
<relation-type>: [<type-id>] # Relation types:
|
|
34
|
+
# calls — runtime invocation
|
|
35
|
+
# uses — compile-time dependency
|
|
36
|
+
# extends — inheritance / specialization
|
|
37
|
+
# implements — interface contract
|
|
38
|
+
# emits — publishes events (must pair with listens)
|
|
39
|
+
# listens — subscribes to events (must pair with emits)
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
# yg-aspect.yaml — Schema for cross-cutting aspects
|
|
2
2
|
# Each aspect is a directory under .yggdrasil/aspects/ containing this file
|
|
3
|
-
# plus any number of .md content files
|
|
4
|
-
#
|
|
5
|
-
#
|
|
3
|
+
# plus any number of .md content files.
|
|
4
|
+
#
|
|
5
|
+
# Aspect identifier = relative path from aspects/ to the directory
|
|
6
|
+
# (e.g. observability/logging). Aspects can be organized in nested
|
|
7
|
+
# directories — the directory structure is for organization only,
|
|
8
|
+
# there is no automatic parent-child inheritance between aspects.
|
|
9
|
+
#
|
|
10
|
+
# The .md content files are what the reviewer checks against source code.
|
|
11
|
+
# They should state WHAT must be satisfied and WHY.
|
|
6
12
|
|
|
7
13
|
name: CrossCuttingRequirementName # required — display name
|
|
8
|
-
description: "Short description
|
|
9
|
-
#
|
|
14
|
+
description: "Short description" # optional but recommended — shown in yg aspects output
|
|
15
|
+
# and context packages, helps agents discover relevant aspects
|
|
16
|
+
|
|
17
|
+
# implies: [other-aspect] # optional — other aspect identifiers included automatically
|
|
18
|
+
# when this aspect is effective on a node. Recursive expansion
|
|
19
|
+
# (A implies B implies C = all three effective). Must be acyclic
|
|
20
|
+
# — CLI detects and rejects cycles.
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
# yg-flow.yaml — Schema for end-to-end business flows
|
|
2
2
|
# Each flow is a directory under .yggdrasil/flows/ containing this file.
|
|
3
|
+
#
|
|
4
|
+
# A flow describes a business process — what happens in the world,
|
|
5
|
+
# not code call sequences. "User places an order" is a flow.
|
|
6
|
+
# "Handler calls service" is a relation between nodes.
|
|
7
|
+
#
|
|
8
|
+
# Descendants of a declared participant are automatically included —
|
|
9
|
+
# listing a parent node covers all its children.
|
|
3
10
|
|
|
4
11
|
name: EndToEndProcessName # required — display name
|
|
5
|
-
description: "
|
|
12
|
+
description: "What this business process does" # optional but recommended — shown in
|
|
13
|
+
# yg flows output and context packages
|
|
14
|
+
|
|
6
15
|
nodes: # required, non-empty — participant nodes (alias: participants)
|
|
7
16
|
- orders/order-service # paths relative to model/
|
|
8
|
-
- payments/payment-service
|
|
9
|
-
- inventory/inventory-service
|
|
10
|
-
|
|
17
|
+
- payments/payment-service # each participant (and its descendants) must satisfy
|
|
18
|
+
- inventory/inventory-service # any flow-level aspects declared below
|
|
19
|
+
|
|
20
|
+
# aspects: [requires-saga] # optional — aspect identifiers propagated to ALL participants
|
|
21
|
+
# (channel 5 in aspect resolution). Use for requirements that
|
|
22
|
+
# apply to every node in this process but not globally.
|
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
# yg-node.yaml — Schema for model nodes
|
|
2
2
|
# Every node is a directory under .yggdrasil/model/ containing this file.
|
|
3
|
+
# The node's path in the graph = its directory path relative to model/.
|
|
4
|
+
# Nodes nest by directory — a node at model/orders/handler/ is a child
|
|
5
|
+
# of model/orders/ and inherits its parent's aspects.
|
|
3
6
|
|
|
4
7
|
name: ComponentName # required — display name
|
|
5
|
-
type: service # required — must match a type
|
|
6
|
-
description: "
|
|
8
|
+
type: service # required — must match a type defined in yg-architecture.yaml
|
|
9
|
+
description: "What this node does" # optional but recommended — shown in context output,
|
|
10
|
+
# helps agents understand purpose without reading code
|
|
7
11
|
|
|
8
|
-
aspects: # optional —
|
|
9
|
-
- aspect-id #
|
|
12
|
+
aspects: # optional — aspect identifiers applied directly to this node
|
|
13
|
+
- aspect-id # must match a directory name under aspects/
|
|
14
|
+
# these aspects also cascade to all child nodes
|
|
10
15
|
|
|
11
|
-
ports: # optional — named entry points with required aspects
|
|
12
|
-
port-name:
|
|
16
|
+
ports: # optional — named entry points with required aspects
|
|
17
|
+
port-name: # consumers of this node reference ports via consumes
|
|
13
18
|
description: "What this port provides" # required
|
|
14
|
-
aspects: [aspect-id] # required — aspects consumers must satisfy
|
|
19
|
+
aspects: [aspect-id] # required — aspects that consumers must satisfy (channel 6)
|
|
15
20
|
|
|
16
21
|
relations: # optional — outgoing dependencies to other nodes
|
|
17
|
-
- target: other/module-path # required — path relative to model/
|
|
22
|
+
- target: other/module-path # required — node path relative to model/
|
|
18
23
|
type: calls # required — calls | uses | extends | implements | emits | listens
|
|
19
|
-
consumes: [port-name] # optional — port names consumed from target
|
|
24
|
+
consumes: [port-name] # optional — port names consumed from target
|
|
25
|
+
# required when target declares ports — otherwise check warns
|
|
20
26
|
|
|
21
|
-
mapping: # optional —
|
|
22
|
-
- src/modules/component/ #
|
|
23
|
-
- src/modules/component.ts
|
|
27
|
+
mapping: # optional — source files and directories owned by this node
|
|
28
|
+
- src/modules/component/ # directory — all files inside are owned (recursive)
|
|
29
|
+
- src/modules/component.ts # file — exact match
|
|
30
|
+
# paths are relative to repository root
|
|
31
|
+
# each source file must have exactly one owner node
|