@jesdi/skills 0.0.48 → 0.0.49

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jesdi/skills",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "description": "jesdi's agent skills (content package consumed by @jesdi/skills-cli)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -27,9 +27,16 @@ def _git(repo: str, *args: str, end: str = "\n") -> list[str]:
27
27
  return [line for line in out.split(end) if line]
28
28
 
29
29
 
30
+ def _squash(text: str) -> str:
31
+ """Each run of whitespace other than a line break as one space."""
32
+ return re.sub(r"[^\S\n]+", " ", text)
33
+
34
+
30
35
  def _seen(line: str, log: str) -> bool:
31
- # A stream-json log holds tool output as JSON strings, so the escaped form of the line counts too.
32
- return line in log or json.dumps(line)[1:-1] in log
36
+ # A stream-json log holds tool output as JSON strings, so the escaped forms of the line count too: json.dumps
37
+ # escapes non-ASCII, the claude log keeps it raw. Spacing does not count: pytest pads some lines.
38
+ line, log = _squash(line.strip()), _squash(log)
39
+ return any(form in log for form in (line, json.dumps(line)[1:-1], json.dumps(line, ensure_ascii=False)[1:-1]))
33
40
 
34
41
 
35
42
  def _shas(report: dict) -> list[str]:
@@ -89,10 +96,11 @@ def _merged_errors(report: dict, context: dict) -> list[str]:
89
96
 
90
97
  def _proof_errors(report: dict, context: dict) -> list[str]:
91
98
  """Every claimed red line (a test-writer `red`, a reviewer `mutations`) is in the agent's log."""
92
- lines = [r["line"] for r in report.get("red", [])] + [m["red"] for m in report.get("mutations", [])]
93
- errors = []
94
- if lines and not all(_seen(line, Path(context["log"]).read_text(errors="replace")) for line in lines):
95
- errors.append(RED)
99
+ lines = ([(r["test"], r["line"]) for r in report.get("red", [])]
100
+ + [(m["test"], m["red"]) for m in report.get("mutations", [])])
101
+ log = Path(context["log"]).read_text(errors="replace") if lines else ""
102
+ errors = [f"{RED}: {test}: {line if len(line) <= 200 else line[:197] + '...'}"
103
+ for test, line in lines if not _seen(line, log)]
96
104
  if context.get("full") and "findings" in report and "mutations" not in report:
97
105
  errors.append("mutations: required in a full review")
98
106
  return errors
@@ -324,6 +324,7 @@ def test_red_line_missing_from_the_log_reruns_once_then_blocks(env, second_match
324
324
  proc = w.run(plan)
325
325
  second = w.calls("test-writer")[1]["prompt"]
326
326
  assert "red line not found in log" in second and "red line not found" not in w.calls("test-writer")[0]["prompt"]
327
+ assert f"red line not found in log: tests/test_export.py::test_rows: {RED}" in second
327
328
  if second_matches:
328
329
  ok(proc)
329
330
  assert len(w.calls("implementer")) == 1
@@ -333,6 +334,17 @@ def test_red_line_missing_from_the_log_reruns_once_then_blocks(env, second_match
333
334
  assert any("01" in l and "BLOCKED" in l for l in w.ledger().splitlines()), w.ledger()
334
335
 
335
336
 
337
+ @pytest.mark.parametrize("claimed, printed", [
338
+ ("E assert 0 == 'rows'", "E assert 0 == 'rows'"), # pytest pads a parametrized test's lines
339
+ ("AssertionError: '12 UNP\u2212 EL' !~ /Resilience\\s*4\\.3/", # a stream-json log keeps non-ASCII raw
340
+ '"text": "AssertionError: \'12 UNP\u2212 EL\' !~ /Resilience\\\\s*4\\\\.3/"')], ids=["spacing", "non-ascii"])
341
+ def test_red_line_that_differs_from_the_log_only_in_spacing_or_escaping_is_seen(env, claimed, printed):
342
+ w = World(env)
343
+ writer = with_report(tw(0, printed + "\n"), red=[{"test": "tests/test_export.py::test_rows", "line": claimed}])
344
+ ok(w.run({"test-writer": [writer], "implementer": [impl()]}))
345
+ assert len(w.calls("test-writer")) == 1
346
+
347
+
336
348
  def test_implementer_report_with_no_new_commit_is_a_violation(env):
337
349
  w = World(env)
338
350
  nothing = with_report(impl(), commits=[])
@@ -146,7 +146,8 @@ def test_red_line_absent_from_the_log_is_a_violation(world):
146
146
  shas, check, _ = world
147
147
  assert check("test-writer", writer(shas), start=shas["base"]) == []
148
148
  report = writer(shas, red=[{"test": "t", "line": "FAILED tests/test_export.py::test_rows - KeyError"}])
149
- assert "red line not found in log" in check("test-writer", report, start=shas["base"])
149
+ assert check("test-writer", report, start=shas["base"]) == [
150
+ "red line not found in log: t: FAILED tests/test_export.py::test_rows - KeyError"]
150
151
 
151
152
 
152
153
  def test_reviewer_fields_and_mutation_proofs(world):
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-10-17T23:11:17.693Z",
3
+ "generatedAt": "2026-10-18T20:38:07.695Z",
4
4
  "skills": [
5
5
  {
6
6
  "name": "backlog",
@@ -46,8 +46,8 @@
46
46
  },
47
47
  {
48
48
  "name": "implement-spec",
49
- "version": "0.1.24",
50
- "hash": "sha256-8df47be43b54ab8ced155594ab3dfa0c23a27960597774d7868ca4e444ab817a",
49
+ "version": "0.1.25",
50
+ "hash": "sha256-644814949264c14d8ce10419e2b71af1c6f00e872c328ff31e47b4441eac5365",
51
51
  "description": "Implement a specification in code."
52
52
  },
53
53
  {