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 +1 -1
- package/arka/skills/flow/SKILL.md +15 -3
- package/config/agent-ownership.yaml +9 -0
- package/config/hooks/post-tool-use.sh +68 -16
- package/core/knowledge/__pycache__/pattern_cards.cpython-313.pyc +0 -0
- package/core/knowledge/__pycache__/pattern_cards_cli.cpython-313.pyc +0 -0
- package/core/synapse/__pycache__/engine.cpython-313.pyc +0 -0
- package/core/synapse/__pycache__/pattern_library_layer.cpython-313.pyc +0 -0
- package/core/synapse/pattern_library_layer.py +14 -6
- package/package.json +1 -1
- package/pyproject.toml +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.75.
|
|
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).
|
|
175
|
-
|
|
176
|
-
|
|
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" ]
|
|
84
|
+
if [ "$SUBAGENT_TYPE" = "cqo" ]; then
|
|
85
85
|
TOOL_INPUT_PROMPT=$(echo "$input" | jq -r '.tool_input.prompt // ""' 2>/dev/null)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -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 —
|
|
24
|
-
#
|
|
25
|
-
#
|
|
26
|
-
|
|
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",
|
|
33
|
-
|
|
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