agent-sdlc 0.5.2__tar.gz → 0.5.3__tar.gz

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.
Files changed (43) hide show
  1. {agent_sdlc-0.5.2/agent_sdlc.egg-info → agent_sdlc-0.5.3}/PKG-INFO +1 -1
  2. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3/agent_sdlc.egg-info}/PKG-INFO +1 -1
  3. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/__init__.py +1 -1
  4. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/cli.py +3 -0
  5. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/coverage_map.py +55 -7
  6. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/LICENSE +0 -0
  7. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/NOTICE.md +0 -0
  8. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/README.md +0 -0
  9. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/agent_sdlc.egg-info/SOURCES.txt +0 -0
  10. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/agent_sdlc.egg-info/dependency_links.txt +0 -0
  11. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/agent_sdlc.egg-info/entry_points.txt +0 -0
  12. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/agent_sdlc.egg-info/requires.txt +0 -0
  13. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/agent_sdlc.egg-info/top_level.txt +0 -0
  14. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/adversary.py +0 -0
  15. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/commit_msg.py +0 -0
  16. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/diff_discipline.py +0 -0
  17. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/host_exec.py +0 -0
  18. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/model_vv.py +0 -0
  19. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/mutants.py +0 -0
  20. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/no_comments.py +0 -0
  21. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/no_leaks.py +0 -0
  22. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/no_new_docs.py +0 -0
  23. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/repo.py +0 -0
  24. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/rules.py +0 -0
  25. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/runner.py +0 -0
  26. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/token.py +0 -0
  27. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/vocabulary.py +0 -0
  28. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/vocabulary_check.py +0 -0
  29. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/vocabulary_core.toml +0 -0
  30. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/vocabulary_molds.py +0 -0
  31. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/vocabulary_path.py +0 -0
  32. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/vocabulary_wordnet.py +0 -0
  33. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/mutation_gate/waivers.py +0 -0
  34. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/pyproject.toml +0 -0
  35. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/rules/code-clarity.md +0 -0
  36. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/rules/diff-discipline.md +0 -0
  37. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/rules/model-vv.md +0 -0
  38. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/rules/naming.md +0 -0
  39. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/rules/testing.md +0 -0
  40. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/rules/tickets.md +0 -0
  41. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/rules/voice.md +0 -0
  42. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/setup.cfg +0 -0
  43. {agent_sdlc-0.5.2 → agent_sdlc-0.5.3}/tests/test_say_narrate_bin.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent-sdlc
3
- Version: 0.5.2
3
+ Version: 0.5.3
4
4
  Summary: Diff-scoped mutation gate for pre-commit and agent Stop hooks
5
5
  License-Expression: MIT
6
6
  Project-URL: Homepage, https://github.com/PavelGuzenfeld/agent-sdlc
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agent-sdlc
3
- Version: 0.5.2
3
+ Version: 0.5.3
4
4
  Summary: Diff-scoped mutation gate for pre-commit and agent Stop hooks
5
5
  License-Expression: MIT
6
6
  Project-URL: Homepage, https://github.com/PavelGuzenfeld/agent-sdlc
@@ -1,3 +1,3 @@
1
1
  """Diff-scoped mutation gate. Spec: PavelGuzenfeld/dotfiles#9."""
2
2
 
3
- __version__ = "0.5.2"
3
+ __version__ = "0.5.3"
@@ -115,6 +115,9 @@ def _gate_file(
115
115
  token.write(repo, rel, fp, "uncovered-waived")
116
116
  return False, [], []
117
117
  _emit(f" {rel}: BLOCKED — no covering tests")
118
+ if rel.endswith(coverage_map.CPP_SUFFIXES):
119
+ setting = "[languages.cpp] test_globs" if "cpp" in repo.config.languages else "test_globs"
120
+ _emit(f" existing tests that cover it: add their paths to {setting} in {CONFIG_NAME}")
118
121
  _emit(" add to " + str(waivers.path(repo)) + ":")
119
122
  _emit(" " + waivers.suggest_uncovered(rel).replace("\n", "\n "))
120
123
  return True, [], []
@@ -9,6 +9,7 @@ from __future__ import annotations
9
9
 
10
10
  import ast
11
11
  import json
12
+ import re
12
13
  import shlex
13
14
  import sqlite3
14
15
  import time
@@ -152,13 +153,57 @@ def _ts_test_files(repo: Repo) -> list[Path]:
152
153
  return sorted(set(out))
153
154
 
154
155
 
155
- def _by_name(repo: Repo, target: str) -> list[Path]:
156
- """GDScript has no coverage tool, so the name convention is the only signal
157
- narrower than the whole suite."""
156
+ def _godot_project_root(repo: Repo, target: str) -> Path:
157
+ for parent in (repo.root / target).parents:
158
+ if (parent / "project.godot").is_file() or parent == repo.root:
159
+ return parent
160
+ return repo.root
161
+
162
+
163
+ _QUOTED_RESOURCE = re.compile(r"[\"']([^\"'\n]+\.(?:gd|tscn))[\"']")
164
+ _AUTOLOAD_ENTRY = re.compile(r"^(\w+)=\"\*?res://([^\"]+)\"", re.M)
165
+
166
+
167
+ def _resource_paths(project: Path, source: Path) -> set[Path]:
168
+ """`res://` resolves against project.godot's directory, a bare path against `source`'s."""
169
+ return {((project / quoted.removeprefix("res://")) if quoted.startswith("res://")
170
+ else (source.parent / quoted)).resolve()
171
+ for quoted in _QUOTED_RESOURCE.findall(source.read_text())}
172
+
173
+
174
+ def _global_names(project: Path, reached: set[Path]) -> re.Pattern[str] | None:
175
+ """A `class_name` or an autoload reaches a script with no path in the caller."""
176
+ names = {declared.group(1) for script in reached if script.suffix == ".gd"
177
+ if (declared := re.search(r"^class_name\s+(\w+)", script.read_text(), re.M))}
178
+ settings = project / "project.godot"
179
+ if settings.is_file():
180
+ autoloads = settings.read_text().partition("[autoload]")[2].split("\n[", 1)[0]
181
+ names |= {name for name, path in _AUTOLOAD_ENTRY.findall(autoloads)
182
+ if (project / path).resolve() in reached}
183
+ return re.compile("|".join(rf"\b{name}\b" for name in sorted(names))) if names else None
184
+
185
+
186
+ def _reaches(project: Path, source: Path, reached: set[Path]) -> bool:
187
+ names = _global_names(project, reached)
188
+ return bool(_resource_paths(project, source) & reached) or bool(
189
+ names and names.search(source.read_text()))
190
+
191
+
192
+ def _gdscript_candidates(repo: Repo, target: str) -> list[Path]:
193
+ """No coverage tool: a test is named after the target or reaches it. A scene
194
+ attaching the target counts as the target; other hops count against closure_depth."""
158
195
  tests = _test_files(repo, "gdscript", ".gd")
196
+ project = _godot_project_root(repo, target)
197
+ scenes = sorted(project.rglob("*.tscn"))
198
+ reached = {(repo.root / target).resolve()}
199
+ reached |= {s.resolve() for s in scenes if _resource_paths(project, s) & reached}
200
+ sources = [f for f in sorted(project.rglob("*.gd")) + scenes if f not in tests]
201
+ for _ in range(max(1, repo.config.closure_depth) - 1):
202
+ reached |= {f.resolve() for f in sources if _reaches(project, f, reached)}
159
203
  stem = Path(target).stem
160
- named = [t for t in tests if t.stem in (f"{stem}_test", f"test_{stem}")]
161
- return named or tests
204
+ hits = [t for t in tests
205
+ if t.stem in (f"{stem}_test", f"test_{stem}") or _reaches(project, t, reached)]
206
+ return hits or tests
162
207
 
163
208
 
164
209
  def candidates(repo: Repo, target: str) -> list[Path]:
@@ -175,11 +220,14 @@ def candidates(repo: Repo, target: str) -> list[Path]:
175
220
  tests. Documented caveat of decision 26, not a defect.
176
221
  """
177
222
  if target.endswith(".gd"):
178
- return _by_name(repo, target)
223
+ return _gdscript_candidates(repo, target)
179
224
  if target.endswith(CPP_SUFFIXES):
180
225
  # Whole suite, no narrowing: a compiled C++ suite runs in seconds, so a
181
226
  # name or include heuristic buys nothing and a miss is a false SURVIVED.
182
- return _test_files(repo, "cpp", ".cpp")
227
+ return sorted(
228
+ {repo.root / rel for rel in repo.glob_tests("cpp")}
229
+ | set(_test_files(repo, "cpp", ".cpp"))
230
+ )
183
231
  if target.endswith(TS_SUFFIXES):
184
232
  # Same reasoning as C++: a vitest suite this fast (debris-scatter's 125
185
233
  # tests run in well under a second) makes narrowing not worth building,
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes