@chrisdudek/yg 5.0.0-alpha.3 → 5.0.0-alpha.5

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.
@@ -10,7 +10,7 @@
10
10
  node_types:
11
11
  <type-id>:
12
12
  description: <string> # required — what this type is for, when to use it.
13
- # Validator emits description-missing if absent.
13
+ # absence is a FATAL architecture-invalid error (the whole type system is rejected).
14
14
 
15
15
  when: <file-predicate> # optional — per-file classification.
16
16
  # Types WITH `when` are file-classifying: every file in
@@ -38,9 +38,14 @@ node_types:
38
38
  # Use only for types where missing the type means missing
39
39
  # a critical aspect (security, audit, regulatory).
40
40
 
41
- log_required: <boolean> # optional — default true. Set false for infrastructure
42
- # or utility types where an approval log adds no value
43
- # (e.g. config, types, constants).
41
+ log_required: <boolean> # optional — default false. Enable (true) on types whose
42
+ # changes carry business intent worth capturing domain
43
+ # logic, command handlers, persistence adapters. When true,
44
+ # a node of this type demands a fresh log entry before
45
+ # `yg check --approve` whenever its mapped source changed
46
+ # since the node's last positive closure. Leave omitted
47
+ # (false) for types whose changes carry no business decision
48
+ # worth forcing an entry for (e.g. config, types, constants).
44
49
 
45
50
  aspects: # optional — aspects automatically applied to every
46
51
  # node of this type (channel 3). Two forms per entry:
@@ -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,7 +7,6 @@ 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
11
  parallel: 1 # optional — concurrency limit for batch approve (positive integer, default: 1)
13
12
 
@@ -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.
@@ -35,9 +34,12 @@ reviewer: # required — aspect verification during yg a
35
34
  max_tokens: auto # auto = query provider, or explicit positive integer
36
35
  context_length_field: "" # ollama: model_info key for context window size
37
36
  # timeout: 300 # Per-call timeout in SECONDS (default 300). Only CLI providers.
38
- # references: # optional — limits on aspect reference files for aspects resolving to this tier
39
- # max_bytes_per_file: 65536 # positive integer; default 65536 (64 KiB)
40
- # max_total_bytes_per_aspect: 262144 # positive integer; default 262144 (256 KiB)
37
+ # max_prompt_chars: 200000 # optional — assembled reviewer-prompt character cap (positive integer).
38
+ # Checked deterministically before the LLM call. Absent = unlimited.
39
+ # Exceeding this limit renders a blocking error naming remedies
40
+ # (split the node, shorten references, or raise the cap).
41
+ # Never participates in verdict identity — tuning it does not
42
+ # invalidate recorded baselines.
41
43
  # Add more tiers as needed (e.g. a `deep` tier with a higher-capability model for critical aspects).
42
44
  # An aspect references a non-default tier via:
43
45
  #
@@ -43,9 +43,3 @@ mapping: # optional — source files and directories owned
43
43
  # paths are relative to repository root
44
44
  # each source file must have exactly one owner node
45
45
 
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",
3
+ "version": "5.0.0-alpha.5",
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": {