arkaos 3.75.0 → 3.75.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.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 3.75.0
1
+ 3.75.1
@@ -171,9 +171,21 @@ For each item, in order:
171
171
  bookkeeping. The L2.6 Synapse layer
172
172
  (`core/synapse/agent_experiences_layer.py`) injects the lessons
173
173
  into the next dispatch automatically. APPROVED verdicts produce no
174
- record (only failures are lessons). If a specialist is
175
- missing, stop and advise the user
176
- to create one via `/arka personas` + provide the knowledge.
174
+ `Experience` record (only failures are lessons).
175
+
176
+ **Pattern auto-stub convention (PR4.5 v3.75.1):** to populate the
177
+ Pattern Library on APPROVED outcomes, the orchestrator may include
178
+ `[arka:pattern-suggest <id> <name>]` in the CQO dispatch prompt
179
+ (e.g. `[arka:pattern-suggest force-specialist-dispatch Force
180
+ Specialist Dispatch]`). On APPROVED, the same PostToolUse hook
181
+ creates a stub `PatternCard` so the library remembers the feature
182
+ ID and name; the operator enriches it later via `record_pattern()`
183
+ or by editing `~/.arkaos/patterns/cards.jsonl`. Re-suggesting an
184
+ existing id is a no-op (never overwrites enriched cards).
185
+
186
+ If a specialist is missing, stop and advise the user to create one
187
+ via `/arka personas` + provide the knowledge.
188
+
177
189
  - Fail → back to the todo.
178
190
  6. Document — save the completed work to Obsidian + vector DB.
179
191
  7. Next todo.
@@ -148,6 +148,15 @@ ownership:
148
148
  owners: [architect, security-eng]
149
149
  reason: "Governance code requires architecture + security review"
150
150
 
151
+ # PR4.5 v3.75.1 — extend coverage to knowledge + synapse (Marta PR4-QG #4)
152
+ - pattern: "core/knowledge/**/*.py"
153
+ owners: [architect, senior-dev]
154
+ reason: "Knowledge storage + retrieval require architecture review"
155
+
156
+ - pattern: "core/synapse/**/*.py"
157
+ owners: [architect, senior-dev]
158
+ reason: "Synapse engine + layers require architecture review"
159
+
151
160
  - pattern: "docs/adr/**"
152
161
  owners: [architect]
153
162
  reason: "ADRs are architect's responsibility"
@@ -81,23 +81,26 @@ fi
81
81
  # `agent-experience-persistence`). Never blocks the hook.
82
82
  if [ "$TOOL_NAME" = "Task" ] || [ "$TOOL_NAME" = "Agent" ]; then
83
83
  SUBAGENT_TYPE=$(echo "$input" | jq -r '.tool_input.subagent_type // ""' 2>/dev/null)
84
- if [ "$SUBAGENT_TYPE" = "cqo" ] && echo "$TOOL_OUTPUT" | grep -qE 'Quality Gate Verdict:[[:space:]]*REJECTED'; then
84
+ if [ "$SUBAGENT_TYPE" = "cqo" ]; then
85
85
  TOOL_INPUT_PROMPT=$(echo "$input" | jq -r '.tool_input.prompt // ""' 2>/dev/null)
86
- REVIEWING_TARGET=$(printf '%s' "$TOOL_INPUT_PROMPT" \
87
- | grep -oE '\[arka:reviewing[[:space:]]+[A-Za-z0-9_.-]+\]' \
88
- | head -1 \
89
- | sed -E 's/.*\[arka:reviewing[[:space:]]+([A-Za-z0-9_.-]+)\].*/\1/')
90
- if [ -n "$REVIEWING_TARGET" ]; then
91
- _AE_ROOT="${ARKAOS_ROOT:-}"
92
- if [ -z "$_AE_ROOT" ] && [ -f "$HOME/.arkaos/.repo-path" ]; then
93
- _AE_ROOT=$(cat "$HOME/.arkaos/.repo-path" 2>/dev/null)
94
- fi
95
- [ -z "$_AE_ROOT" ] && _AE_ROOT="$HOME/.arkaos"
96
- VERDICT_TEXT="$TOOL_OUTPUT" \
97
- AGENT_ID="$REVIEWING_TARGET" \
98
- SESSION_ID="$SESSION_ID_PTU" \
99
- ARKAOS_ROOT="$_AE_ROOT" \
100
- python3 - <<'PY' 2>/dev/null || true
86
+ _AE_ROOT="${ARKAOS_ROOT:-}"
87
+ if [ -z "$_AE_ROOT" ] && [ -f "$HOME/.arkaos/.repo-path" ]; then
88
+ _AE_ROOT=$(cat "$HOME/.arkaos/.repo-path" 2>/dev/null)
89
+ fi
90
+ [ -z "$_AE_ROOT" ] && _AE_ROOT="$HOME/.arkaos"
91
+
92
+ # ─── REJECTED experience auto-record ────────────────────────────
93
+ if echo "$TOOL_OUTPUT" | grep -qE 'Quality Gate Verdict:[[:space:]]*REJECTED'; then
94
+ REVIEWING_TARGET=$(printf '%s' "$TOOL_INPUT_PROMPT" \
95
+ | grep -oE '\[arka:reviewing[[:space:]]+[A-Za-z0-9_.-]+\]' \
96
+ | head -1 \
97
+ | sed -E 's/.*\[arka:reviewing[[:space:]]+([A-Za-z0-9_.-]+)\].*/\1/')
98
+ if [ -n "$REVIEWING_TARGET" ]; then
99
+ VERDICT_TEXT="$TOOL_OUTPUT" \
100
+ AGENT_ID="$REVIEWING_TARGET" \
101
+ SESSION_ID="$SESSION_ID_PTU" \
102
+ ARKAOS_ROOT="$_AE_ROOT" \
103
+ python3 - <<'PY' 2>/dev/null || true
101
104
  import os, sys
102
105
  sys.path.insert(0, os.environ["ARKAOS_ROOT"])
103
106
  try:
@@ -111,6 +114,55 @@ try:
111
114
  except Exception:
112
115
  pass
113
116
  PY
117
+ fi
118
+ fi
119
+
120
+ # ─── APPROVED → pattern stub auto-create (PR4.5 v3.75.1) ──────────
121
+ # When the dispatch prompt contains `[arka:pattern-suggest <id> <name>]`
122
+ # AND the verdict is APPROVED, create a stub PatternCard. The
123
+ # operator enriches by editing ~/.arkaos/patterns/cards.jsonl or
124
+ # calling record_pattern() with the full metadata. Skips when the
125
+ # id already exists (never overwrites enriched cards).
126
+ if echo "$TOOL_OUTPUT" | grep -qE 'Quality Gate Verdict:[[:space:]]*APPROVED'; then
127
+ PATTERN_LINE=$(printf '%s' "$TOOL_INPUT_PROMPT" \
128
+ | grep -oE '\[arka:pattern-suggest[[:space:]]+[A-Za-z0-9_.-]+[[:space:]]+[^][]+\]' \
129
+ | head -1)
130
+ if [ -n "$PATTERN_LINE" ]; then
131
+ PID=$(printf '%s' "$PATTERN_LINE" | sed -E 's/\[arka:pattern-suggest[[:space:]]+([A-Za-z0-9_.-]+).*/\1/')
132
+ PNAME=$(printf '%s' "$PATTERN_LINE" | sed -E 's/\[arka:pattern-suggest[[:space:]]+[A-Za-z0-9_.-]+[[:space:]]+([^][]+)\]/\1/')
133
+ if [ -n "$PID" ] && [ -n "$PNAME" ]; then
134
+ PATTERN_ID="$PID" \
135
+ PATTERN_NAME="$PNAME" \
136
+ ARKAOS_ROOT="$_AE_ROOT" \
137
+ python3 - <<'PY' 2>/dev/null || true
138
+ import os, sys
139
+ sys.path.insert(0, os.environ["ARKAOS_ROOT"])
140
+ try:
141
+ from datetime import datetime, timezone
142
+ from core.knowledge.pattern_cards import PatternCard, record_pattern, query_patterns
143
+ pid = os.environ["PATTERN_ID"]
144
+ existing = [c for c in query_patterns(limit=1000) if c.id == pid]
145
+ if not existing:
146
+ ts = datetime.now(timezone.utc).isoformat()
147
+ record_pattern(PatternCard(
148
+ id=pid,
149
+ name=os.environ["PATTERN_NAME"],
150
+ feature_keywords=[pid.replace("-", " "), os.environ["PATTERN_NAME"].lower()],
151
+ description="Stub auto-created from APPROVED CQO verdict — enrich via record_pattern() or by editing the JSONL.",
152
+ stack=[],
153
+ files=[],
154
+ acceptance_criteria=[],
155
+ edge_cases=[],
156
+ references=[],
157
+ projects_using=["arkaos"],
158
+ created_at=ts,
159
+ last_updated=ts,
160
+ ))
161
+ except Exception:
162
+ pass
163
+ PY
164
+ fi
165
+ fi
114
166
  fi
115
167
  fi
116
168
  fi
@@ -20,17 +20,25 @@ from core.knowledge.pattern_cards import PatternCard, query_patterns
20
20
  from core.synapse.layers import Layer, LayerResult, PromptContext
21
21
 
22
22
 
23
- # Cheap keyword extractor — alphanumeric runs longer than 3 chars,
24
- # lowercased, stopword-filtered. Enough for v1 matching; a vector-DB
25
- # embedder will replace this in v3.75.x.
26
- _WORD_RE = re.compile(r"[A-Za-z][A-Za-z0-9_-]{3,}")
23
+ # Cheap keyword extractor — letter-led runs of ≥4 chars, lowercased,
24
+ # stopword-filtered. The character class includes Latin-1 Supplement
25
+ # (À-ÿ, U+00C0–U+00FF) so pt-PT input like "autenticação", "paginação",
26
+ # "implementação" is captured whole instead of truncated at the
27
+ # accented character. Latin Extended-A (U+0100+) is intentionally
28
+ # excluded — extend the class when adding CS/PL/HU/TR corpora
29
+ # (š, ý, ě, ą, ł, ő, ı, etc.). Vector-DB embedder lands in v3.75.x.
30
+ _WORD_RE = re.compile(r"[A-Za-zÀ-ÿ][A-Za-zÀ-ÿ0-9_-]{3,}")
27
31
 
28
32
  _STOPWORDS: frozenset[str] = frozenset({
33
+ # EN
29
34
  "this", "that", "with", "from", "into", "have", "want", "need",
30
35
  "should", "would", "could", "make", "made", "thing", "things",
31
36
  "there", "their", "about", "what", "when", "where", "which",
32
- "while", "also", "just", "like", "para", "como", "isto",
33
- "esta", "este", "isso", "essa", "esse", "depois", "antes",
37
+ "while", "also", "just", "like",
38
+ # PT
39
+ "para", "como", "isto", "esta", "este", "isso", "essa", "esse",
40
+ "depois", "antes", "pode", "deve", "muito", "pelo", "pela",
41
+ "desde", "ainda", "assim", "porque", "mais", "menos", "sobre",
34
42
  })
35
43
 
36
44
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkaos",
3
- "version": "3.75.0",
3
+ "version": "3.75.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 = "3.75.0"
3
+ version = "3.75.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"}