@chrisdudek/yg 5.0.0-alpha.4 → 5.0.0-alpha.6
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/README.md +2 -0
- package/dist/bin.js +15139 -13841
- package/dist/structure.d.ts +40 -18
- package/dist/structure.js +296 -41
- package/graph-schemas/yg-architecture.yaml +8 -3
- package/graph-schemas/yg-aspect.yaml +54 -0
- package/graph-schemas/yg-config.yaml +8 -8
- package/graph-schemas/yg-node.yaml +5 -6
- package/package.json +4 -1
|
@@ -116,6 +116,60 @@ status: enforced # optional — aspect-level default. enum: dr
|
|
|
116
116
|
# - relations: { calls: { target_type: service-client } }
|
|
117
117
|
# - descendants: { relations: { calls: { target_type: service-client } } }
|
|
118
118
|
|
|
119
|
+
# scope: # optional — controls review granularity (applies to both LLM
|
|
120
|
+
# and deterministic aspects). Forbidden on aggregate aspects.
|
|
121
|
+
# Absent → equivalent to { per: node }.
|
|
122
|
+
#
|
|
123
|
+
# Fields:
|
|
124
|
+
# per: node | file REQUIRED. Default: node.
|
|
125
|
+
# node — one review over the whole subject set.
|
|
126
|
+
# LLM: one prompt with all subject files.
|
|
127
|
+
# Deterministic: one check(ctx) invocation; ctx.files = subject set.
|
|
128
|
+
# file — one review per subject file.
|
|
129
|
+
# LLM: one prompt per file.
|
|
130
|
+
# Deterministic: one check(ctx) invocation per file; ctx.files = [file].
|
|
131
|
+
# WARNING: per: file is ONLY for file-local rules — a per-file
|
|
132
|
+
# reviewer cannot see sibling files. Rules that need cross-file
|
|
133
|
+
# context (e.g. "correlation ID propagates across calls") must
|
|
134
|
+
# stay per: node. Before switching an aspect to per: file, verify
|
|
135
|
+
# the rule can be judged from that single file alone.
|
|
136
|
+
#
|
|
137
|
+
# files: <file-predicate> OPTIONAL. Filters which mapped files enter
|
|
138
|
+
# the subject set. Subject set = mapped files ∩ filter.
|
|
139
|
+
# Absent → all mapped files.
|
|
140
|
+
# Empty subject set after filtering → vacuous pass by design (no review,
|
|
141
|
+
# no error). An aspect may legitimately exclude every file of a node it
|
|
142
|
+
# lands on (e.g. a filter that matches only *.ts files landing on a
|
|
143
|
+
# node with only *.py files).
|
|
144
|
+
#
|
|
145
|
+
# File-predicate grammar — atoms:
|
|
146
|
+
# path: "glob" minimatch glob on repo-relative POSIX path
|
|
147
|
+
# content: "regex" JavaScript regex tested against file content
|
|
148
|
+
# Boolean combinators (same as aspect when:):
|
|
149
|
+
# all_of: [...] AND
|
|
150
|
+
# any_of: [...] OR
|
|
151
|
+
# not: <clause> negation
|
|
152
|
+
# Top-level path + content imply all_of.
|
|
153
|
+
#
|
|
154
|
+
# NOTE: path/content are FILE atoms — they belong here in scope.files.
|
|
155
|
+
# The aspect-level when: field uses NODE atoms (node, relations,
|
|
156
|
+
# descendants) and filters which NODES the aspect applies to — do not
|
|
157
|
+
# mix the two. The CLI will cross-hint you if you use an atom in the
|
|
158
|
+
# wrong site.
|
|
159
|
+
#
|
|
160
|
+
# Cost note: editing scope: (per or files) changes the input hash for
|
|
161
|
+
# every pair of this aspect — every node using the aspect needs
|
|
162
|
+
# re-verification. Run `yg impact --aspect <id>` before widening or
|
|
163
|
+
# narrowing the filter.
|
|
164
|
+
#
|
|
165
|
+
# Example:
|
|
166
|
+
# scope:
|
|
167
|
+
# per: file
|
|
168
|
+
# files:
|
|
169
|
+
# all_of:
|
|
170
|
+
# - path: "src/**/*.ts"
|
|
171
|
+
# - not: { path: "**/*.test.ts" }
|
|
172
|
+
|
|
119
173
|
# references: # optional — supporting files for the LLM reviewer.
|
|
120
174
|
# Permitted on LLM aspects ONLY (forbidden on deterministic).
|
|
121
175
|
# Each entry is a string (shorthand) OR an object { path, description? }.
|
|
@@ -7,9 +7,8 @@ version: "5.0.0" # managed by CLI — do not edit manually. Tra
|
|
|
7
7
|
|
|
8
8
|
quality: # optional — quality thresholds
|
|
9
9
|
max_direct_relations: 10 # maximum outgoing relations per node (warning if above)
|
|
10
|
-
max_node_chars: 40000 # per-node character budget — mapped source + aspect reference files (error if above; binaries skipped; opt out per-node via sizeExempt)
|
|
11
10
|
|
|
12
|
-
parallel: 1 # optional — concurrency limit for
|
|
11
|
+
parallel: 1 # optional — concurrency limit for the yg check --approve fill (positive integer, default: 1)
|
|
13
12
|
|
|
14
13
|
debug: false # optional — when true, appends all command output to .yggdrasil/.debug.log
|
|
15
14
|
# Default: false (off). Log is append-only; rotate or delete manually.
|
|
@@ -20,7 +19,7 @@ coverage: # optional — scopes the unmapped-files gate.
|
|
|
20
19
|
# Files outside required and excluded are a non-blocking WARNING.
|
|
21
20
|
# Subtrees containing their own nested .yggdrasil/ are auto-skipped by every check.
|
|
22
21
|
|
|
23
|
-
reviewer: # required — aspect verification during yg approve
|
|
22
|
+
reviewer: # required — aspect verification during yg check --approve
|
|
24
23
|
default: standard # required when more than one tier is configured; optional with exactly one tier.
|
|
25
24
|
# Must reference one of the keys under reviewer.tiers.
|
|
26
25
|
tiers: # required — named tier configurations, minimum one entry.
|
|
@@ -32,12 +31,13 @@ reviewer: # required — aspect verification during yg a
|
|
|
32
31
|
model: "qwen3.5:9b" # model id
|
|
33
32
|
endpoint: "http://localhost:11434" # custom endpoint (required for ollama, openai-compatible)
|
|
34
33
|
temperature: 0 # reduces variability — keep at 0
|
|
35
|
-
max_tokens: auto # auto = query provider, or explicit positive integer
|
|
36
|
-
context_length_field: "" # ollama: model_info key for context window size
|
|
37
34
|
# timeout: 300 # Per-call timeout in SECONDS (default 300). Only CLI providers.
|
|
38
|
-
#
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
# max_prompt_chars: 200000 # optional — assembled reviewer-prompt character cap (positive integer).
|
|
36
|
+
# Checked deterministically before the LLM call. Absent = unlimited.
|
|
37
|
+
# Exceeding this limit renders a blocking error naming remedies
|
|
38
|
+
# (split the node, shorten references, or raise the cap).
|
|
39
|
+
# Never participates in verdict identity — tuning it does not
|
|
40
|
+
# invalidate recorded baselines.
|
|
41
41
|
# Add more tiers as needed (e.g. a `deep` tier with a higher-capability model for critical aspects).
|
|
42
42
|
# An aspect references a non-default tier via:
|
|
43
43
|
#
|
|
@@ -29,6 +29,11 @@ ports: # optional — named entry points with required as
|
|
|
29
29
|
when: <predicate> # optional — object form with per-attach applicability filter
|
|
30
30
|
|
|
31
31
|
relations: # optional — outgoing dependencies to other nodes
|
|
32
|
+
# Load-bearing, not just documentation: a built-in deterministic check
|
|
33
|
+
# parses this node's mapped code and REFUSES it (relation-undeclared-dependency,
|
|
34
|
+
# always an error) if it depends on another mapped node without a relation here.
|
|
35
|
+
# One-directional — a declared relation needs no code behind it. See
|
|
36
|
+
# `yg knowledge read ports-and-relations`.
|
|
32
37
|
- target: other/module-path # required — node path relative to model/
|
|
33
38
|
type: calls # required — calls | uses | extends | implements | emits | listens
|
|
34
39
|
consumes: [port-name] # optional — port names consumed from target
|
|
@@ -43,9 +48,3 @@ mapping: # optional — source files and directories owned
|
|
|
43
48
|
# paths are relative to repository root
|
|
44
49
|
# each source file must have exactly one owner node
|
|
45
50
|
|
|
46
|
-
sizeExempt: # optional — opt out of the per-node character budget (quality.max_node_chars)
|
|
47
|
-
reason: "package-lock.json is npm-generated and cannot be split" # required — non-empty justification
|
|
48
|
-
# Binary files (images, fonts, archives, etc.) count 0 toward the budget
|
|
49
|
-
# automatically — they never need sizeExempt. Use sizeExempt ONLY for a
|
|
50
|
-
# large unsplittable TEXT artifact (e.g. a generated lockfile), not images.
|
|
51
|
-
# Normal oversized nodes must be split.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrisdudek/yg",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.6",
|
|
4
4
|
"description": "Architecture rules your coding agent can't ignore. Written in Markdown, verified on every change, enforced in the agent's loop — not after on a PR. Works with Claude Code, Cursor, Copilot, Codex, Cline.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -107,5 +107,8 @@
|
|
|
107
107
|
"typescript": "^6.0.3",
|
|
108
108
|
"typescript-eslint": "^8.60.0",
|
|
109
109
|
"vitest": "^4.1.8"
|
|
110
|
+
},
|
|
111
|
+
"overrides": {
|
|
112
|
+
"esbuild": "^0.28.1"
|
|
110
113
|
}
|
|
111
114
|
}
|