@chrisdudek/yg 4.0.2 → 4.2.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.
@@ -1,12 +1,24 @@
1
1
  # yg-architecture.yaml — Schema for architecture constraints
2
2
  # File: .yggdrasil/yg-architecture.yaml
3
- # Defines node types with architectural constraints.
4
- # All properties except description are optional absence means no enforcement.
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.
5
9
 
6
10
  node_types:
7
11
  <type-id>:
8
- description: <string> # required — what this type is for
9
- aspects: [<aspect-id>] # optional — required on every file of this type
10
- parents: [<type-id>] # optional — allowed parent types
11
- relations: # optional allowed relation targets
12
+ description: <string> # required — what this type is for, when to use it
13
+
14
+ aspects: # optional — aspects automatically applied to every
15
+ # node of this type (channel 3). Two forms per entry:
16
+ - simple-aspect # bare string — unconditional
17
+ - id: conditional-aspect # object form — with per-site applicability filter
18
+ when: <predicate> # see graph-schemas/yg-aspect.yaml for grammar
19
+ # These also cascade to children (channel 4).
20
+
21
+ parents: [<type-id>] # optional — allowed parent node types in the hierarchy.
22
+
23
+ relations: # optional — allowed relation targets by relation type.
12
24
  <relation-type>: [<type-id>] # calls | uses | extends | implements | emits | listens
@@ -1,9 +1,55 @@
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 (requirements, rationale, guidance).
4
- # Aspect identifier = relative path from aspects/ to the directory (e.g. observability/logging).
5
- # Aspects can be organized in nested directories for hierarchy.
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 for discovery via yg aspects" # optional
9
- # implies: [other-aspect, another-aspect] # optional other aspect identifiers included automatically (recursive, must be acyclic)
14
+ description: "Short description" # optional but recommended — shown in yg aspects output
15
+ # and context packages, helps agents discover relevant aspects
16
+
17
+ # implies: # optional — other aspects included automatically when this
18
+ # # aspect is effective on a node. Two forms:
19
+ # - simple-aspect-id # bare string — implied unconditionally (when outer aspect passes)
20
+ # - id: conditional-aspect-id # object form — imply only when `when` passes on the node
21
+ # when: <predicate> # see `when` section below for grammar
22
+ # Chains expand recursively. Cycles are forbidden — CLI detects.
23
+
24
+ # when: <predicate> # optional — applicability filter. If the predicate evaluates
25
+ # to false on a node, this aspect is not effective on that node
26
+ # regardless of which channel attached it. Combines with
27
+ # attach-site `when` declarations via AND.
28
+ #
29
+ # Grammar:
30
+ # when:
31
+ # all_of: [<clause>, ...] # AND
32
+ # any_of: [<clause>, ...] # OR
33
+ # not: <clause> # negation
34
+ # <atomic> # top-level atomics imply all_of
35
+ #
36
+ # Atomic clauses:
37
+ # relations:
38
+ # <relation-type>: # calls | uses | extends | implements | emits | listens
39
+ # target_type: <type-id> # match target node's declared type
40
+ # target: <node-path> # match exact node path (relative to model/)
41
+ # consumes_port: <port> # match a port consumed on this relation
42
+ # descendants: # same as relations but evaluated against any descendant in model/
43
+ # relations: {...}
44
+ # type: <type-id>
45
+ # has_port: <port-name>
46
+ # node:
47
+ # type: <type-id>
48
+ # has_port: <port-name>
49
+ # has_mapping: true | false
50
+ #
51
+ # Example:
52
+ # when:
53
+ # any_of:
54
+ # - relations: { calls: { target_type: service-client } }
55
+ # - descendants: { relations: { calls: { target_type: service-client } } }
@@ -1,10 +1,23 @@
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: "Short description of this business process" # optional
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
- # aspects: [requires-saga] # optional — aspect tags propagated to ALL participants
17
+ - payments/payment-service # each participant (and its descendants) must satisfy
18
+ - inventory/inventory-service # any flow-level aspects declared below
19
+
20
+ aspects: # optional — aspects propagate to all flow participants (channel 5)
21
+ - simple-aspect # bare string
22
+ - id: conditional-aspect # object form with per-site applicability filter
23
+ when: <predicate> # see graph-schemas/yg-aspect.yaml for grammar
@@ -1,23 +1,37 @@
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 from yg-architecture.yaml
6
- description: "Short description of what this node does" # optional
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 — list of aspect identifiers
9
- - aspect-id # aspect directory name under aspects/
12
+ aspects: # optional — aspect identifiers applied directly to this node.
13
+ # Two forms per entry:
14
+ - simple-aspect # bare string — always effective once attached (channel 1)
15
+ - id: conditional-aspect # object form — attach with per-site applicability filter
16
+ when: <predicate> # see graph-schemas/yg-aspect.yaml for grammar
17
+ # Aspects cascade to all child nodes.
10
18
 
11
- ports: # optional — named entry points with required aspects (on target nodes)
12
- port-name:
19
+ ports: # optional — named entry points with required aspects
20
+ port-name: # consumers of this node reference ports via consumes
13
21
  description: "What this port provides" # required
14
- aspects: [aspect-id] # required — aspects consumers must satisfy
22
+ aspects: # required — aspects consumers must satisfy (channel 6)
23
+ - simple-aspect # bare string form
24
+ - id: conditional-aspect
25
+ when: <predicate> # object form with per-attach applicability filter
15
26
 
16
27
  relations: # optional — outgoing dependencies to other nodes
17
- - target: other/module-path # required — path relative to model/
28
+ - target: other/module-path # required — node path relative to model/
18
29
  type: calls # required — calls | uses | extends | implements | emits | listens
19
- consumes: [port-name] # optional — port names consumed from target (required when target has ports)
30
+ consumes: [port-name] # optional — port names consumed from target
31
+ # required when target declares ports — otherwise check warns
20
32
 
21
- mapping: # optional — flat list of source file or directory paths
22
- - src/modules/component/ # paths are relative to repository root
23
- - src/modules/component.ts
33
+ mapping: # optional — source files and directories owned by this node
34
+ - src/modules/component/ # directory all files inside are owned (recursive)
35
+ - src/modules/component.ts # file — exact match
36
+ # paths are relative to repository root
37
+ # each source file must have exactly one owner node
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrisdudek/yg",
3
- "version": "4.0.2",
3
+ "version": "4.2.0",
4
4
  "description": "Continuous architecture enforcement for AI-assisted development. Aspects, review, enforcement.",
5
5
  "type": "module",
6
6
  "bin": {