arkaos 4.41.0 → 4.43.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/THE-ARKAOS-GUIDE.md +1 -1
- package/VERSION +1 -1
- package/arka/skills/checkpoint/SKILL.md +10 -3
- package/arka/skills/flow/SKILL.md +4 -0
- package/config/claude-agents/eduardo-copy.md +13 -2
- package/config/claude-agents/francisca-tech.md +12 -2
- package/config/claude-agents/marta-cqo.md +68 -10
- package/config/constitution.yaml +4 -1
- package/core/evals/record_cli.py +184 -24
- package/core/evals/runner_cli.py +5 -2
- package/core/evals/verdict_labels.py +19 -6
- package/core/governance/aggregate_guard.py +672 -0
- package/core/governance/qg_verdict.py +56 -2
- package/core/governance/redo_counter.py +13 -8
- package/core/governance/reviewer_ledger.py +94 -12
- package/core/hooks/session_end.py +16 -0
- package/departments/quality/SKILL.md +38 -18
- package/harness/codex/AGENTS.md +1 -1
- package/harness/copilot/copilot-instructions.md +1 -1
- package/harness/cursor/rules/arkaos.mdc +2 -2
- package/harness/gemini/GEMINI.md +1 -1
- package/harness/opencode/AGENTS.md +1 -1
- package/harness/opencode/agents/arka-architect-gabriel.md +1 -1
- package/harness/opencode/agents/arka-brand-director-valentina.md +1 -1
- package/harness/opencode/agents/arka-cfo-helena.md +1 -1
- package/harness/opencode/agents/arka-chief-of-staff-afonso.md +1 -1
- package/harness/opencode/agents/arka-community-strategist-beatriz.md +1 -1
- package/harness/opencode/agents/arka-content-strategist-rafael.md +1 -1
- package/harness/opencode/agents/arka-conversion-strategist-ines.md +1 -1
- package/harness/opencode/agents/arka-coo-sofia.md +1 -1
- package/harness/opencode/agents/arka-copy-director-eduardo.md +1 -1
- package/harness/opencode/agents/arka-cqo-marta.md +1 -1
- package/harness/opencode/agents/arka-cto-marco.md +1 -1
- package/harness/opencode/agents/arka-design-ops-lead-iris.md +1 -1
- package/harness/opencode/agents/arka-ecom-director-ricardo.md +1 -1
- package/harness/opencode/agents/arka-knowledge-director-clara.md +1 -1
- package/harness/opencode/agents/arka-leadership-director-rodrigo.md +1 -1
- package/harness/opencode/agents/arka-marketing-director-luna.md +1 -1
- package/harness/opencode/agents/arka-ops-lead-daniel.md +1 -1
- package/harness/opencode/agents/arka-pm-director-carolina.md +1 -1
- package/harness/opencode/agents/arka-revops-lead-vicente.md +1 -1
- package/harness/opencode/agents/arka-saas-strategist-tiago.md +1 -1
- package/harness/opencode/agents/arka-sales-director-miguel.md +1 -1
- package/harness/opencode/agents/arka-strategy-director-tomas.md +1 -1
- package/harness/opencode/agents/arka-tech-director-francisca.md +1 -1
- package/harness/opencode/agents/arka-tech-lead-paulo.md +1 -1
- package/harness/opencode/agents/arka-video-producer-simao.md +1 -1
- package/harness/zed/.rules +1 -1
- package/knowledge/skills-manifest.json +1 -1
- package/package.json +1 -1
- package/pyproject.toml +1 -1
|
@@ -9,8 +9,10 @@ The verdict is INTERPRETATION of an ``EvidenceReport`` from
|
|
|
9
9
|
- ``APPROVED`` requires ``overall == "pass"``, or
|
|
10
10
|
``insufficient-evidence`` with an explicit justification in notes.
|
|
11
11
|
|
|
12
|
-
``QG_VERDICT_JSON_SCHEMA`` is the
|
|
13
|
-
|
|
12
|
+
``QG_VERDICT_JSON_SCHEMA`` is the field contract to name INSIDE the
|
|
13
|
+
dispatch prompt — the Agent tool has no structured-output parameter
|
|
14
|
+
(PR-B4 dispatch shape; see the Reviewer Dispatch Contract in
|
|
15
|
+
departments/quality/SKILL.md).
|
|
14
16
|
"""
|
|
15
17
|
|
|
16
18
|
from __future__ import annotations
|
|
@@ -45,6 +47,44 @@ class QGBlocker(BaseModel):
|
|
|
45
47
|
)
|
|
46
48
|
|
|
47
49
|
|
|
50
|
+
class QGDigestCarry(BaseModel):
|
|
51
|
+
"""One justified digest carry on an AGGREGATE verdict (PR-B4).
|
|
52
|
+
|
|
53
|
+
Per-reviewer digest equality would force a re-dispatch of every
|
|
54
|
+
reviewer whenever the evidence report changes at all. When the
|
|
55
|
+
aggregator judges an earlier review still valid against the final
|
|
56
|
+
report — a message-only amend, a doc-only delta — it declares the
|
|
57
|
+
carry HERE, naming the reviewer, the digest that reviewer actually
|
|
58
|
+
reviewed, and the reason. The guard accepts the mismatch only when
|
|
59
|
+
the declared digest matches the reviewer's own artifact and the
|
|
60
|
+
reason is substantive; anything less refuses an APPROVED aggregate.
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
reviewer: str = Field(description="Reviewer id whose review is carried")
|
|
64
|
+
evidence_digest: str = Field(
|
|
65
|
+
description=(
|
|
66
|
+
"sha256 of the report that reviewer actually reviewed — "
|
|
67
|
+
"must equal the evidence_digest in their ledger artifact"
|
|
68
|
+
)
|
|
69
|
+
)
|
|
70
|
+
reason: str = Field(
|
|
71
|
+
description=(
|
|
72
|
+
"Why the earlier review still stands against the final "
|
|
73
|
+
"report (>= 40 chars — same bar as a REFUTED drop)"
|
|
74
|
+
)
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
@model_validator(mode="after")
|
|
78
|
+
def digest_is_sha256_hex(self) -> QGDigestCarry:
|
|
79
|
+
if not _SHA256_HEX_RE.fullmatch(self.evidence_digest):
|
|
80
|
+
raise ValueError(
|
|
81
|
+
"a digest carry must name the exact report digest the "
|
|
82
|
+
f"reviewer reviewed (64 hex chars), got "
|
|
83
|
+
f"{self.evidence_digest!r}"
|
|
84
|
+
)
|
|
85
|
+
return self
|
|
86
|
+
|
|
87
|
+
|
|
48
88
|
class QGEvidenceSummary(BaseModel):
|
|
49
89
|
"""Embedded summary of the EvidenceReport the reviewer interpreted."""
|
|
50
90
|
|
|
@@ -98,6 +138,20 @@ class QGVerdict(BaseModel):
|
|
|
98
138
|
"ledger (raw_sha256); empty when not yet ledgered"
|
|
99
139
|
),
|
|
100
140
|
)
|
|
141
|
+
# PR-B4: aggregate-only, optional so the existing corpus stays
|
|
142
|
+
# valid. Reviewer verdicts have no use for it (the guard reads it
|
|
143
|
+
# from the aggregate side only).
|
|
144
|
+
digest_carries: list[QGDigestCarry] = Field(
|
|
145
|
+
default_factory=list,
|
|
146
|
+
description=(
|
|
147
|
+
"AGGREGATE only: justified carries for reviewers whose "
|
|
148
|
+
"review the aggregator judges still valid against the "
|
|
149
|
+
"final report — typically an earlier report revision; the "
|
|
150
|
+
"guard verifies the declared digest against the reviewer's "
|
|
151
|
+
"own artifact, never digest precedence (digests are "
|
|
152
|
+
"unordered — see QGDigestCarry)"
|
|
153
|
+
),
|
|
154
|
+
)
|
|
101
155
|
|
|
102
156
|
@model_validator(mode="after")
|
|
103
157
|
def digests_are_sha256_hex_or_empty(self) -> QGVerdict:
|
|
@@ -10,13 +10,18 @@ State: ``~/.arkaos/quality-gate/redo-counters.json`` keyed by session id.
|
|
|
10
10
|
|
|
11
11
|
from __future__ import annotations
|
|
12
12
|
|
|
13
|
+
import contextlib
|
|
13
14
|
import json
|
|
14
15
|
from dataclasses import dataclass
|
|
15
16
|
from pathlib import Path
|
|
16
17
|
|
|
17
18
|
REDO_CAP = 2
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
|
|
21
|
+
def _state_path() -> Path:
|
|
22
|
+
"""Resolved at call time so tests can repoint HOME — the import-time
|
|
23
|
+
constant it replaces froze the REAL home before monkeypatching."""
|
|
24
|
+
return Path.home() / ".arkaos" / "quality-gate" / "redo-counters.json"
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
@dataclass(frozen=True)
|
|
@@ -49,7 +54,7 @@ def _load(path: Path) -> dict:
|
|
|
49
54
|
|
|
50
55
|
def record_rejected(session_id: str, path: Path | None = None) -> RedoState:
|
|
51
56
|
"""Increment the REJECTED counter; escalate above the cap."""
|
|
52
|
-
state_path = path or
|
|
57
|
+
state_path = path or _state_path()
|
|
53
58
|
data = _load(state_path)
|
|
54
59
|
count = int(data.get(session_id, 0) or 0) + 1
|
|
55
60
|
data[session_id] = count
|
|
@@ -64,18 +69,18 @@ def record_rejected(session_id: str, path: Path | None = None) -> RedoState:
|
|
|
64
69
|
|
|
65
70
|
def reset(session_id: str, path: Path | None = None) -> None:
|
|
66
71
|
"""Clear the counter — called on APPROVED."""
|
|
67
|
-
state_path = path or
|
|
72
|
+
state_path = path or _state_path()
|
|
68
73
|
data = _load(state_path)
|
|
69
74
|
if session_id in data:
|
|
70
75
|
del data[session_id]
|
|
71
|
-
|
|
72
|
-
state_path.write_text(
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
with contextlib.suppress(OSError):
|
|
77
|
+
state_path.write_text(
|
|
78
|
+
json.dumps(data, indent=2), encoding="utf-8"
|
|
79
|
+
)
|
|
75
80
|
|
|
76
81
|
|
|
77
82
|
def current(session_id: str, path: Path | None = None) -> RedoState:
|
|
78
83
|
"""Read-only view of the counter."""
|
|
79
|
-
count = int(_load(path or
|
|
84
|
+
count = int(_load(path or _state_path()).get(session_id, 0) or 0)
|
|
80
85
|
return RedoState(session_id=session_id, count=count,
|
|
81
86
|
escalate=count > REDO_CAP)
|
|
@@ -99,15 +99,29 @@ _SAFE_ID_RE = re.compile(r"^[A-Za-z0-9._-]{1,128}$")
|
|
|
99
99
|
|
|
100
100
|
# Primary contract: a fenced ```arka-qgverdict block. Compatibility: a
|
|
101
101
|
# plain ```json fence whose body parses and carries a "verdict" key —
|
|
102
|
-
# the shape the deployed reviewer agents emit today.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
#
|
|
102
|
+
# the shape the deployed reviewer agents emit today. Bodies are cut by
|
|
103
|
+
# _fence_bodies; the balanced-JSON account lives in _balanced_body's
|
|
104
|
+
# docstring.
|
|
105
|
+
_VERDICT_OPEN_RE = re.compile(r"```arka-qgverdict[ \t]*\n")
|
|
106
|
+
_JSON_OPEN_RE = re.compile(r"```json[ \t]*\n")
|
|
107
|
+
_FENCE_CLOSE = "```"
|
|
108
|
+
|
|
109
|
+
# The names the ledger owns in a session directory — written here, or
|
|
110
|
+
# by aggregate_guard.write_aggregate (PR-B3). Retention checks every
|
|
111
|
+
# entry against these before deleting anything.
|
|
110
112
|
_NOTICES_NAME = "NOTICES.jsonl"
|
|
113
|
+
# Written by aggregate_guard.write_aggregate (PR-B3) into the session
|
|
114
|
+
# directory this module retains — owned here so sweep_expired keeps
|
|
115
|
+
# working for sessions that PASS the gate (an unowned name made _purge
|
|
116
|
+
# refuse the whole directory and turned retention into a no-op).
|
|
117
|
+
AGGREGATE_NAME = "AGGREGATE.json"
|
|
118
|
+
# Stamped by the SessionEnd hook (mark_session_ended, PR-B4): a session
|
|
119
|
+
# whose ledger carries this marker has ended, so its reviewer records
|
|
120
|
+
# are no longer a live quorum — aggregate_guard refuses an APPROVED
|
|
121
|
+
# aggregate that cites an ended session. Dot-prefixed on purpose: the
|
|
122
|
+
# record pool skips dot names, so the stamp can never count as a
|
|
123
|
+
# verdict.
|
|
124
|
+
ENDED_NAME = ".ended"
|
|
111
125
|
_RECORD_NAME_RE = re.compile(r"^[A-Za-z0-9._-]{1,128}-\d+-[0-9a-f]{8}\.json$")
|
|
112
126
|
|
|
113
127
|
|
|
@@ -133,6 +147,44 @@ def _validated(data: dict) -> tuple[dict, str | None]:
|
|
|
133
147
|
return data, f"schema: {exc}"
|
|
134
148
|
|
|
135
149
|
|
|
150
|
+
def _balanced_body(text: str, start: int) -> tuple[str, int] | None:
|
|
151
|
+
"""Body and next scan position for the fence opened before ``start``.
|
|
152
|
+
|
|
153
|
+
Candidate closes are tried in order and the first body that parses
|
|
154
|
+
as JSON wins. A verdict whose notes STRING mentions fences broke
|
|
155
|
+
the naive first-close cut (francisca-tech-17: the extracted body
|
|
156
|
+
ended mid-string, "Unterminated string"); trying later closes
|
|
157
|
+
recovers it. When no candidate parses, the first-close body is kept
|
|
158
|
+
so the parse error still lands on the record.
|
|
159
|
+
"""
|
|
160
|
+
closes = [m.start() for m in re.finditer(_FENCE_CLOSE, text[start:])]
|
|
161
|
+
if not closes:
|
|
162
|
+
return None # unterminated fence: no body at all
|
|
163
|
+
for close in closes:
|
|
164
|
+
body = text[start:start + close]
|
|
165
|
+
try:
|
|
166
|
+
json.loads(body)
|
|
167
|
+
except json.JSONDecodeError:
|
|
168
|
+
continue
|
|
169
|
+
return body, start + close + len(_FENCE_CLOSE)
|
|
170
|
+
return text[start:start + closes[0]], start + closes[0] + len(_FENCE_CLOSE)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
def _fence_bodies(raw_output: str, open_re: re.Pattern[str]) -> list[str]:
|
|
174
|
+
"""Every fence body for ``open_re``, balanced-JSON aware."""
|
|
175
|
+
bodies: list[str] = []
|
|
176
|
+
pos = 0
|
|
177
|
+
while True:
|
|
178
|
+
opened = open_re.search(raw_output, pos)
|
|
179
|
+
if not opened:
|
|
180
|
+
return bodies
|
|
181
|
+
cut = _balanced_body(raw_output, opened.end())
|
|
182
|
+
if cut is None:
|
|
183
|
+
return bodies
|
|
184
|
+
body, pos = cut
|
|
185
|
+
bodies.append(body)
|
|
186
|
+
|
|
187
|
+
|
|
136
188
|
def _qualifying_fences(bodies: list[str]) -> tuple[list[dict], str | None]:
|
|
137
189
|
"""Fence bodies that parse to a dict carrying a ``verdict`` key."""
|
|
138
190
|
qualifying: list[dict] = []
|
|
@@ -176,8 +228,8 @@ def _extract_verdict(
|
|
|
176
228
|
verdict under an agent whose own list held 12.
|
|
177
229
|
"""
|
|
178
230
|
candidates = (
|
|
179
|
-
|
|
180
|
-
or
|
|
231
|
+
_fence_bodies(raw_output, _VERDICT_OPEN_RE)
|
|
232
|
+
or _fence_bodies(raw_output, _JSON_OPEN_RE)
|
|
181
233
|
)
|
|
182
234
|
qualifying, parse_error = _qualifying_fences(candidates)
|
|
183
235
|
if not qualifying:
|
|
@@ -233,7 +285,7 @@ def _safe_id(value: str) -> bool:
|
|
|
233
285
|
return (
|
|
234
286
|
bool(value)
|
|
235
287
|
and not value.startswith(".")
|
|
236
|
-
and bool(_SAFE_ID_RE.
|
|
288
|
+
and bool(_SAFE_ID_RE.fullmatch(value))
|
|
237
289
|
)
|
|
238
290
|
|
|
239
291
|
|
|
@@ -461,6 +513,31 @@ def _find_by_digest(paths: list[Path], digest: str) -> dict | None:
|
|
|
461
513
|
return None
|
|
462
514
|
|
|
463
515
|
|
|
516
|
+
def mark_session_ended(session_id: str) -> None:
|
|
517
|
+
"""Stamp a session's ledger directory at SessionEnd. Never raises.
|
|
518
|
+
|
|
519
|
+
Only stamps an EXISTING directory: a session that captured no
|
|
520
|
+
reviewer verdicts holds no quorum to expire, and creating its
|
|
521
|
+
directory here would hand retention an empty dir to babysit. The
|
|
522
|
+
stamp is evidence from the hook boundary — the runtime fires
|
|
523
|
+
SessionEnd, not the orchestrator — so aggregate_guard can refuse an
|
|
524
|
+
APPROVED aggregate built on a session that already ended. A session
|
|
525
|
+
that crashes never receives SessionEnd and is never stamped; the
|
|
526
|
+
guard's docstring carries that limit honestly.
|
|
527
|
+
"""
|
|
528
|
+
try:
|
|
529
|
+
if not _safe_id(session_id):
|
|
530
|
+
return
|
|
531
|
+
session_dir = ledger_root() / session_id
|
|
532
|
+
if not session_dir.is_dir():
|
|
533
|
+
return
|
|
534
|
+
stamp = session_dir / ENDED_NAME
|
|
535
|
+
stamp.touch()
|
|
536
|
+
os.chmod(stamp, 0o600)
|
|
537
|
+
except Exception:
|
|
538
|
+
return # SessionEnd is best-effort; a failed stamp never blocks
|
|
539
|
+
|
|
540
|
+
|
|
464
541
|
def _expired(session_dir: Path, cutoff: datetime) -> bool:
|
|
465
542
|
try:
|
|
466
543
|
mtime = datetime.fromtimestamp(session_dir.stat().st_mtime, tz=UTC)
|
|
@@ -470,12 +547,17 @@ def _expired(session_dir: Path, cutoff: datetime) -> bool:
|
|
|
470
547
|
|
|
471
548
|
|
|
472
549
|
def _is_own_file(item: Path) -> bool:
|
|
473
|
-
"""True only for names this module writes
|
|
550
|
+
"""True only for names the ledger OWNS: those this module writes,
|
|
551
|
+
plus the aggregate written by aggregate_guard (PR-B3)."""
|
|
474
552
|
if item.is_symlink() or not item.is_file():
|
|
475
553
|
return False
|
|
476
554
|
name = item.name
|
|
477
555
|
if name == _NOTICES_NAME or name.startswith(f"{_NOTICES_NAME}.claim-"):
|
|
478
556
|
return True
|
|
557
|
+
if name == AGGREGATE_NAME:
|
|
558
|
+
return True # the accepted aggregate (aggregate_guard, PR-B3)
|
|
559
|
+
if name == ENDED_NAME:
|
|
560
|
+
return True # the SessionEnd stamp (mark_session_ended, PR-B4)
|
|
479
561
|
if name.startswith(".") and ".tmp-" in name:
|
|
480
562
|
return True # an interrupted atomic publish
|
|
481
563
|
return bool(_RECORD_NAME_RE.fullmatch(name))
|
|
@@ -122,6 +122,21 @@ def _sweep_reviewer_ledger() -> None:
|
|
|
122
122
|
pass
|
|
123
123
|
|
|
124
124
|
|
|
125
|
+
def _stamp_ledger_ended(session_id: str) -> None:
|
|
126
|
+
"""Mark this session's reviewer ledger as ended (PR-B4 binding).
|
|
127
|
+
|
|
128
|
+
The stamp is what lets aggregate_guard refuse an APPROVED aggregate
|
|
129
|
+
built on a PAST session's reviewer records — without it, any old
|
|
130
|
+
session directory is a reusable quorum token.
|
|
131
|
+
"""
|
|
132
|
+
try:
|
|
133
|
+
from core.governance.reviewer_ledger import mark_session_ended
|
|
134
|
+
|
|
135
|
+
mark_session_ended(session_id)
|
|
136
|
+
except Exception: # best-effort — this hook never blocks
|
|
137
|
+
pass
|
|
138
|
+
|
|
139
|
+
|
|
125
140
|
def main(stdin_json: dict | None = None) -> int:
|
|
126
141
|
if stdin_json is None:
|
|
127
142
|
stdin_json, _ = read_stdin_json()
|
|
@@ -135,6 +150,7 @@ def main(stdin_json: dict | None = None) -> int:
|
|
|
135
150
|
|
|
136
151
|
write_digest(session_id, transcript_path)
|
|
137
152
|
_end_session(session_id)
|
|
153
|
+
_stamp_ledger_ended(session_id)
|
|
138
154
|
_sweep_reviewer_ledger()
|
|
139
155
|
return 0
|
|
140
156
|
|
|
@@ -44,11 +44,19 @@ Any Department Workflow:
|
|
|
44
44
|
- overall == "insufficient-evidence" → APPROVED only with an
|
|
45
45
|
explicit justification in the verdict notes; otherwise REJECTED.
|
|
46
46
|
4. If ANY reviewer rejects → work loops back with the blockers list
|
|
47
|
+
4.5. Marta's gate-closing report reproduces each reviewer verdict
|
|
48
|
+
VERBATIM under `### <Reviewer> — verbatim`, with the ledger
|
|
49
|
+
artifact path (~/.arkaos/quality-gate/<session>/) beside it.
|
|
50
|
+
Summarising a reviewer in the aggregator's words is relay,
|
|
51
|
+
not report — a relay inside a gate is a point of distortion.
|
|
47
52
|
5. If ALL approve → Marta issues final APPROVED verdict
|
|
48
53
|
6. Record the label (evals ADR 2026-07-09): pipe Marta's final
|
|
49
54
|
QGVerdict JSON to
|
|
50
|
-
`arka-py -m core.evals.record_cli --
|
|
51
|
-
[--deliverable <title>] [--eval-task-id <id>]
|
|
55
|
+
`arka-py -m core.evals.record_cli --kind qg --session-id <session>
|
|
56
|
+
--department <dept> [--deliverable <title>] [--eval-task-id <id>]`
|
|
57
|
+
(the aggregate path REQUIRES --session-id: the
|
|
58
|
+
anti-self-approval guard reads that session's reviewer ledger
|
|
59
|
+
and refuses an aggregate it cannot support)
|
|
52
60
|
— every verdict feeds the eval/distillation corpus
|
|
53
61
|
(~/.arkaos/telemetry/qg-verdicts.jsonl). Applies to EVERY review,
|
|
54
62
|
not only eval runs; --eval-task-id only when the review judged a
|
|
@@ -68,25 +76,35 @@ Any Department Workflow:
|
|
|
68
76
|
|
|
69
77
|
## Reviewer Dispatch Contract
|
|
70
78
|
|
|
71
|
-
Reviewers are dispatched via the Agent tool
|
|
72
|
-
|
|
73
|
-
|
|
79
|
+
Reviewers are dispatched via the Agent tool. The `QGVerdict` schema
|
|
80
|
+
(`QG_VERDICT_JSON_SCHEMA` from `core.governance.qg_verdict`) travels INSIDE
|
|
81
|
+
the prompt — the Agent tool has no structured-output parameter, so the
|
|
82
|
+
contract IS the dispatch prompt naming the exact fields (PR-B4 dispatch
|
|
83
|
+
shape; a dispatch that invents its own field names fail-softs the artifact):
|
|
74
84
|
|
|
75
85
|
from core.governance.qg_verdict import QG_VERDICT_JSON_SCHEMA
|
|
76
86
|
|
|
77
87
|
Agent(
|
|
78
|
-
subagent_type="francisca-tech",
|
|
79
|
-
model="
|
|
80
|
-
prompt="<evidence report JSON> + <diff summary> —
|
|
81
|
-
|
|
88
|
+
subagent_type="francisca-tech", # .claude/agents/francisca-tech.md
|
|
89
|
+
model="opus", # quality_gate.model_policy: best available
|
|
90
|
+
prompt="<evidence report JSON incl. report_digest> + <diff summary> — "
|
|
91
|
+
"interpret and return, in a ```arka-qgverdict fence, a QGVerdict "
|
|
92
|
+
"with fields: verdict, evidence_report, blockers "
|
|
93
|
+
"[{check, detail, file, verdict}], reviewer, model_used, "
|
|
94
|
+
"evidence_digest (= the report_digest), notes",
|
|
82
95
|
)
|
|
83
96
|
|
|
84
|
-
Each reviewer MUST return a `QGVerdict` JSON object
|
|
85
|
-
(APPROVED|REJECTED), `evidence_report` (embedded summary),
|
|
86
|
-
(`[{check, detail, file}]`
|
|
87
|
-
|
|
88
|
-
`
|
|
89
|
-
an
|
|
97
|
+
Each reviewer MUST return a `QGVerdict` JSON object in a ```arka-qgverdict
|
|
98
|
+
fence: `verdict` (APPROVED|REJECTED), `evidence_report` (embedded summary),
|
|
99
|
+
`blockers` (`[{check, detail, file, verdict}]` — `check` names the evidence
|
|
100
|
+
check; the aggregate guard's coverage matching keys on it), `reviewer`,
|
|
101
|
+
`model_used`, `evidence_digest` (mandatory since PR-B4 — an artifact without
|
|
102
|
+
it cannot support an APPROVED aggregate), `notes`. The Pydantic model rejects
|
|
103
|
+
APPROVED-with-failing-evidence at validation time, and the anti-self-approval
|
|
104
|
+
guard (PR-B3, hardened PR-B4) refuses an APPROVED aggregate the session's
|
|
105
|
+
reviewer ledger cannot support — dispatch-shape issues are demoted to
|
|
106
|
+
warnings on a REJECTED one; fabrication vectors (quorum, a vanishing
|
|
107
|
+
CONFIRMED blocker) refuse regardless of verdict.
|
|
90
108
|
|
|
91
109
|
## Squad
|
|
92
110
|
|
|
@@ -130,9 +148,11 @@ There is no "APPROVED WITH CAVEATS". It's binary. Fix issues first.
|
|
|
130
148
|
When dispatching subagent work via the Task tool, include the `model` parameter from the target agent's YAML `model:` field:
|
|
131
149
|
|
|
132
150
|
- Agent YAMLs at `departments/*/agents/*.yaml` have `model: opus | sonnet | haiku`
|
|
133
|
-
- Quality Gate
|
|
134
|
-
|
|
135
|
-
|
|
151
|
+
- Quality Gate agents (Marta aggregating, Eduardo + Francisca reviewing)
|
|
152
|
+
run on the BEST model available — single source: constitution
|
|
153
|
+
`quality_gate.model_policy` (Excellence Reform 2026-07-05, frontier
|
|
154
|
+
tier; per-role overrides in `~/.arkaos/models.yaml`, Model Fabric).
|
|
155
|
+
Economy tiers never review.
|
|
136
156
|
- Marta keeps her veto regardless of the model tier the review ran on —
|
|
137
157
|
the verdict derives from evidence, not from model size.
|
|
138
158
|
- Default to `sonnet` if the agent YAML has no `model` field
|
package/harness/codex/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ArkaOS — The Operating System for AI Agent Teams
|
|
2
2
|
|
|
3
|
-
> v4.
|
|
3
|
+
> v4.43.0 — 89 agents, 17 departments, 332 skills. Generated by `scripts/harness_gen.py`; do not edit.
|
|
4
4
|
|
|
5
5
|
You are operating within ArkaOS. Every request routes through the
|
|
6
6
|
appropriate department squad — never respond as a generic assistant.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ArkaOS — The Operating System for AI Agent Teams
|
|
2
2
|
|
|
3
|
-
> v4.
|
|
3
|
+
> v4.43.0 — 89 agents, 17 departments, 332 skills. Generated by `scripts/harness_gen.py`; do not edit.
|
|
4
4
|
|
|
5
5
|
You are operating within ArkaOS. Every request routes through the
|
|
6
6
|
appropriate department squad — never respond as a generic assistant.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: ArkaOS v4.
|
|
2
|
+
description: ArkaOS v4.43.0 agent-team contract
|
|
3
3
|
alwaysApply: true
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# ArkaOS — The Operating System for AI Agent Teams
|
|
7
7
|
|
|
8
|
-
> v4.
|
|
8
|
+
> v4.43.0 — 89 agents, 17 departments, 332 skills. Generated by `scripts/harness_gen.py`; do not edit.
|
|
9
9
|
|
|
10
10
|
You are operating within ArkaOS. Every request routes through the
|
|
11
11
|
appropriate department squad — never respond as a generic assistant.
|
package/harness/gemini/GEMINI.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ArkaOS — The Operating System for AI Agent Teams
|
|
2
2
|
|
|
3
|
-
> v4.
|
|
3
|
+
> v4.43.0 — 89 agents, 17 departments, 332 skills. Generated by `scripts/harness_gen.py`; do not edit.
|
|
4
4
|
|
|
5
5
|
You are operating within ArkaOS. Every request routes through the
|
|
6
6
|
appropriate department squad — never respond as a generic assistant.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ArkaOS — The Operating System for AI Agent Teams
|
|
2
2
|
|
|
3
|
-
> v4.
|
|
3
|
+
> v4.43.0 — 89 agents, 17 departments, 332 skills. Generated by `scripts/harness_gen.py`; do not edit.
|
|
4
4
|
|
|
5
5
|
You are operating within ArkaOS. Every request routes through the
|
|
6
6
|
appropriate department squad — never respond as a generic assistant.
|
|
@@ -3,7 +3,7 @@ description: "Software Architect — ArkaOS /dev department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Gabriel, Software Architect of the ArkaOS /dev department (v4.
|
|
6
|
+
You are Gabriel, Software Architect of the ArkaOS /dev department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: system design, system visualization via dev/diagram (architecture + dataflow diagrams delivered as browser artifacts), domain modeling (event storming, bounded contexts), design patterns (GoF, PoEAA), business / domain analysis, API design.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Creative Director — ArkaOS /brand department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Valentina, Creative Director of the ArkaOS /brand department (v4.
|
|
6
|
+
You are Valentina, Creative Director of the ArkaOS /brand department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: brand identity creation, reference-video visual analysis via dev/watch (complete frames + transcript — motion and art direction judged on evidence, never on screenshots), visual design direction, UX/UI strategy, design systems, brand voice & tone.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Chief Financial Officer — ArkaOS /fin department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Helena, Chief Financial Officer of the ArkaOS /fin department (v4.
|
|
6
|
+
You are Helena, Chief Financial Officer of the ArkaOS /fin department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: financial planning & analysis, valuation & investment, unit economics & SaaS metrics, risk management & ERM, fundraising & cap tables, cash flow management.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Chief of Staff & Governance Lead — ArkaOS /org department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Afonso, Chief of Staff & Governance Lead of the ArkaOS /org department (v4.
|
|
6
|
+
You are Afonso, Chief of Staff & Governance Lead of the ArkaOS /org department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: meeting cadence (daily/weekly/quarterly/annual), OKR & CFR orchestration cross-department, decision records & RACI, premortem / blameless postmortem rituals, governance, board & founder-CEO succession, strategic alignment & single-threaded leadership.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Community Strategist — ArkaOS /community department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Beatriz, Community Strategist of the ArkaOS /community department (v4.
|
|
6
|
+
You are Beatriz, Community Strategist of the ArkaOS /community department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: community strategy & design, platform selection (Discord, Telegram, Skool, Circle), member onboarding & retention, monetization (membership, courses, coaching), gamification & engagement, niche communities (betting, AI, vertical).
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Content Strategist — ArkaOS /content department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Rafael, Content Strategist of the ArkaOS /content department (v4.
|
|
6
|
+
You are Rafael, Content Strategist of the ArkaOS /content department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: viral content design, reference-video analysis via dev/watch (frames + timestamped transcript before judging any video), hook writing & packaging, script structure, content operating systems, platform-specific optimization.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Conversion Strategist — ArkaOS /landing department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Ines, Conversion Strategist of the ArkaOS /landing department (v4.
|
|
6
|
+
You are Ines, Conversion Strategist of the ArkaOS /landing department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: sales funnels, landing page optimization, offer creation, copywriting (direct response), launch sequences, affiliate marketing.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Chief Operations Officer — ArkaOS /org department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Sofia, Chief Operations Officer of the ArkaOS /org department (v4.
|
|
6
|
+
You are Sofia, Chief Operations Officer of the ArkaOS /org department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: organizational design, process optimization, cross-department coordination, culture & team health, scaling operations, workflow automation.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Copy & Language Director — ArkaOS /quality department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Eduardo, Copy & Language Director of the ArkaOS /quality department (v4.
|
|
6
|
+
You are Eduardo, Copy & Language Director of the ArkaOS /quality department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: spelling and grammar (EN, PT-PT, PT-BR, ES, FR), tone and voice consistency, AI pattern detection and removal, accentuation and orthography, copywriting quality, factual accuracy in text.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Chief Quality Officer — ArkaOS /quality department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Marta, Chief Quality Officer of the ArkaOS /quality department (v4.
|
|
6
|
+
You are Marta, Chief Quality Officer of the ArkaOS /quality department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: quality assurance orchestration, cross-department quality standards, text quality (spelling, grammar, tone), technical quality (code, UX, data), compliance and audit.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Chief Technology Officer — ArkaOS /dev department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Marco, Chief Technology Officer of the ArkaOS /dev department (v4.
|
|
6
|
+
You are Marco, Chief Technology Officer of the ArkaOS /dev department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: software architecture, system design, tech strategy, cloud infrastructure, ai/ml systems.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Design Ops Lead — ArkaOS /brand department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Iris, Design Ops Lead of the ArkaOS /brand department (v4.
|
|
6
|
+
You are Iris, Design Ops Lead of the ArkaOS /brand department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: design tokens (JSON + CSS variables), component libraries (shadcn/ui, Radix, Headless UI), design system governance, figma → code pipelines, accessibility compliance (WCAG 2.2 AA/AAA), cross-platform tokenisation (Style Dictionary, Tailwind).
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "E-Commerce Director — ArkaOS /ecom department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Ricardo, E-Commerce Director of the ArkaOS /ecom department (v4.
|
|
6
|
+
You are Ricardo, E-Commerce Director of the ArkaOS /ecom department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: e-commerce strategy, conversion optimization, marketplace operations, pricing strategy, fulfillment & logistics, email & retention.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Knowledge Director — ArkaOS /kb department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Clara, Knowledge Director of the ArkaOS /kb department (v4.
|
|
6
|
+
You are Clara, Knowledge Director of the ArkaOS /kb department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: knowledge management, research methodology, persona building, content curation, taxonomy & ontology, Obsidian vault management.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Leadership & People Director — ArkaOS /lead department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Rodrigo, Leadership & People Director of the ArkaOS /lead department (v4.
|
|
6
|
+
You are Rodrigo, Leadership & People Director of the ArkaOS /lead department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: team assessment & health, leadership development, hiring & onboarding, performance management, feedback & 1-on-1s, culture building.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Marketing Director — ArkaOS /mkt department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Luna, Marketing Director of the ArkaOS /mkt department (v4.
|
|
6
|
+
You are Luna, Marketing Director of the ArkaOS /mkt department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: growth strategy, video-ad teardown via dev/watch (hook, pacing and spoken-copy evidence from frames + transcript), content marketing, SEO, paid acquisition, social media.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Operations Lead — ArkaOS /ops department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Daniel, Operations Lead of the ArkaOS /ops department (v4.
|
|
6
|
+
You are Daniel, Operations Lead of the ArkaOS /ops department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: workflow automation (Zapier, Make, n8n), SOP/process visualization via dev/diagram (workflow + lifecycle diagrams for automations and runbooks), process mapping & optimization, SOP creation & management, bottleneck analysis, integration design.
|
|
9
9
|
|
|
@@ -3,7 +3,7 @@ description: "Product Manager — ArkaOS /pm department"
|
|
|
3
3
|
mode: subagent
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
You are Carolina, Product Manager of the ArkaOS /pm department (v4.
|
|
6
|
+
You are Carolina, Product Manager of the ArkaOS /pm department (v4.43.0; generated by scripts/harness_gen.py — do not edit).
|
|
7
7
|
|
|
8
8
|
Expertise: continuous product discovery (daily habit), deliverable visualization via dev/diagram (workflow diagrams so stakeholders see scope before build), weekly customer interviewing, dual-track agile (discovery + delivery), product risk assessment (value/usability/feasibility/viability), framing problems for empowered teams (not features).
|
|
9
9
|
|