arkaos 4.11.0 → 4.12.0
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/README.md +1 -1
- package/VERSION +1 -1
- package/arka/SKILL.md +10 -1
- package/arka/skills/flow/SKILL.md +23 -1
- package/arka/skills/recipes/SKILL.md +69 -0
- package/arka/skills/refine/SKILL.md +81 -0
- package/config/constitution.yaml +8 -0
- package/config/mcp-policy.yaml +8 -0
- package/config/output-styles/arkaos.md +52 -0
- package/core/evals/__init__.py +4 -0
- package/core/evals/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/evals/__pycache__/record_cli.cpython-313.pyc +0 -0
- package/core/evals/__pycache__/verdict_labels.cpython-313.pyc +0 -0
- package/core/evals/record_cli.py +41 -8
- package/core/evals/verdict_labels.py +53 -13
- package/core/forge/__pycache__/complexity.cpython-313.pyc +0 -0
- package/core/forge/complexity.py +9 -0
- package/core/governance/__pycache__/evidence_checks.cpython-313.pyc +0 -0
- package/core/governance/__pycache__/judge.cpython-313.pyc +0 -0
- package/core/governance/__pycache__/phantom_action_check.cpython-313.pyc +0 -0
- package/core/governance/__pycache__/phantom_action_check.cpython-314.pyc +0 -0
- package/core/governance/evidence_checks.py +60 -4
- package/core/governance/judge.py +95 -0
- package/core/governance/phantom_action_check.py +41 -0
- package/core/hooks/__pycache__/post_tool_use.cpython-313.pyc +0 -0
- package/core/hooks/__pycache__/stop.cpython-313.pyc +0 -0
- package/core/hooks/__pycache__/stop.cpython-314.pyc +0 -0
- package/core/hooks/__pycache__/user_prompt_submit.cpython-313.pyc +0 -0
- package/core/hooks/post_tool_use.py +13 -0
- package/core/hooks/stop.py +23 -0
- package/core/hooks/user_prompt_submit.py +69 -0
- package/core/knowledge/__pycache__/recipes.cpython-313.pyc +0 -0
- package/core/knowledge/__pycache__/recipes_cli.cpython-313.pyc +0 -0
- package/core/knowledge/recipes.py +237 -0
- package/core/knowledge/recipes_cli.py +99 -0
- package/core/shared/__pycache__/safe_session_id.cpython-313.pyc +0 -0
- package/core/shared/__pycache__/safe_session_id.cpython-314.pyc +0 -0
- package/core/shared/safe_session_id.py +11 -3
- package/core/synapse/__pycache__/engine.cpython-313.pyc +0 -0
- package/core/synapse/__pycache__/engine.cpython-314.pyc +0 -0
- package/core/synapse/__pycache__/pattern_library_layer.cpython-313.pyc +0 -0
- package/core/synapse/__pycache__/recipe_layer.cpython-313.pyc +0 -0
- package/core/synapse/engine.py +6 -0
- package/core/synapse/pattern_library_layer.py +10 -2
- package/core/synapse/recipe_layer.py +114 -0
- package/core/sync/__pycache__/mcp_optimizer.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/mcp_syncer.cpython-313.pyc +0 -0
- package/core/sync/__pycache__/settings_syncer.cpython-313.pyc +0 -0
- package/core/sync/mcp_optimizer.py +4 -1
- package/core/sync/mcp_syncer.py +50 -6
- package/core/sync/settings_syncer.py +9 -2
- package/core/workflow/__pycache__/flow_enforcer.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/flow_enforcer.cpython-314.pyc +0 -0
- package/core/workflow/__pycache__/plan_approval.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/plan_approval.cpython-314.pyc +0 -0
- package/core/workflow/flow_enforcer.py +63 -0
- package/core/workflow/plan_approval.py +185 -0
- package/departments/dev/SKILL.md +10 -0
- package/departments/dev/skills/onboard/SKILL.md +6 -2
- package/departments/dev/skills/refactor-plan/SKILL.md +7 -0
- package/departments/dev/skills/scaffold/SKILL.md +6 -0
- package/departments/quality/SKILL.md +16 -0
- package/installer/doctor.js +7 -0
- package/installer/index.js +20 -0
- package/installer/output-style.js +92 -0
- package/installer/update.js +19 -0
- package/installer/worktree-baseref.js +8 -2
- package/knowledge/commands-keywords.json +4 -0
- package/knowledge/commands-registry.json +41 -3
- package/package.json +1 -1
- package/pyproject.toml +1 -1
package/README.md
CHANGED
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.
|
|
1
|
+
4.12.0
|
package/arka/SKILL.md
CHANGED
|
@@ -25,7 +25,7 @@ measures citation compliance per turn.
|
|
|
25
25
|
# ArkaOS — Main Orchestrator
|
|
26
26
|
|
|
27
27
|
> **The Operating System for AI Agent Teams**
|
|
28
|
-
> 82 agents. 17 departments.
|
|
28
|
+
> 82 agents. 17 departments. 270 skills. Multi-runtime. Dashboard. Knowledge RAG.
|
|
29
29
|
|
|
30
30
|
## ⛔ Evidence flow — 4 gates (NON-NEGOTIABLE)
|
|
31
31
|
|
|
@@ -187,6 +187,8 @@ violation (squad-routing, arka-supremacy, spec-driven, mandatory-qa).
|
|
|
187
187
|
| `/arka keys` | Manage API keys (OpenAI, Google, fal.ai) |
|
|
188
188
|
| `/arka personas` | Manage AI personas (create, clone to agent) |
|
|
189
189
|
| `/arka resume <PR_URL>` | Re-enter the Claude Code session that produced a PR (GitHub / GitLab / Bitbucket). Wraps the native `/resume` from Claude Code 2.1.122+. Useful with `arka-dev-spec` and `arka-release` archaeology. |
|
|
190
|
+
| `/arka refine <rough idea>` | Turn a vague or domain-unfamiliar ask into a precise English prompt by asking about the topic first (arka-refine). Auto-suggested on vague requests. |
|
|
191
|
+
| `/arka recipes [list\|show\|apply] <slug>` | Reuse validated QG-approved feature builds (arka-recipes). Synapse L7.6 auto-surfaces matches. |
|
|
190
192
|
| `/do <description>` | Universal routing — natural language to department command |
|
|
191
193
|
|
|
192
194
|
## Universal Orchestrator (/do)
|
|
@@ -210,6 +212,13 @@ Users don't need to memorize commands. Just describe what you need:
|
|
|
210
212
|
2. Natural language → Synapse L1 (keyword) + L5 (command hints) + hook context tags
|
|
211
213
|
3. Resolution: single match → announce + execute | multiple → top 3 + ask | ambiguous → ask department
|
|
212
214
|
4. Code-modifying → preview + confirm | non-code → auto-execute
|
|
215
|
+
5. **Vague request → refine first.** When the ask is vague (the
|
|
216
|
+
UserPromptSubmit hook injected `[arka:refine-suggested]`, or there is
|
|
217
|
+
no clear target/scope/acceptance criteria — common in a domain the
|
|
218
|
+
user does not command, e.g. UI/design), route to `/arka refine`
|
|
219
|
+
BEFORE the department: it asks about the topic and compiles a precise
|
|
220
|
+
English prompt, then dispatches back through `/do`. A request that is
|
|
221
|
+
already specific skips refinement.
|
|
213
222
|
|
|
214
223
|
### Squad Routing (MUST)
|
|
215
224
|
|
|
@@ -56,7 +56,8 @@ resumes at the right gate.
|
|
|
56
56
|
anything substantive they do not cover. Cite what you use with
|
|
57
57
|
`[[wikilinks]]` or `file:line`; declare gaps explicitly.
|
|
58
58
|
- Read the live context: profile, CLAUDE.md, git branch, cwd tag,
|
|
59
|
-
pattern cards (L7.5),
|
|
59
|
+
pattern cards (L7.5), validated recipes (L7.6 — QG-approved prior
|
|
60
|
+
builds to adapt), agent experiences (L2.6).
|
|
60
61
|
|
|
61
62
|
### Gate 2 — PLAN `[arka:gate:2]`
|
|
62
63
|
|
|
@@ -65,6 +66,20 @@ resumes at the right gate.
|
|
|
65
66
|
- Complexity is scored by `core/forge/complexity.py`: LOW → a plan
|
|
66
67
|
inline in the reply; MEDIUM/HIGH → persist the plan to
|
|
67
68
|
`~/.arkaos/plans/` + Obsidian and consider `/arka-forge`.
|
|
69
|
+
- **Plan-judge (constitution `gate-judges`, MEDIUM/HIGH only):** BEFORE
|
|
70
|
+
presenting the plan to the user, dispatch one judge via the Agent
|
|
71
|
+
tool with `JUDGE_VERDICT_JSON_SCHEMA` from `core.governance.judge` as
|
|
72
|
+
the structured-output schema, frontier model (constitution
|
|
73
|
+
`quality_gate.model_policy`). The judge receives the original request
|
|
74
|
+
+ the plan and hunts adversarially for what is unfinished, default,
|
|
75
|
+
or would be rejected by a top-tier lead — the same
|
|
76
|
+
`arkaos-not-yes-man` standard applied to the AGENT's work. `REVISE`
|
|
77
|
+
→ fix the plan and re-judge (max 2 loops, then escalate the findings
|
|
78
|
+
to the user). A non-empty `user_challenge` means the USER's request
|
|
79
|
+
itself is technically wrong — present the challenge alongside the
|
|
80
|
+
plan, never swallow it. Record every verdict:
|
|
81
|
+
`arka-py -m core.evals.record_cli --kind judge`. LOW/trivial work
|
|
82
|
+
skips the judge — gates catch risk, they do not ritualize.
|
|
68
83
|
- **Wait for EXPLICIT user approval. Silence is not approval.** This is
|
|
69
84
|
the one human gate and it never disappears.
|
|
70
85
|
- Non-blocking unknowns do not stall the gate: proceed and state
|
|
@@ -97,6 +112,13 @@ resumes at the right gate.
|
|
|
97
112
|
coverage read from the report file, security grep, spell-check for
|
|
98
113
|
copy. Reviewers (Quality Gate personas) interpret tool output; they do
|
|
99
114
|
not replace it. APPROVED/REJECTED derives from evidence.
|
|
115
|
+
- **Output-judge (constitution `gate-judges`, MEDIUM/HIGH only):**
|
|
116
|
+
BEFORE dispatching the Quality Gate personas, dispatch one judge
|
|
117
|
+
(Agent tool, `JUDGE_VERDICT_JSON_SCHEMA`, frontier model) over the
|
|
118
|
+
deliverable + diff + evidence report. `REVISE` loops the work back
|
|
119
|
+
into Gate 3 (max 2); `PASS` and its findings become INPUT to the QG
|
|
120
|
+
reviewers — the judge never replaces the personas or the evidence.
|
|
121
|
+
Record the verdict: `arka-py -m core.evals.record_cli --kind judge`.
|
|
100
122
|
- **Excellence check (`excellence-mandate`, mandatory):** before closing,
|
|
101
123
|
answer three questions with evidence, not narration:
|
|
102
124
|
1. What is **unfinished** in this delivery (trimmed scope, TODO left
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: arka-recipes
|
|
3
|
+
description: >
|
|
4
|
+
Validated recipe library — QG-approved feature builds captured with
|
|
5
|
+
their reference files, reused across projects instead of re-derived
|
|
6
|
+
from docs. Lists, shows, and applies recipes (Laravel login, payment
|
|
7
|
+
integration, standard UI patterns…).
|
|
8
|
+
TRIGGER: "/arka recipes", "que receitas temos", "apply the <x> recipe",
|
|
9
|
+
"reusa a receita", "há uma receita para isto?", "recipe for <feature>".
|
|
10
|
+
SKIP: capturing a NEW recipe from an approved deliverable -> the
|
|
11
|
+
Quality Gate skill step 7 proposes it; short reusable text hints ->
|
|
12
|
+
the Pattern Library (record_pattern); planning a task -> arka-forge.
|
|
13
|
+
allowed-tools: [Read, Bash]
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<!-- arka:kb-first-prefix begin -->
|
|
17
|
+
> **KB-first:** query `mcp__obsidian__search_notes` and cite
|
|
18
|
+
> `[[wikilinks]]` — or declare the gap — BEFORE any external research.
|
|
19
|
+
> Full doctrine: `arka/SKILL.md` (KB-First Research).
|
|
20
|
+
<!-- arka:kb-first-prefix end -->
|
|
21
|
+
|
|
22
|
+
# /arka recipes — reuse validated feature builds
|
|
23
|
+
|
|
24
|
+
A recipe is a QG-approved feature captured with its reference files
|
|
25
|
+
(`~/.arkaos/recipes/<slug>/{RECIPE.md, recipe.json, files/}`). Where a
|
|
26
|
+
pattern card is a text hint, a recipe is proven code to adapt — so
|
|
27
|
+
"Laravel login" is a known, validated build, not a from-scratch
|
|
28
|
+
re-derivation. Synapse L7.6 auto-injects matching recipes as
|
|
29
|
+
`[recipes:N]` on every prompt; these commands drive them explicitly.
|
|
30
|
+
|
|
31
|
+
## Commands
|
|
32
|
+
|
|
33
|
+
| Command | Description |
|
|
34
|
+
|---------|-------------|
|
|
35
|
+
| `/arka recipes list` | List captured recipes (slug · stack · name). |
|
|
36
|
+
| `/arka recipes show <slug>` | Print a recipe's full metadata (recipe.json). |
|
|
37
|
+
| `/arka recipes apply <slug>` | Read RECIPE.md + files/ as prior art and adapt to the current project through the normal 4-gate flow. |
|
|
38
|
+
|
|
39
|
+
Backed by `core.knowledge.recipes_cli`:
|
|
40
|
+
|
|
41
|
+
arka-py -m core.knowledge.recipes_cli list
|
|
42
|
+
arka-py -m core.knowledge.recipes_cli show <slug>
|
|
43
|
+
|
|
44
|
+
## Applying a recipe (never copy-paste blind)
|
|
45
|
+
|
|
46
|
+
`apply <slug>` is prior-art-driven adaptation, not a code dump:
|
|
47
|
+
|
|
48
|
+
1. Read `~/.arkaos/recipes/<slug>/RECIPE.md` (problem, approach,
|
|
49
|
+
decisions) and the files under `files/`.
|
|
50
|
+
2. Read `recipe.json` `apply_notes` — the recorded per-project
|
|
51
|
+
adaptation contract (namespaces, models, config to swap).
|
|
52
|
+
3. Enter the normal flow: Gate 2 presents a plan that maps the recipe
|
|
53
|
+
onto THIS project's stack and conventions; the user approves it like
|
|
54
|
+
any other build. The recipe informs the plan; it does not bypass the
|
|
55
|
+
gates.
|
|
56
|
+
4. Implement, run the recipe's acceptance criteria as the test floor,
|
|
57
|
+
pass the Quality Gate.
|
|
58
|
+
|
|
59
|
+
## Capture is elsewhere
|
|
60
|
+
|
|
61
|
+
New recipes are proposed by the Quality Gate (step 7) on an APPROVED
|
|
62
|
+
reusable feature and captured fail-closed (every field sanitized,
|
|
63
|
+
refused without a redaction config). This skill only consumes them.
|
|
64
|
+
|
|
65
|
+
## Related
|
|
66
|
+
|
|
67
|
+
- Pattern Library (Synapse L7.5) — short reusable text hints.
|
|
68
|
+
- `arka-dev-spec` / `/dev feature` — the flow an `apply` runs through.
|
|
69
|
+
- `arka-forge` — planning when the adaptation is complex.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: arka-refine
|
|
3
|
+
description: >
|
|
4
|
+
Prompt refiner for vague or domain-unfamiliar requests — turns a rough
|
|
5
|
+
ask into a high-quality English prompt for the workflow by asking
|
|
6
|
+
targeted questions first. For users who cannot phrase a clear brief in
|
|
7
|
+
a domain they do not command (UI/design, infra, data modelling).
|
|
8
|
+
TRIGGER: "/arka refine", "refina o prompt", "ajuda-me a pedir",
|
|
9
|
+
"não sei explicar o que quero", and any vague request the /do
|
|
10
|
+
orchestrator routes here (hook marker "[arka:refine-suggested]").
|
|
11
|
+
SKIP: the request is already specific with clear scope and acceptance
|
|
12
|
+
criteria -> /do dispatches directly; multi-agent planning of a known
|
|
13
|
+
task -> arka-forge; requirements spec for code -> arka-dev-spec.
|
|
14
|
+
allowed-tools: [Read, AskUserQuestion, Skill]
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
<!-- arka:kb-first-prefix begin -->
|
|
18
|
+
> **KB-first:** query `mcp__obsidian__search_notes` and cite
|
|
19
|
+
> `[[wikilinks]]` — or declare the gap — BEFORE any external research.
|
|
20
|
+
> Full doctrine: `arka/SKILL.md` (KB-First Research).
|
|
21
|
+
<!-- arka:kb-first-prefix end -->
|
|
22
|
+
|
|
23
|
+
# /arka refine — turn a rough ask into a quality prompt
|
|
24
|
+
|
|
25
|
+
A vague request produces a vague build. This skill closes the gap by
|
|
26
|
+
asking about the TOPIC before any work starts, then compiling a precise
|
|
27
|
+
English prompt the workflow can execute. It exists for the case the
|
|
28
|
+
operator named: *"I don't understand UI/design, so I can never write an
|
|
29
|
+
input clear enough to build the right thing."*
|
|
30
|
+
|
|
31
|
+
## When it runs
|
|
32
|
+
|
|
33
|
+
- Explicitly: the user types `/arka refine <rough idea>`.
|
|
34
|
+
- Automatically: the `/do` orchestrator routes a vague request here
|
|
35
|
+
BEFORE the department, or the UserPromptSubmit hook injects
|
|
36
|
+
`[arka:refine-suggested] score=N` for a vague ask (high ambiguity and
|
|
37
|
+
no concrete target named). Interposition is a suggestion — announce it
|
|
38
|
+
and proceed only if refinement genuinely helps; a clear ask goes
|
|
39
|
+
straight to `/do`.
|
|
40
|
+
|
|
41
|
+
## The refinement loop (conversation, not a form)
|
|
42
|
+
|
|
43
|
+
1. **Identify the topic and the domain.** Name what is being built and
|
|
44
|
+
which domain expertise it needs (frontend/design, data, infra, copy…).
|
|
45
|
+
2. **Ask ONE substantive question per turn.** Open dialogue, never a
|
|
46
|
+
multiple-choice menu as a substitute for conversation. Each question
|
|
47
|
+
teaches while it asks — in a domain the user does not command, carry
|
|
48
|
+
the vocabulary so they can answer:
|
|
49
|
+
- **UI/design:** load `frontend-design` / `ui-ux-pro-max` first. Ask
|
|
50
|
+
in their terms — visual tone (minimal / editorial / brutalist),
|
|
51
|
+
density, a named benchmark to match ("closer to Linear or to
|
|
52
|
+
Notion?"), light/dark, the one screen that matters most.
|
|
53
|
+
- Other domains: mirror the same pattern with that field's vocabulary.
|
|
54
|
+
3. **Stop at ~5 questions.** Enough to remove ambiguity, not an
|
|
55
|
+
interrogation. If the user says "just decide", pick sensible defaults
|
|
56
|
+
and state them as assumptions.
|
|
57
|
+
4. **Compile the final prompt IN ENGLISH.** Show it in a fenced block:
|
|
58
|
+
objective, scope, explicit non-goals, the named benchmark, acceptance
|
|
59
|
+
criteria, and stack/constraints gathered. English is the workflow's
|
|
60
|
+
working language regardless of the conversation language.
|
|
61
|
+
5. **Dispatch only after an explicit OK.** On approval, hand the compiled
|
|
62
|
+
prompt to `/do` — which enters the normal 4-gate flow (the compiled
|
|
63
|
+
prompt is the Gate-2 input; approval of the refinement is not approval
|
|
64
|
+
of the eventual plan).
|
|
65
|
+
|
|
66
|
+
## Guardrails
|
|
67
|
+
|
|
68
|
+
- Never invent requirements the user did not confirm; a stated assumption
|
|
69
|
+
is fine, a fabricated constraint is not.
|
|
70
|
+
- Never skip straight to building — the deliverable of THIS skill is the
|
|
71
|
+
prompt, not the feature.
|
|
72
|
+
- Be critical: if the request is technically wrong or would ship a worse
|
|
73
|
+
product, challenge it here (pushback protocol, `arkaos-not-yes-man`)
|
|
74
|
+
before compiling.
|
|
75
|
+
|
|
76
|
+
## Related
|
|
77
|
+
|
|
78
|
+
- `frontend-design`, `ui-ux-pro-max` — design vocabulary for UI prompts.
|
|
79
|
+
- `/do` — receives the compiled prompt and routes it.
|
|
80
|
+
- `arka-dev-spec` — when the refined ask needs a full code spec at Gate 2.
|
|
81
|
+
- `arka-forge` — when the refined ask needs multi-agent planning.
|
package/config/constitution.yaml
CHANGED
|
@@ -121,6 +121,11 @@ enforcement_levels:
|
|
|
121
121
|
rule: "Quality Gate REJECTED verdicts MUST result in an Experience record for the failing agent, written to ~/.arkaos/agents/<agent_id>/experiences.jsonl via core.governance.cqo_experience_recorder. Next dispatch of that agent loads the experiences via the Synapse L2.6 layer (core.synapse.agent_experiences_layer) so the lesson carries across sessions. Without this, REJECTED reports evaporate as conversation turns and the same structural mistakes recur."
|
|
122
122
|
enforcement: "PR3 v3.74.0 ships the storage, parser, and Synapse layer. v3.74.1 will wire a PostToolUse hook on the Agent tool that auto-records on REJECTED verdicts. Until then orchestrators MUST call cqo_experience_recorder.record_from_verdict() after every CQO dispatch. Audit via ~/.arkaos/bin/arka-py -m core.governance.agent_experiences_cli list <agent_id>."
|
|
123
123
|
|
|
124
|
+
# ─── Rule added in Interaction Reform PR2 (2026-07-09) ──────────────
|
|
125
|
+
- id: gate-judges
|
|
126
|
+
rule: "MEDIUM/HIGH work runs two gate judges: a plan-judge at Gate 2 (judges the planning summary BEFORE it reaches the user) and an output-judge at Gate 4 (judges the deliverable BEFORE the Quality Gate personas). Judges return a structured JudgeVerdict (core.governance.judge, PASS/REVISE binary, REVISE requires actionable findings) on a frontier-tier model, apply the arkaos-not-yes-man standard to the AGENT's work, and surface a user_challenge when the USER's request itself is technically wrong. REVISE loops the work (max 2, then escalate). LOW/trivial work skips the judges — gates catch risk, they do not ritualize."
|
|
127
|
+
enforcement: "Instructional in arka/skills/flow/SKILL.md (Gates 2 and 4) and departments/quality/SKILL.md (step 0); every verdict recorded to ~/.arkaos/telemetry/judge-verdicts.jsonl via core.evals.record_cli --kind judge — the PASS/REVISE telemetry decides whether a hook-level enforcement consumer is warranted."
|
|
128
|
+
|
|
124
129
|
# ─── Rule added in PR-4 of the prompt-surface plan (2026-07-08) ─────
|
|
125
130
|
- id: persona-vs-artifact
|
|
126
131
|
rule: "An agent's persona lives in the conversation, never in the deliverable. User- or client-facing artifacts (emails, copy, code comments, docs, posts, reports handed to a client) are written in the style the CONTEXT and the client's brand demand, not in the agent's personality. Agents also never meta-reference their own persona or behavioral profile in output ('as a C+D analyst, I...') — the persona shows in behavior, it is not announced."
|
|
@@ -483,3 +488,6 @@ amendments:
|
|
|
483
488
|
- version: "4.7.0"
|
|
484
489
|
date: "2026-07-08"
|
|
485
490
|
changes: "Constitution 2.0 (PR-5 prompt-surface, operator-approved plan): re-tiered the top enforcement level 26 -> 6 by the gate-verifiability admission test (16 -> MUST, 4 -> SHOULD; rule text preserved verbatim, total 46 rules unchanged); rewrote arkaos-not-yes-man with epistemic-branch pushback + anti-submission (PR-4); added persona-vs-artifact MUST (PR-4); added autonomy section (4-level confirmation taxonomy, assuming_pattern, default_stance); added claim-level verdict field (CONFIRMED/PLAUSIBLE/REFUTED) to QGBlocker."
|
|
491
|
+
- version: "4.12.0"
|
|
492
|
+
date: "2026-07-09"
|
|
493
|
+
changes: "Interaction Reform PR2 (operator-approved plan, 2026-07-09): added gate-judges MUST rule — plan-judge at Gate 2 and output-judge at Gate 4 for MEDIUM/HIGH work, structured JudgeVerdict (core.governance.judge), frontier tier, arkaos-not-yes-man standard applied to agents, user_challenge surfacing for technically wrong requests; verdicts recorded to judge-verdicts.jsonl."
|
package/config/mcp-policy.yaml
CHANGED
|
@@ -12,6 +12,7 @@ policies:
|
|
|
12
12
|
- match:
|
|
13
13
|
stack_includes: [laravel, php]
|
|
14
14
|
active:
|
|
15
|
+
- codebase-memory
|
|
15
16
|
- arka-prompts
|
|
16
17
|
- obsidian
|
|
17
18
|
- context7
|
|
@@ -42,6 +43,7 @@ policies:
|
|
|
42
43
|
- match:
|
|
43
44
|
stack_includes: [nuxt, vue]
|
|
44
45
|
active:
|
|
46
|
+
- codebase-memory
|
|
45
47
|
- arka-prompts
|
|
46
48
|
- obsidian
|
|
47
49
|
- context7
|
|
@@ -72,6 +74,7 @@ policies:
|
|
|
72
74
|
- match:
|
|
73
75
|
stack_includes: [next, react]
|
|
74
76
|
active:
|
|
77
|
+
- codebase-memory
|
|
75
78
|
- arka-prompts
|
|
76
79
|
- obsidian
|
|
77
80
|
- context7
|
|
@@ -111,6 +114,7 @@ policies:
|
|
|
111
114
|
- mirakl
|
|
112
115
|
- sentry
|
|
113
116
|
deferred:
|
|
117
|
+
- codebase-memory
|
|
114
118
|
- memory-bank
|
|
115
119
|
- postgres
|
|
116
120
|
- supabase
|
|
@@ -132,6 +136,7 @@ policies:
|
|
|
132
136
|
- match:
|
|
133
137
|
stack_includes: [python]
|
|
134
138
|
active:
|
|
139
|
+
- codebase-memory
|
|
135
140
|
- arka-prompts
|
|
136
141
|
- obsidian
|
|
137
142
|
- context7
|
|
@@ -169,6 +174,7 @@ policies:
|
|
|
169
174
|
- firecrawl
|
|
170
175
|
- clickup
|
|
171
176
|
deferred:
|
|
177
|
+
- codebase-memory
|
|
172
178
|
- memory-bank
|
|
173
179
|
- gh-grep
|
|
174
180
|
- postgres
|
|
@@ -198,6 +204,7 @@ policies:
|
|
|
198
204
|
- canva
|
|
199
205
|
- firecrawl
|
|
200
206
|
deferred:
|
|
207
|
+
- codebase-memory
|
|
201
208
|
- memory-bank
|
|
202
209
|
- gh-grep
|
|
203
210
|
- postgres
|
|
@@ -227,6 +234,7 @@ policies:
|
|
|
227
234
|
- context7
|
|
228
235
|
- gh-grep
|
|
229
236
|
deferred:
|
|
237
|
+
- codebase-memory
|
|
230
238
|
- memory-bank
|
|
231
239
|
- postgres
|
|
232
240
|
- supabase
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ArkaOS
|
|
3
|
+
description: ArkaOS Operating System personality — squad-driven, framework-backed, branded responses
|
|
4
|
+
keep-coding-instructions: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# ArkaOS Output Style
|
|
8
|
+
|
|
9
|
+
You are operating as ArkaOS — the Operating System for AI Agent Teams. You orchestrate the ArkaOS specialized agent departments.
|
|
10
|
+
|
|
11
|
+
## Core Behavior
|
|
12
|
+
|
|
13
|
+
- Every request routes through the appropriate department squad. Never respond as a generic assistant.
|
|
14
|
+
- Use framework-backed reasoning: cite the framework behind your recommendations (SOLID, StoryBrand, Porter's Five Forces, AARRR, etc.)
|
|
15
|
+
- Apply critical thinking before executing. Ask clarifying questions when intent is ambiguous.
|
|
16
|
+
- Quality Gate mindset: everything you produce should be production-ready, reviewed, and validated.
|
|
17
|
+
|
|
18
|
+
## Challenge the User
|
|
19
|
+
|
|
20
|
+
- When the user's request is technically wrong, mathematically impossible,
|
|
21
|
+
or would ship a worse product, challenge it BEFORE executing — pushback
|
|
22
|
+
protocol, constitution rule `arkaos-not-yes-man`.
|
|
23
|
+
- Ground the challenge in evidence or a reference company (Stripe, Linear,
|
|
24
|
+
Vercel, Notion…), never in opinion alone.
|
|
25
|
+
- Insistence is not new evidence: never grow more agreeable under pressure.
|
|
26
|
+
If the user directs execution anyway, execute under explicit objection,
|
|
27
|
+
on record.
|
|
28
|
+
- Apply the same standard to agents and subagents: judge their plans and
|
|
29
|
+
outputs adversarially — delivering fast is worthless when the solution
|
|
30
|
+
is wrong.
|
|
31
|
+
|
|
32
|
+
## Response Style
|
|
33
|
+
|
|
34
|
+
- Be direct and concise. Lead with the action or answer, not preamble.
|
|
35
|
+
- When routing to a department, announce it: "Routing to [Department] — [Lead Agent] coordinating."
|
|
36
|
+
- Use structured output: headers, tables, bullet points. No walls of text.
|
|
37
|
+
- For code: follow SOLID principles, clean code, conventional commits.
|
|
38
|
+
- For content: human-quality writing, no AI cliches, culturally appropriate for the target market.
|
|
39
|
+
|
|
40
|
+
## Squad Awareness
|
|
41
|
+
|
|
42
|
+
When handling requests, think in squads:
|
|
43
|
+
- Who is the department lead for this domain?
|
|
44
|
+
- Which specialists should execute?
|
|
45
|
+
- Does this need cross-department collaboration?
|
|
46
|
+
- Does this need Quality Gate review?
|
|
47
|
+
|
|
48
|
+
## Language
|
|
49
|
+
|
|
50
|
+
- Match the user's language (Portuguese or English).
|
|
51
|
+
- When writing in Portuguese, use European Portuguese (pt-PT), never Brazilian.
|
|
52
|
+
- Technical terms can stay in English when that's the industry standard.
|
package/core/evals/__init__.py
CHANGED
|
@@ -7,13 +7,17 @@ or local-model distillation consumes.
|
|
|
7
7
|
|
|
8
8
|
from core.evals.schema import EvalTask, load_eval_tasks
|
|
9
9
|
from core.evals.verdict_labels import (
|
|
10
|
+
load_judge_labels,
|
|
10
11
|
load_verdict_labels,
|
|
12
|
+
record_judge_label,
|
|
11
13
|
record_verdict_label,
|
|
12
14
|
)
|
|
13
15
|
|
|
14
16
|
__all__ = [
|
|
15
17
|
"EvalTask",
|
|
16
18
|
"load_eval_tasks",
|
|
19
|
+
"load_judge_labels",
|
|
17
20
|
"load_verdict_labels",
|
|
21
|
+
"record_judge_label",
|
|
18
22
|
"record_verdict_label",
|
|
19
23
|
]
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/core/evals/record_cli.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
"""Record a QGVerdict as an eval label
|
|
1
|
+
"""Record a QGVerdict or gate JudgeVerdict as an eval label.
|
|
2
2
|
|
|
3
|
-
Reads the reviewer's
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
Reads the reviewer's verdict JSON from stdin (or --file) and appends it
|
|
4
|
+
to the matching label corpus (``--kind qg`` → qg-verdicts.jsonl,
|
|
5
|
+
``--kind judge`` → judge-verdicts.jsonl). Invoked by the orchestrator
|
|
6
|
+
right after a Quality Gate verdict or a gate-judge verdict lands (see
|
|
7
|
+
the Quality Gate and flow skill instructions), closing the "labels
|
|
8
|
+
gratuitos" loop from the evals ADR.
|
|
8
9
|
|
|
9
10
|
Unlike the underlying writer (telemetry contract: never raises), this
|
|
10
11
|
explicit CLI fails LOUDLY on invalid verdict JSON — a malformed label
|
|
@@ -20,13 +21,20 @@ from pathlib import Path
|
|
|
20
21
|
|
|
21
22
|
from pydantic import ValidationError
|
|
22
23
|
|
|
23
|
-
from core.evals.verdict_labels import record_verdict_label
|
|
24
|
+
from core.evals.verdict_labels import record_judge_label, record_verdict_label
|
|
25
|
+
from core.governance.judge import JudgeVerdict
|
|
24
26
|
from core.governance.qg_verdict import QGVerdict
|
|
25
27
|
|
|
26
28
|
|
|
27
29
|
def main(argv: list[str] | None = None) -> int:
|
|
28
30
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
29
31
|
parser.add_argument("--file", help="verdict JSON file (default: stdin)")
|
|
32
|
+
parser.add_argument(
|
|
33
|
+
"--kind",
|
|
34
|
+
choices=("qg", "judge"),
|
|
35
|
+
default="qg",
|
|
36
|
+
help="qg = QGVerdict (default); judge = gate JudgeVerdict (PR2)",
|
|
37
|
+
)
|
|
30
38
|
parser.add_argument("--deliverable", default="")
|
|
31
39
|
parser.add_argument("--department", default="")
|
|
32
40
|
parser.add_argument("--eval-task-id", default="")
|
|
@@ -38,12 +46,17 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
38
46
|
if args.file
|
|
39
47
|
else sys.stdin.read()
|
|
40
48
|
)
|
|
49
|
+
if args.kind == "judge":
|
|
50
|
+
return _record_judge(raw, args)
|
|
51
|
+
return _record_qg(raw, args)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _record_qg(raw: str, args: argparse.Namespace) -> int:
|
|
41
55
|
try:
|
|
42
56
|
verdict = QGVerdict.model_validate(json.loads(raw))
|
|
43
57
|
except (json.JSONDecodeError, ValidationError) as exc:
|
|
44
58
|
print(f"error: invalid QGVerdict JSON — {exc}", file=sys.stderr)
|
|
45
59
|
return 1
|
|
46
|
-
|
|
47
60
|
record_verdict_label(
|
|
48
61
|
verdict,
|
|
49
62
|
deliverable=args.deliverable,
|
|
@@ -59,5 +72,25 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
59
72
|
return 0
|
|
60
73
|
|
|
61
74
|
|
|
75
|
+
def _record_judge(raw: str, args: argparse.Namespace) -> int:
|
|
76
|
+
try:
|
|
77
|
+
verdict = JudgeVerdict.model_validate(json.loads(raw))
|
|
78
|
+
except (json.JSONDecodeError, ValidationError) as exc:
|
|
79
|
+
print(f"error: invalid JudgeVerdict JSON — {exc}", file=sys.stderr)
|
|
80
|
+
return 1
|
|
81
|
+
record_judge_label(
|
|
82
|
+
verdict,
|
|
83
|
+
deliverable=args.deliverable,
|
|
84
|
+
department=args.department,
|
|
85
|
+
session_id=args.session_id,
|
|
86
|
+
)
|
|
87
|
+
print(json.dumps({
|
|
88
|
+
"recorded": True,
|
|
89
|
+
"verdict": verdict.verdict,
|
|
90
|
+
"gate": verdict.gate,
|
|
91
|
+
}))
|
|
92
|
+
return 0
|
|
93
|
+
|
|
94
|
+
|
|
62
95
|
if __name__ == "__main__":
|
|
63
96
|
raise SystemExit(main())
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
"""QG verdicts as free eval labels.
|
|
2
|
-
|
|
3
|
-
Every Quality Gate review
|
|
4
|
-
(
|
|
5
|
-
each review into a labeled example — the training/eval signal the
|
|
6
|
-
audit called "labels gratuitos".
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"""QG and gate-judge verdicts as free eval labels.
|
|
2
|
+
|
|
3
|
+
Every Quality Gate review produces a structured ``QGVerdict`` and every
|
|
4
|
+
gate judge (Interaction Reform PR2) a ``JudgeVerdict``. Persisting them
|
|
5
|
+
turns each review into a labeled example — the training/eval signal the
|
|
6
|
+
E2E audit called "labels gratuitos". Two corpora, one module:
|
|
7
|
+
``qg-verdicts.jsonl`` and ``judge-verdicts.jsonl``. Append-only JSONL,
|
|
8
|
+
same conventions as the other ``~/.arkaos/telemetry`` writers: never
|
|
9
|
+
raises, fcntl advisory lock via ``llm_cost_telemetry._locked_append``
|
|
10
|
+
(reviews run as parallel subagents and verdict lines far exceed
|
|
11
|
+
atomic-write sizes, so unlocked appends could interleave and corrupt
|
|
12
|
+
the corpus), ``ARKA_QG_LABELS_PATH`` / ``ARKA_JUDGE_LABELS_PATH``
|
|
13
|
+
overrides for tests.
|
|
12
14
|
"""
|
|
13
15
|
|
|
14
16
|
from __future__ import annotations
|
|
@@ -19,12 +21,16 @@ from datetime import datetime, timezone
|
|
|
19
21
|
from pathlib import Path
|
|
20
22
|
from typing import Any
|
|
21
23
|
|
|
24
|
+
from core.governance.judge import JudgeVerdict
|
|
22
25
|
from core.governance.qg_verdict import QGVerdict
|
|
23
26
|
from core.runtime.llm_cost_telemetry import _locked_append
|
|
24
27
|
|
|
25
28
|
DEFAULT_LABELS_PATH = (
|
|
26
29
|
Path.home() / ".arkaos" / "telemetry" / "qg-verdicts.jsonl"
|
|
27
30
|
)
|
|
31
|
+
DEFAULT_JUDGE_LABELS_PATH = (
|
|
32
|
+
Path.home() / ".arkaos" / "telemetry" / "judge-verdicts.jsonl"
|
|
33
|
+
)
|
|
28
34
|
|
|
29
35
|
|
|
30
36
|
def _labels_path() -> Path:
|
|
@@ -32,6 +38,11 @@ def _labels_path() -> Path:
|
|
|
32
38
|
return Path(override) if override else DEFAULT_LABELS_PATH
|
|
33
39
|
|
|
34
40
|
|
|
41
|
+
def _judge_labels_path() -> Path:
|
|
42
|
+
override = os.environ.get("ARKA_JUDGE_LABELS_PATH", "").strip()
|
|
43
|
+
return Path(override) if override else DEFAULT_JUDGE_LABELS_PATH
|
|
44
|
+
|
|
45
|
+
|
|
35
46
|
def record_verdict_label(
|
|
36
47
|
verdict: QGVerdict,
|
|
37
48
|
deliverable: str = "",
|
|
@@ -55,9 +66,38 @@ def record_verdict_label(
|
|
|
55
66
|
return
|
|
56
67
|
|
|
57
68
|
|
|
69
|
+
def record_judge_label(
|
|
70
|
+
verdict: JudgeVerdict,
|
|
71
|
+
deliverable: str = "",
|
|
72
|
+
department: str = "",
|
|
73
|
+
session_id: str = "",
|
|
74
|
+
) -> None:
|
|
75
|
+
"""Append one labeled gate-judge example. Never raises."""
|
|
76
|
+
try:
|
|
77
|
+
entry: dict[str, Any] = {
|
|
78
|
+
"ts": datetime.now(timezone.utc).isoformat(),
|
|
79
|
+
"deliverable": str(deliverable or ""),
|
|
80
|
+
"department": str(department or ""),
|
|
81
|
+
"session_id": str(session_id or ""),
|
|
82
|
+
**verdict.model_dump(),
|
|
83
|
+
}
|
|
84
|
+
with _locked_append(_judge_labels_path()) as fh:
|
|
85
|
+
fh.write(json.dumps(entry, ensure_ascii=False) + "\n")
|
|
86
|
+
except Exception: # noqa: BLE001 — telemetry must never raise
|
|
87
|
+
return
|
|
88
|
+
|
|
89
|
+
|
|
58
90
|
def load_verdict_labels(path: Path | None = None) -> list[dict[str, Any]]:
|
|
59
|
-
"""Read all labeled examples; malformed lines are skipped."""
|
|
60
|
-
|
|
91
|
+
"""Read all labeled QG examples; malformed lines are skipped."""
|
|
92
|
+
return _load_jsonl(path or _labels_path())
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def load_judge_labels(path: Path | None = None) -> list[dict[str, Any]]:
|
|
96
|
+
"""Read all labeled gate-judge examples; malformed lines are skipped."""
|
|
97
|
+
return _load_jsonl(path or _judge_labels_path())
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def _load_jsonl(target: Path) -> list[dict[str, Any]]:
|
|
61
101
|
if not target.exists():
|
|
62
102
|
return []
|
|
63
103
|
out: list[dict[str, Any]] = []
|
|
Binary file
|
package/core/forge/complexity.py
CHANGED
|
@@ -107,6 +107,15 @@ def _score_ambiguity(prompt: str, files: list[str]) -> int:
|
|
|
107
107
|
return max(0, min(100, score))
|
|
108
108
|
|
|
109
109
|
|
|
110
|
+
def score_prompt_ambiguity(prompt: str, files: list[str] | None = None) -> int:
|
|
111
|
+
"""Public 0-100 vagueness score for a user prompt.
|
|
112
|
+
|
|
113
|
+
Consumed by the UserPromptSubmit hook to suggest `/arka refine`
|
|
114
|
+
(Interaction Reform PR5) — regex-only, no I/O, hook-budget safe.
|
|
115
|
+
"""
|
|
116
|
+
return _score_ambiguity(prompt or "", files or [])
|
|
117
|
+
|
|
118
|
+
|
|
110
119
|
def _score_risk(prompt: str, files: list[str]) -> int:
|
|
111
120
|
score = 20
|
|
112
121
|
risk_matches = len(_RISK_KEYWORDS.findall(prompt))
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|