easy-coding-harness 1.1.0-beta.2 → 1.1.0-beta.4

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.
@@ -9,6 +9,7 @@ from pathlib import Path
9
9
  from typing import Any, Iterable
10
10
 
11
11
  from easy_dev_spec_protocol import SCHEMA, select_scope, validate_spec
12
+ from easy_coding_operation import memo
12
13
 
13
14
 
14
15
  UPSTREAM_PROTOCOL_COMMIT = "8239a5befae08b41da43b7cfbf41acf07e487d04"
@@ -29,10 +30,10 @@ def _read_spec(
29
30
  raise EasyDevSpecError(f"Spec file does not exist: {path}")
30
31
  try:
31
32
  text = path.read_text(encoding="utf-8")
32
- report = validate_spec(
33
- text,
34
- require_ready=require_ready,
35
- require_execution=require_execution,
33
+ report = memo(
34
+ ("spec-validation", text, require_ready, require_execution),
35
+ lambda: validate_spec(text, require_ready=require_ready,
36
+ require_execution=require_execution),
36
37
  )
37
38
  except (OSError, UnicodeError) as exc:
38
39
  raise EasyDevSpecError(f"Cannot read Spec as UTF-8: {path}: {exc}") from exc
@@ -4,7 +4,8 @@ import os
4
4
  from pathlib import Path
5
5
  import sys
6
6
 
7
- from easy_coding_state import detect_runtime_agent, ensure_hook_session, snapshot_state
7
+ from easy_coding_operation import evidence_operation
8
+
8
9
 
9
10
 
10
11
  def configure_stdio() -> None:
@@ -44,6 +45,7 @@ def emit(event_name: str, context: str) -> None:
44
45
  )
45
46
 
46
47
 
48
+ @evidence_operation()
47
49
  def main() -> int:
48
50
  configure_stdio()
49
51
  if os.environ.get("EC_HOOKS") == "0":
@@ -54,6 +56,9 @@ def main() -> int:
54
56
  if root is None:
55
57
  return 0
56
58
 
59
+ from easy_coding_store import detect_runtime_agent, ensure_hook_session
60
+ from easy_coding_status import snapshot_state
61
+
57
62
  agent = detect_runtime_agent()
58
63
  session, session_path = ensure_hook_session(root, payload, agent)
59
64
  if session and session.get("harness_disabled") is True:
@@ -4,8 +4,8 @@ import os
4
4
  from pathlib import Path
5
5
  import sys
6
6
 
7
- from easy_coding_state import detect_runtime_agent, ensure_hook_session
8
- from easy_coding_status import build_status_context
7
+ from easy_coding_operation import evidence_operation
8
+
9
9
 
10
10
 
11
11
  def configure_stdio() -> None:
@@ -45,6 +45,7 @@ def emit(event_name: str, context: str) -> None:
45
45
  )
46
46
 
47
47
 
48
+ @evidence_operation()
48
49
  def main() -> int:
49
50
  configure_stdio()
50
51
  if os.environ.get("EC_HOOKS") == "0":
@@ -56,6 +57,9 @@ def main() -> int:
56
57
  return 0
57
58
 
58
59
  event_name = payload.get("hook_event_name") or payload.get("hookEventName") or "UserPromptSubmit"
60
+ from easy_coding_store import detect_runtime_agent, ensure_hook_session
61
+ from easy_coding_status import build_status_context
62
+
59
63
  agent = detect_runtime_agent()
60
64
  session, session_path = ensure_hook_session(root, payload, agent)
61
65
  emit(event_name, build_status_context(root, session, agent, session_path))
@@ -4,8 +4,8 @@ import os
4
4
  from pathlib import Path
5
5
  import sys
6
6
 
7
- from easy_coding_state import detect_runtime_agent, ensure_hook_session
8
- from easy_coding_status import build_status_context
7
+ from easy_coding_operation import evidence_operation
8
+
9
9
 
10
10
 
11
11
  def configure_stdio() -> None:
@@ -45,6 +45,7 @@ def emit(event_name: str, context: str) -> None:
45
45
  )
46
46
 
47
47
 
48
+ @evidence_operation()
48
49
  def main() -> int:
49
50
  configure_stdio()
50
51
  if os.environ.get("EC_HOOKS") == "0":
@@ -55,6 +56,9 @@ def main() -> int:
55
56
  if root is None:
56
57
  return 0
57
58
 
59
+ from easy_coding_store import detect_runtime_agent, ensure_hook_session
60
+ from easy_coding_status import build_status_context
61
+
58
62
  agent = detect_runtime_agent()
59
63
  event_name = payload.get("hook_event_name") or payload.get("hookEventName") or "SessionStart"
60
64
  session, session_path = ensure_hook_session(root, payload, agent)