arkaos 4.1.0 → 4.1.1

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 (122) hide show
  1. package/VERSION +1 -1
  2. package/config/hooks/post-tool-use.sh +16 -1
  3. package/config/hooks/pre-tool-use.sh +16 -1
  4. package/config/hooks/stop.sh +16 -1
  5. package/config/hooks/user-prompt-submit.sh +16 -1
  6. package/core/__pycache__/__init__.cpython-314.pyc +0 -0
  7. package/core/cognition/__pycache__/dreaming.cpython-313.pyc +0 -0
  8. package/core/cognition/scheduler/__pycache__/daemon.cpython-313.pyc +0 -0
  9. package/core/forge/__pycache__/__init__.cpython-313.pyc +0 -0
  10. package/core/forge/__pycache__/orchestrator.cpython-313.pyc +0 -0
  11. package/core/forge/__pycache__/persistence.cpython-313.pyc +0 -0
  12. package/core/forge/__pycache__/renderer.cpython-313.pyc +0 -0
  13. package/core/forge/__pycache__/runtime_dispatcher.cpython-313.pyc +0 -0
  14. package/core/forge/__pycache__/schema.cpython-313.pyc +0 -0
  15. package/core/governance/__pycache__/__init__.cpython-314.pyc +0 -0
  16. package/core/governance/__pycache__/closing_marker_check.cpython-313.pyc +0 -0
  17. package/core/governance/__pycache__/closing_marker_check.cpython-314.pyc +0 -0
  18. package/core/governance/__pycache__/compliance_telemetry.cpython-313.pyc +0 -0
  19. package/core/governance/__pycache__/constitution.cpython-314.pyc +0 -0
  20. package/core/governance/__pycache__/evidence_checks.cpython-313.pyc +0 -0
  21. package/core/governance/__pycache__/kb_cite_check.cpython-314.pyc +0 -0
  22. package/core/governance/__pycache__/meta_tag_check.cpython-313.pyc +0 -0
  23. package/core/governance/__pycache__/meta_tag_check.cpython-314.pyc +0 -0
  24. package/core/governance/__pycache__/qg_verdict.cpython-313.pyc +0 -0
  25. package/core/governance/__pycache__/review_workflow.cpython-313.pyc +0 -0
  26. package/core/governance/__pycache__/skill_proposer.cpython-313.pyc +0 -0
  27. package/core/governance/__pycache__/skill_proposer.cpython-314.pyc +0 -0
  28. package/core/governance/__pycache__/sycophancy_detector.cpython-314.pyc +0 -0
  29. package/core/hooks/__pycache__/__init__.cpython-312.pyc +0 -0
  30. package/core/hooks/__pycache__/__init__.cpython-313.pyc +0 -0
  31. package/core/hooks/__pycache__/__init__.cpython-314.pyc +0 -0
  32. package/core/hooks/__pycache__/_shared.cpython-312.pyc +0 -0
  33. package/core/hooks/__pycache__/_shared.cpython-313.pyc +0 -0
  34. package/core/hooks/__pycache__/_shared.cpython-314.pyc +0 -0
  35. package/core/hooks/__pycache__/post_tool_use.cpython-312.pyc +0 -0
  36. package/core/hooks/__pycache__/post_tool_use.cpython-313.pyc +0 -0
  37. package/core/hooks/__pycache__/pre_tool_use.cpython-312.pyc +0 -0
  38. package/core/hooks/__pycache__/pre_tool_use.cpython-313.pyc +0 -0
  39. package/core/hooks/__pycache__/pre_tool_use.cpython-314.pyc +0 -0
  40. package/core/hooks/__pycache__/stop.cpython-312.pyc +0 -0
  41. package/core/hooks/__pycache__/stop.cpython-313.pyc +0 -0
  42. package/core/hooks/__pycache__/stop.cpython-314.pyc +0 -0
  43. package/core/hooks/__pycache__/user_prompt_submit.cpython-313.pyc +0 -0
  44. package/core/jobs/__pycache__/__init__.cpython-314.pyc +0 -0
  45. package/core/jobs/__pycache__/auto_doc_worker.cpython-314.pyc +0 -0
  46. package/core/jobs/__pycache__/manager.cpython-314.pyc +0 -0
  47. package/core/knowledge/__pycache__/embedder.cpython-312.pyc +0 -0
  48. package/core/knowledge/__pycache__/embedder.cpython-313.pyc +0 -0
  49. package/core/knowledge/__pycache__/vector_store.cpython-312.pyc +0 -0
  50. package/core/knowledge/__pycache__/vector_store.cpython-313.pyc +0 -0
  51. package/core/memory/__pycache__/session_store.cpython-314.pyc +0 -0
  52. package/core/obsidian/__pycache__/relator.cpython-313.pyc +0 -0
  53. package/core/obsidian/relator.py +18 -8
  54. package/core/runtime/__pycache__/__init__.cpython-314.pyc +0 -0
  55. package/core/runtime/__pycache__/base.cpython-312.pyc +0 -0
  56. package/core/runtime/__pycache__/base.cpython-313.pyc +0 -0
  57. package/core/runtime/__pycache__/base.cpython-314.pyc +0 -0
  58. package/core/runtime/__pycache__/capabilities_cli.cpython-313.pyc +0 -0
  59. package/core/runtime/__pycache__/claude_code.cpython-312.pyc +0 -0
  60. package/core/runtime/__pycache__/claude_code.cpython-313.pyc +0 -0
  61. package/core/runtime/__pycache__/claude_code.cpython-314.pyc +0 -0
  62. package/core/runtime/__pycache__/codex_cli.cpython-312.pyc +0 -0
  63. package/core/runtime/__pycache__/codex_cli.cpython-313.pyc +0 -0
  64. package/core/runtime/__pycache__/codex_cli.cpython-314.pyc +0 -0
  65. package/core/runtime/__pycache__/cost_governor.cpython-313.pyc +0 -0
  66. package/core/runtime/__pycache__/cursor.cpython-312.pyc +0 -0
  67. package/core/runtime/__pycache__/cursor.cpython-313.pyc +0 -0
  68. package/core/runtime/__pycache__/cursor.cpython-314.pyc +0 -0
  69. package/core/runtime/__pycache__/gemini_cli.cpython-312.pyc +0 -0
  70. package/core/runtime/__pycache__/gemini_cli.cpython-313.pyc +0 -0
  71. package/core/runtime/__pycache__/gemini_cli.cpython-314.pyc +0 -0
  72. package/core/runtime/__pycache__/llm_cost_telemetry.cpython-314.pyc +0 -0
  73. package/core/runtime/__pycache__/llm_provider.cpython-312.pyc +0 -0
  74. package/core/runtime/__pycache__/llm_provider.cpython-313.pyc +0 -0
  75. package/core/runtime/__pycache__/llm_provider.cpython-314.pyc +0 -0
  76. package/core/runtime/__pycache__/llm_retry.cpython-312.pyc +0 -0
  77. package/core/runtime/__pycache__/llm_retry.cpython-313.pyc +0 -0
  78. package/core/runtime/__pycache__/llm_retry.cpython-314.pyc +0 -0
  79. package/core/runtime/__pycache__/native_usage.cpython-312.pyc +0 -0
  80. package/core/runtime/__pycache__/native_usage.cpython-313.pyc +0 -0
  81. package/core/runtime/__pycache__/native_usage.cpython-314.pyc +0 -0
  82. package/core/runtime/__pycache__/ollama_provider.cpython-314.pyc +0 -0
  83. package/core/runtime/__pycache__/pricing.cpython-312.pyc +0 -0
  84. package/core/runtime/__pycache__/pricing.cpython-313.pyc +0 -0
  85. package/core/runtime/__pycache__/pricing.cpython-314.pyc +0 -0
  86. package/core/runtime/__pycache__/registry.cpython-312.pyc +0 -0
  87. package/core/runtime/__pycache__/registry.cpython-313.pyc +0 -0
  88. package/core/runtime/__pycache__/registry.cpython-314.pyc +0 -0
  89. package/core/shared/__pycache__/__init__.cpython-314.pyc +0 -0
  90. package/core/shared/__pycache__/safe_session_id.cpython-314.pyc +0 -0
  91. package/core/shared/__pycache__/test_evidence.cpython-313-pytest-9.1.1.pyc +0 -0
  92. package/core/shared/__pycache__/test_evidence.cpython-313.pyc +0 -0
  93. package/core/synapse/__pycache__/__init__.cpython-314.pyc +0 -0
  94. package/core/synapse/__pycache__/cache.cpython-314.pyc +0 -0
  95. package/core/synapse/__pycache__/engine.cpython-312.pyc +0 -0
  96. package/core/synapse/__pycache__/engine.cpython-313.pyc +0 -0
  97. package/core/synapse/__pycache__/engine.cpython-314.pyc +0 -0
  98. package/core/synapse/__pycache__/graph_context_layer.cpython-313.pyc +0 -0
  99. package/core/synapse/__pycache__/kb_cache.cpython-312.pyc +0 -0
  100. package/core/synapse/__pycache__/kb_cache.cpython-313.pyc +0 -0
  101. package/core/synapse/__pycache__/kb_cache.cpython-314.pyc +0 -0
  102. package/core/synapse/__pycache__/layers.cpython-312.pyc +0 -0
  103. package/core/synapse/__pycache__/layers.cpython-313.pyc +0 -0
  104. package/core/synapse/__pycache__/layers.cpython-314.pyc +0 -0
  105. package/core/workflow/__pycache__/__init__.cpython-314.pyc +0 -0
  106. package/core/workflow/__pycache__/enforcer.cpython-313.pyc +0 -0
  107. package/core/workflow/__pycache__/engine.cpython-314.pyc +0 -0
  108. package/core/workflow/__pycache__/flow_enforcer.cpython-313.pyc +0 -0
  109. package/core/workflow/__pycache__/flow_enforcer.cpython-314.pyc +0 -0
  110. package/core/workflow/__pycache__/gate_checkpoint.cpython-313.pyc +0 -0
  111. package/core/workflow/__pycache__/gate_checkpoint.cpython-314.pyc +0 -0
  112. package/core/workflow/__pycache__/loader.cpython-314.pyc +0 -0
  113. package/core/workflow/__pycache__/marker_cache.cpython-314.pyc +0 -0
  114. package/core/workflow/__pycache__/research_gate.cpython-313.pyc +0 -0
  115. package/core/workflow/__pycache__/research_gate.cpython-314.pyc +0 -0
  116. package/core/workflow/__pycache__/rules_registry.cpython-313.pyc +0 -0
  117. package/core/workflow/__pycache__/schema.cpython-314.pyc +0 -0
  118. package/core/workflow/__pycache__/specialist_enforcer.cpython-313.pyc +0 -0
  119. package/core/workflow/__pycache__/state.cpython-314.pyc +0 -0
  120. package/package.json +1 -1
  121. package/pyproject.toml +3 -1
  122. package/scripts/__pycache__/synapse-bridge.cpython-313.pyc +0 -0
package/VERSION CHANGED
@@ -1 +1 @@
1
- 4.1.0
1
+ 4.1.1
@@ -49,5 +49,20 @@ if [ ! -f "$ARKAOS_ROOT/core/hooks/post_tool_use.py" ]; then
49
49
  fi
50
50
  fi
51
51
 
52
+ # Interpreter resolution: prefer the ArkaOS venv (has pyyaml/pydantic);
53
+ # otherwise probe — an unrelated project venv first on PATH would give a
54
+ # python3 without yaml and silently degrade every gate.
55
+ _PY=""
56
+ for _cand in "$HOME/.arkaos/venv/bin/python3" "$HOME/.arkaos/.venv/bin/python3"; do
57
+ if [ -x "$_cand" ]; then _PY="$_cand"; break; fi
58
+ done
59
+ if [ -z "$_PY" ]; then
60
+ _PY="python3"
61
+ if ! "$_PY" -c "import yaml" 2>/dev/null; then
62
+ for _cand in /opt/homebrew/bin/python3 /usr/local/bin/python3 /usr/bin/python3; do
63
+ if [ -x "$_cand" ] && "$_cand" -c "import yaml" 2>/dev/null; then _PY="$_cand"; break; fi
64
+ done
65
+ fi
66
+ fi
52
67
  PYTHONPATH="$ARKAOS_ROOT${PYTHONPATH:+:$PYTHONPATH}" \
53
- exec python3 -m core.hooks.post_tool_use
68
+ exec "$_PY" -m core.hooks.post_tool_use
@@ -52,5 +52,20 @@ if [ ! -f "$ARKAOS_ROOT/core/hooks/pre_tool_use.py" ]; then
52
52
  fi
53
53
 
54
54
  # ─── Single python process; stdin/stdout/stderr/exit-code pass through ──
55
+ # Interpreter resolution: prefer the ArkaOS venv (has pyyaml/pydantic);
56
+ # otherwise probe — an unrelated project venv first on PATH would give a
57
+ # python3 without yaml and silently degrade every gate.
58
+ _PY=""
59
+ for _cand in "$HOME/.arkaos/venv/bin/python3" "$HOME/.arkaos/.venv/bin/python3"; do
60
+ if [ -x "$_cand" ]; then _PY="$_cand"; break; fi
61
+ done
62
+ if [ -z "$_PY" ]; then
63
+ _PY="python3"
64
+ if ! "$_PY" -c "import yaml" 2>/dev/null; then
65
+ for _cand in /opt/homebrew/bin/python3 /usr/local/bin/python3 /usr/bin/python3; do
66
+ if [ -x "$_cand" ] && "$_cand" -c "import yaml" 2>/dev/null; then _PY="$_cand"; break; fi
67
+ done
68
+ fi
69
+ fi
55
70
  PYTHONPATH="$ARKAOS_ROOT${PYTHONPATH:+:$PYTHONPATH}" \
56
- exec python3 -m core.hooks.pre_tool_use
71
+ exec "$_PY" -m core.hooks.pre_tool_use
@@ -49,6 +49,21 @@ if [ ! -f "$ARKAOS_ROOT/core/hooks/stop.py" ]; then
49
49
  fi
50
50
  fi
51
51
 
52
+ # Interpreter resolution: prefer the ArkaOS venv (has pyyaml/pydantic);
53
+ # otherwise probe — an unrelated project venv first on PATH would give a
54
+ # python3 without yaml and silently degrade every gate.
55
+ _PY=""
56
+ for _cand in "$HOME/.arkaos/venv/bin/python3" "$HOME/.arkaos/.venv/bin/python3"; do
57
+ if [ -x "$_cand" ]; then _PY="$_cand"; break; fi
58
+ done
59
+ if [ -z "$_PY" ]; then
60
+ _PY="python3"
61
+ if ! "$_PY" -c "import yaml" 2>/dev/null; then
62
+ for _cand in /opt/homebrew/bin/python3 /usr/local/bin/python3 /usr/bin/python3; do
63
+ if [ -x "$_cand" ] && "$_cand" -c "import yaml" 2>/dev/null; then _PY="$_cand"; break; fi
64
+ done
65
+ fi
66
+ fi
52
67
  PYTHONPATH="$ARKAOS_ROOT${PYTHONPATH:+:$PYTHONPATH}" \
53
- python3 -m core.hooks.stop
68
+ "$_PY" -m core.hooks.stop
54
69
  exit 0
@@ -54,5 +54,20 @@ if [ ! -f "$ARKAOS_ROOT/core/hooks/user_prompt_submit.py" ]; then
54
54
  fi
55
55
  fi
56
56
 
57
+ # Interpreter resolution: prefer the ArkaOS venv (has pyyaml/pydantic);
58
+ # otherwise probe — an unrelated project venv first on PATH would give a
59
+ # python3 without yaml and silently degrade every gate.
60
+ _PY=""
61
+ for _cand in "$HOME/.arkaos/venv/bin/python3" "$HOME/.arkaos/.venv/bin/python3"; do
62
+ if [ -x "$_cand" ]; then _PY="$_cand"; break; fi
63
+ done
64
+ if [ -z "$_PY" ]; then
65
+ _PY="python3"
66
+ if ! "$_PY" -c "import yaml" 2>/dev/null; then
67
+ for _cand in /opt/homebrew/bin/python3 /usr/local/bin/python3 /usr/bin/python3; do
68
+ if [ -x "$_cand" ] && "$_cand" -c "import yaml" 2>/dev/null; then _PY="$_cand"; break; fi
69
+ done
70
+ fi
71
+ fi
57
72
  PYTHONPATH="$ARKAOS_ROOT${PYTHONPATH:+:$PYTHONPATH}" \
58
- exec python3 -m core.hooks.user_prompt_submit
73
+ exec "$_PY" -m core.hooks.user_prompt_submit
@@ -36,6 +36,13 @@ _STOPWORDS = frozenset({
36
36
  })
37
37
 
38
38
 
39
+ # Jaccard between full documents rarely exceeds ~0.3 even for clearly
40
+ # related notes, while cosine similarity of embeddings sits comfortably
41
+ # above 0.5. A single threshold calibrated for cosine silently disabled
42
+ # the relator on every machine without fastembed (v4.1.1 fix).
43
+ _KEYWORD_MIN_SIMILARITY = 0.15
44
+
45
+
39
46
  def find_related(
40
47
  content: str,
41
48
  vault: Path,
@@ -48,8 +55,9 @@ def find_related(
48
55
  candidates = _collect_notes(vault, exclude)
49
56
  if not candidates:
50
57
  return []
51
- scored = _score_candidates(content, candidates)
52
- filtered = [r for r in scored if r.score >= min_similarity]
58
+ scored, method = _score_candidates(content, candidates)
59
+ threshold = min_similarity if method == "semantic" else _KEYWORD_MIN_SIMILARITY
60
+ filtered = [r for r in scored if r.score >= threshold]
53
61
  filtered.sort(key=lambda r: r.score, reverse=True)
54
62
  return filtered[:top_n]
55
63
 
@@ -70,22 +78,24 @@ def _collect_notes(vault: Path, exclude: Optional[Path]) -> list[tuple[Path, str
70
78
 
71
79
  def _score_candidates(
72
80
  content: str, candidates: list[tuple[Path, str]]
73
- ) -> list[RelatedNote]:
81
+ ) -> tuple[list[RelatedNote], str]:
82
+ """Score candidates, returning (results, method) so the caller can
83
+ apply a threshold appropriate to the scoring space."""
74
84
  try:
75
85
  return _semantic_score(content, candidates)
76
86
  except Exception:
77
- return _keyword_score(content, candidates)
87
+ return _keyword_score(content, candidates), "keyword"
78
88
 
79
89
 
80
90
  def _semantic_score(
81
91
  content: str, candidates: list[tuple[Path, str]]
82
- ) -> list[RelatedNote]:
92
+ ) -> tuple[list[RelatedNote], str]:
83
93
  from core.knowledge.embedder import embed, is_available
84
94
  if not is_available():
85
- return _keyword_score(content, candidates)
95
+ return _keyword_score(content, candidates), "keyword"
86
96
  query_emb = embed(content)
87
97
  if query_emb is None:
88
- return _keyword_score(content, candidates)
98
+ return _keyword_score(content, candidates), "keyword"
89
99
  results = []
90
100
  for path, text in candidates:
91
101
  note_emb = embed(text[:2000])
@@ -96,7 +106,7 @@ def _semantic_score(
96
106
  path=path, title=_title_from_path(path),
97
107
  score=score, excerpt=text[:160],
98
108
  ))
99
- return results
109
+ return results, "semantic"
100
110
 
101
111
 
102
112
  def _keyword_score(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkaos",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "The Operating System for AI Agent Teams",
5
5
  "type": "module",
6
6
  "bin": {
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "arkaos-core"
3
- version = "4.1.0"
3
+ version = "4.1.1"
4
4
  description = "Core engine for ArkaOS — The Operating System for AI Agent Teams"
5
5
  readme = "README.md"
6
6
  license = {text = "MIT"}
@@ -35,6 +35,8 @@ knowledge = [
35
35
  dashboard = [
36
36
  "fastapi>=0.115.0",
37
37
  "uvicorn>=0.32.0",
38
+ "python-multipart>=0.0.9",
39
+ "websockets>=12.0",
38
40
  ]
39
41
  ingest = [
40
42
  "yt-dlp>=2024.0",