@chrisdudek/yg 5.2.5 → 5.3.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.
@@ -185,6 +185,8 @@ interface YggConfig {
185
185
  reviewer?: ReviewerConfig;
186
186
  parallel?: number;
187
187
  debug?: boolean;
188
+ /** Controls what bare `yg check` does: false = read-only; 'deterministic' = free local fill; 'full' = full reviewer fill. */
189
+ auto_approve?: 'deterministic' | 'full' | false;
188
190
  /** Coverage scope. Absent ⇒ DEFAULT_COVERAGE (whole repo required = today's behavior). */
189
191
  coverage?: CoverageConfig;
190
192
  }
package/dist/structure.js CHANGED
@@ -606,6 +606,14 @@ async function parseFile(filePath, content) {
606
606
  }
607
607
  return tree;
608
608
  }
609
+ async function withParsedFile(filePath, content, fn) {
610
+ const tree = await parseFile(filePath, content);
611
+ try {
612
+ return await fn(tree);
613
+ } finally {
614
+ tree.delete();
615
+ }
616
+ }
609
617
 
610
618
  // src/structure/ctx-parsers.ts
611
619
  var ParseAstNotPrewarmedError = class extends Error {
@@ -1599,13 +1607,12 @@ async function resolveSuppressedRangesForPrompt(subjects, aspectId) {
1599
1607
  for (const subject of subjects) {
1600
1608
  const content = subject.bytes.toString("utf8");
1601
1609
  const hasGrammar = getLanguageForExtension(extname5(subject.path).toLowerCase()) !== null;
1602
- let tree;
1603
- if (hasGrammar) {
1604
- tree = await parseFile(subject.path, content);
1605
- }
1606
1610
  const totalLines = content.split("\n").length;
1607
- const all = collectSuppressions(tree, subject.path, totalLines, content);
1608
- tree?.delete();
1611
+ const all = hasGrammar ? await withParsedFile(
1612
+ subject.path,
1613
+ content,
1614
+ (tree) => collectSuppressions(tree, subject.path, totalLines, content)
1615
+ ) : collectSuppressions(void 0, subject.path, totalLines, content);
1609
1616
  const ranges = formatSuppressedRangesForAspect(all, aspectId);
1610
1617
  if (ranges.length > 0) {
1611
1618
  byFile.push({ path: subject.path, ranges });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrisdudek/yg",
3
- "version": "5.2.5",
3
+ "version": "5.3.0",
4
4
  "description": "Architecture rules your AI coding agent can't ignore. It gets the rules for a file before it edits, and every change is checked — by a free local script or an LLM reviewer — before it moves on. Works with Claude Code, Cursor, Copilot, Codex, Cline.",
5
5
  "type": "module",
6
6
  "bin": {