@javierfrancoleal/autonomy-grader 0.0.0-stage → 1.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 J.Franco
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,45 @@
1
- # Temporary Holding Version
1
+ ---
2
+ description: "Governance layer: grades the reliability of automatic decisions and proposes tier moves — the human approves every change."
3
+ kind: "package-bundle"
4
+ ---
2
5
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
6
+ # @javierfrancoleal/autonomy-grader
7
+
8
+ > ⚡ **Super Agent Ready** — part of the J.Franco governance layer for autonomous agents.
9
+
10
+ Created by **J.Franco**.
11
+
12
+ ## Summary
13
+
14
+ The governance layer of the J.Franco agentic workflow. As the AI executes
15
+ more automatic actions, the supervision log accumulates evidence. The
16
+ autonomy-grader turns that evidence into trust:
17
+
18
+ - grades every action pattern **A / B / C / D** (samples, verifications,
19
+ corrections, errors);
20
+ - proposes tier moves: reliable patterns toward GREEN, unreliable ones back
21
+ to YELLOW or RED;
22
+ - computes an overall **autonomy level 1–5** for the domain;
23
+ - proposes the exact `decisions.md` line for every move — and **never
24
+ changes the rules itself**: the human approves every change.
25
+
26
+ ## Use this plugin
27
+
28
+ In Desktop, open **Plugins** and enable **Autonomy Grader**. Then, after a
29
+ week of real work, ask "grade" or use `/grade`: the agent reads
30
+ `supervision.md`, grades every pattern, and hands you the Autonomy Report
31
+ with the exact lines to add to `decisions.md`.
32
+
33
+ ## How it works
34
+
35
+ - [`lib/index.js`](lib/index.js) registers the `autonomy-grader` skill
36
+ provider on `ctx.skills` and, when the host command registry resolves, the
37
+ `/grade` command.
38
+ - [`assets/autonomy-grader.md`](assets/autonomy-grader.md) holds the grading
39
+ protocol.
40
+ - [`cordis.patch.yml`](cordis.patch.yml) inserts the provider row into the
41
+ host plane of the Cordis tree.
42
+
43
+ ## License
44
+
45
+ MIT — see the package license field.
@@ -0,0 +1,172 @@
1
+ # Autonomy Grader
2
+
3
+ The governance layer of the J.Franco agentic workflow: it measures how much
4
+ the AI can be trusted with automatic decisions, and proposes how to adjust
5
+ the tiers. The human approves every change — the grader never changes the
6
+ rules itself.
7
+
8
+ `Input → Detection (AI + human) → AI processes, decides, and proposes → Human reflects, verifies, and decides → Output`
9
+
10
+ ## Evolution (variation + selection)
11
+
12
+ The grader is the fitness function; add the variation:
13
+
14
+ - When a tier has been stable for a while, propose 1-2 CANDIDATE rule
15
+ mutations (small changes to decisions.md) as YELLOW proposals.
16
+ - Let the next cycle's grades score the candidates; keep winners, discard
17
+ the rest — with the owner's approval, as always.
18
+ - Never mutate more than one rule at a time: evolution is incremental.
19
+
20
+ ## Purpose
21
+
22
+ Over time, the supervision log accumulates evidence: which GREEN and
23
+ SEMI-AUTOMATIC actions ran clean, which ones the human corrected, and which
24
+ ones failed. The grader turns that evidence into trust grades and proposes
25
+ tier moves:
26
+
27
+ - reliable patterns → candidates to move from YELLOW to GREEN (more
28
+ autonomy);
29
+ - unreliable patterns → candidates to move back to YELLOW or RED (more
30
+ control).
31
+
32
+ ## When to run
33
+
34
+ - The human asks: "grade", "how autonomous is it?", `/grade`, or invokes
35
+ this skill.
36
+ - After a review session over the supervision log.
37
+ - Before expanding a pilot to more positions.
38
+
39
+ ## Data source
40
+
41
+ Read the supervision trail in this order:
42
+
43
+ 1. `supervision.md` in the workspace root
44
+ 2. `.dsh/supervision.md` in the workspace
45
+ 3. `~/.dsh/supervision.md`
46
+ 4. the current session's accountability reports, if no file exists
47
+
48
+ If no data exists, say so and stop: the grader never invents evidence.
49
+
50
+ ## Procedure
51
+
52
+ 1. **Collect.** Read every entry: inputs, decisions with tiers, automatic
53
+ actions, verifications, corrections, and gaps.
54
+ 2. **Group.** Group the evidence by action pattern (for example "note a
55
+ client's phone number", "send an order to the kitchen") — and, when the
56
+ log records them, also by channel (voice, chat, camera), by mission, and
57
+ by worker (worker tags come from the panel or the session identity).
58
+ 3. **Count per pattern:** samples (executions), verified OK, corrected by the
59
+ human, and errors or gaps found.
60
+ 4. **Score** the pattern:
61
+
62
+ - **A** — at least 10 samples, ≥ 95% verified OK, no errors.
63
+ - **B** — at least 5 samples, ≥ 85% verified OK, no serious errors.
64
+ - **C** — fewer samples, or 70–85% OK, or minor corrections.
65
+ - **D** — below 70% OK, or any serious error (wrong data, wrong place,
66
+ missed safety flag).
67
+
68
+ 5. **Suggest a tier move** for each pattern:
69
+
70
+ - **A** → propose moving the pattern to GREEN (or keeping it GREEN),
71
+ quoting the exact `decisions.md` line.
72
+ - **B** → keep as is; keep watching.
73
+ - **C** → keep YELLOW (or return to YELLOW); more samples needed.
74
+ - **D** → propose moving back to YELLOW or RED immediately.
75
+
76
+ 6. **Overall autonomy level** for the domain, from 1 (least) to 5 (most):
77
+
78
+ - 5: every pattern graded A with at least 10 samples.
79
+ - 4: at least 70% of patterns graded A, the rest B.
80
+ - 3: a mix of A, B, and C.
81
+ - 2: mostly C, or any D without harm.
82
+ - 1: any serious error, or a D pattern touching safety or money.
83
+
84
+ ## Autonomy Report
85
+
86
+ Deliver this compact report:
87
+
88
+ - **Evidence:** the patterns analyzed and the samples per pattern.
89
+ - **Grades:** a table — pattern, samples, OK, corrected, errors, grade.
90
+ - **Mission and channel grades:** the same A/B/C/D applied per channel and
91
+ per mission, when the log allows it.
92
+ - **Proposed moves:** each suggestion as the exact `decisions.md` line to add
93
+ or change, with the evidence that justifies it.
94
+ - **Autonomy level:** the overall level and what it means.
95
+ - **No move is automatic:** the human edits `decisions.md`; the grader only
96
+ proposes.
97
+
98
+ ## Worked example
99
+
100
+ The log says: "noted client phone numbers" ran 25 times, verified OK 24, one
101
+ correction (wrong field); "sent order to kitchen" 12 times, all OK; "loan
102
+ quote" always proposed (YELLOW), 8 approvals.
103
+
104
+ - note phone numbers: B (24/25) → keep GREEN, watch the wrong-field error.
105
+ - send order to kitchen: A (12/12) → propose moving it to GREEN.
106
+ - loan quote: C (8 samples, still YELLOW) → keep YELLOW; revisit at 20.
107
+
108
+ ## Management Summary (for owners)
109
+
110
+ When the human asks for a "summary", "resumen", "weekly report", or invokes
111
+ `/summary`, produce the one-page management report instead of the full
112
+ grading:
113
+
114
+ - **Period:** the dates covered.
115
+ - **Totals:** sessions, automatic actions (GREEN + SEMI-AUTOMATIC),
116
+ proposals (approved / adjusted / rejected), corrections, and errors.
117
+ - **Per worker:** one row each — sessions, automatic actions, approval rate,
118
+ corrections, autonomy level, and one line on what that worker could
119
+ improve.
120
+ - **Sector KPIs:** computed from the log using the KPI definition file when
121
+ present (`kpi.md` in the workspace, `.dsh/kpi.md`, or `~/.dsh/kpi.md`);
122
+ otherwise show the generic KPIs (autonomy level, approval rate,
123
+ correction rate, error rate).
124
+ - **Suggestions:** the top three improvements, each tied to evidence from
125
+ the log.
126
+ - **Plain language:** the summary must be readable by a non-technical owner.
127
+
128
+ ## Sector KPIs
129
+
130
+ A KPI definition file maps business metrics to log evidence. Generic KPIs
131
+ are always available:
132
+
133
+ - Autonomy level (1–5)
134
+ - Proposal approval rate (approved / proposals)
135
+ - Correction rate (corrections / automatic actions)
136
+ - Error rate (errors / automatic actions)
137
+ - Interpretation sessions (translated conversations)
138
+
139
+ Sector-specific templates live in `docs/` (for example `kpi-restaurant.md`
140
+ measures service speed through log timestamps; a hotel measures check-in
141
+ time; a clinic measures appointment handling). When a `kpi.md` file exists,
142
+ follow it and report each KPI with its value and its trend.
143
+
144
+ ## Accept modes
145
+
146
+ Every pattern also gets an accept mode, mirroring the super-agent's
147
+ observe/propose/execute ladder:
148
+
149
+ - **OBSERVE** — the pattern is only logged, never executed (new or risky).
150
+ - **PROPOSE** — executed only as a proposal the human approves.
151
+ - **EXECUTE** — executed automatically (GREEN) with verification flags.
152
+
153
+ Propose moves between modes with the same evidence rules as tier moves.
154
+
155
+ ## Developing sector KPIs
156
+
157
+ When the owner wants their own metrics, co-develop them in three steps:
158
+
159
+ 1. Ask what the business measures and what hurts (for example waiting
160
+ time).
161
+ 2. Map each metric to evidence the log can provide (timestamps, decisions,
162
+ counts).
163
+ 3. Write the KPI file (`kpi.md`) as a table — KPI | definition | evidence —
164
+ and from then on the Management Summary reports them with trends.
165
+
166
+ ## Rules
167
+
168
+ - The grader proposes; the human decides. It never edits `decisions.md`.
169
+ - Small samples never justify more autonomy: C stays C.
170
+ - Any error touching safety, credentials, or money resets the pattern to
171
+ YELLOW or RED and lowers the overall level to 1.
172
+ - Grades quote evidence; nothing is estimated or invented.
@@ -0,0 +1,7 @@
1
+ # @javierfrancoleal/autonomy-grader — J.Franco's governance layer.
2
+ # Inserts the skill provider into the host plane of the Cordis tree. The
3
+ # /grade command is registered at runtime when the host command registry
4
+ # resolves.
5
+ - insert:
6
+ - id: autonomy-grader
7
+ name: '@javierfrancoleal/autonomy-grader'
package/icon.svg ADDED
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
2
+ <rect width="64" height="64" rx="14" fill="#4D6BFE"/>
3
+ <path d="M12 44 a20 20 0 0 1 40 0" fill="none" stroke="#ffffff" stroke-width="5"/>
4
+ <path d="M32 44 L40 30" stroke="#ffffff" stroke-width="5" stroke-linecap="round"/>
5
+ <circle cx="32" cy="44" r="4" fill="#ffffff"/>
6
+ <circle cx="16" cy="40" r="3.5" fill="#22C55E"/>
7
+ <circle cx="32" cy="34" r="3.5" fill="#FACC15"/>
8
+ <circle cx="48" cy="40" r="3.5" fill="#EF4444"/>
9
+ </svg>
package/lib/index.js ADDED
@@ -0,0 +1,98 @@
1
+ // @javierfrancoleal/autonomy-grader — governance layer of the J.Franco agentic
2
+ // workflow. Created by J.Franco. Registers the autonomy-grader skill provider
3
+ // on the host skill registry and, when the host command registry is
4
+ // available, the /grade command.
5
+ import { readFile } from "node:fs/promises";
6
+ import { fileURLToPath } from "node:url";
7
+ import { BUNDLED_SKILL_RANK } from "@deepseek-ai/dsh-skill";
8
+
9
+ const PROVIDER_NAME = "jfranco-autonomy-grader";
10
+ const SKILL_BODY_URL = new URL("../assets/autonomy-grader.md", import.meta.url);
11
+ const RESOURCE_BASE = {
12
+ kind: "directory",
13
+ path: fileURLToPath(new URL("../assets/", import.meta.url)),
14
+ };
15
+
16
+ const CANDIDATE = {
17
+ name: "autonomy-grader",
18
+ description: "The governance layer of the J.Franco agentic workflow: grades the reliability of automatic decisions (A/B/C/D) from the supervision log, proposes tier moves for decisions.md, and computes the overall autonomy level 1-5. The human approves every change.",
19
+ invocation: {
20
+ modelInvocable: true,
21
+ userInvocable: true,
22
+ },
23
+ provider: PROVIDER_NAME,
24
+ source: "bundled",
25
+ resourceBase: RESOURCE_BASE,
26
+ rank: BUNDLED_SKILL_RANK,
27
+ locator: SKILL_BODY_URL,
28
+ };
29
+
30
+ const provider = {
31
+ name: PROVIDER_NAME,
32
+ list: () => Promise.resolve([CANDIDATE]),
33
+ async get(_candidate) {
34
+ return {
35
+ name: CANDIDATE.name,
36
+ description: CANDIDATE.description,
37
+ invocation: CANDIDATE.invocation,
38
+ provider: CANDIDATE.provider,
39
+ source: CANDIDATE.source,
40
+ resourceBase: RESOURCE_BASE,
41
+ content: await readFile(SKILL_BODY_URL, "utf8"),
42
+ };
43
+ },
44
+ };
45
+
46
+ /** Cordis plugin name. */
47
+ const name = "autonomy-grader";
48
+
49
+ /** Service required by the bundled provider. */
50
+ const inject = ["skills"];
51
+
52
+ /** Briefing returned by the /grade command. */
53
+ const GRADE_BRIEFING = [
54
+ "Autonomy grading ON.",
55
+ "I will read the supervision log, grade every automatic action pattern",
56
+ "(A/B/C/D), and propose tier moves for decisions.md.",
57
+ "I only propose — you approve every change.",
58
+ ].join(" ");
59
+
60
+ /** Briefing returned by the /summary command. */
61
+ const SUMMARY_BRIEFING = [
62
+ "Management Summary ON.",
63
+ "I will read the supervision log and produce the one-page report: totals,",
64
+ "per-worker table, sector KPIs, and the top three improvements.",
65
+ "Plain language, ready for the owner.",
66
+ ].join(" ");
67
+
68
+ /** Register the bundled skill provider on ctx.skills, and the /grade and
69
+ * /summary commands on the host command registry when it resolves. */
70
+ function apply(ctx) {
71
+ ctx.skills.registerProvider(() => provider);
72
+ const commands = ctx.get("commands");
73
+ if (commands !== undefined) {
74
+ commands.register({
75
+ // Branded ids are identity strings at runtime; this id names the owner.
76
+ definitionId: "@javierfrancoleal/autonomy-grader",
77
+ name: "grade",
78
+ description: "Grade the reliability of automatic decisions and propose tier moves",
79
+ input: {
80
+ hint: "[optional: a specific pattern or domain to grade]",
81
+ attachments: true,
82
+ },
83
+ handler: () => ({ text: GRADE_BRIEFING }),
84
+ });
85
+ commands.register({
86
+ definitionId: "@javierfrancoleal/autonomy-grader",
87
+ name: "summary",
88
+ description: "One-page management summary for the owner: totals, per-worker table, KPIs, suggestions",
89
+ input: {
90
+ hint: "[optional: a period, e.g. 'this week']",
91
+ attachments: true,
92
+ },
93
+ handler: () => ({ text: SUMMARY_BRIEFING }),
94
+ });
95
+ }
96
+ }
97
+
98
+ export { apply, inject, name };
package/locale/ar.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "مقيّم الاستقلالية",
4
+ "description": "يقيّم موثوقية القرارات التلقائية من سجل الإشراف ويقترح تغيير المستويات — المالك يوافق. طبقة حوكمة سير العمل."
5
+ }
6
+ }
package/locale/de.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Autonomie-Bewerter",
4
+ "description": "Bewertet die Zuverlässigkeit automatischer Entscheidungen anhand des Überwachungsprotokolls und schlägt Stufenwechsel vor — der Eigentümer genehmigt. Governance-Ebene."
5
+ }
6
+ }
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Autonomy Grader",
4
+ "description": "Grades the reliability of automatic decisions from the supervision log and proposes tier moves — the human approves. Governance layer of the agentic workflow."
5
+ }
6
+ }
package/locale/es.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Calificador de Autonomía",
4
+ "description": "Califica la fiabilidad de las decisiones automáticas según el registro de supervisión y propone mover niveles — el dueño aprueba. Capa de gobierno del flujo."
5
+ }
6
+ }
package/locale/fr.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Évaluateur d’Autonomie",
4
+ "description": "Note la fiabilité des décisions automatiques à partir du journal de supervision et propose des changements de niveau — le propriétaire approuve. Couche de gouvernance du flux."
5
+ }
6
+ }
package/locale/it.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Valutatore di Autonomia",
4
+ "description": "Valuta l’affidabilità delle decisioni automatiche dal registro di supervisione e propone spostamenti di livello — approva il proprietario. Livello di governance del flusso."
5
+ }
6
+ }
package/locale/ja.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "自律性グレーダー",
4
+ "description": "監督ログから自動決定の信頼性を評価し、階層変更を提案——オーナーが承認。フローのガバナンス層。"
5
+ }
6
+ }
package/locale/ko.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "자율성 평가기",
4
+ "description": "감독 기록에서 자동 결정의 신뢰성을 평가하고 단계 변경을 제안 — 소유자가 승인합니다. 흐름의 거버넌스 계층."
5
+ }
6
+ }
package/locale/pt.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Avaliador de Autonomia",
4
+ "description": "Avalia a confiabilidade das decisões automáticas a partir do registro de supervisão e propõe mudanças de nível — o dono aprova. Camada de governança do fluxo."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "自主性评分器",
4
+ "description": "根据监督记录评估自动决策的可靠性,并提出层级调整——由负责人批准。流程的治理层。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,55 @@
1
1
  {
2
2
  "name": "@javierfrancoleal/autonomy-grader",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.1.0",
4
+ "description": "Governance layer of the J.Franco agentic workflow: grades the reliability of automatic decisions from the supervision log and proposes tier moves — the human approves every change.",
5
+ "author": "J.Franco",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "main": "lib/index.js",
9
+ "exports": {
10
+ ".": "./lib/index.js",
11
+ "./cordis.patch.yml": "./cordis.patch.yml",
12
+ "./package.json": "./package.json",
13
+ "./locale/*.json": "./locale/*.json"
14
+ },
15
+ "icon": "./icon.svg",
16
+ "files": [
17
+ "icon.svg",
18
+ "locale/*.json",
19
+ "lib/index.js",
20
+ "assets",
21
+ "cordis.patch.yml",
22
+ "README.md"
23
+ ],
24
+ "engines": {
25
+ "node": ">=24",
26
+ "dsh": ">=0.2.1-rc.0"
27
+ },
28
+ "dsh": {
29
+ "manifestVersion": 1,
30
+ "bundle": {
31
+ "patch": "./cordis.patch.yml"
32
+ }
33
+ },
34
+ "peerDependencies": {
35
+ "@deepseek-ai/cordis": "~4.0.5",
36
+ "@deepseek-ai/dsh-skill": ">=0.2.1-rc.5"
37
+ },
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "git+https://github.com/JavierFrancoLeal/jfranco-agentic-suite.git",
41
+ "directory": "jfranco-autonomy-grader"
42
+ },
43
+ "homepage": "https://github.com/JavierFrancoLeal/jfranco-agentic-suite",
44
+ "keywords": [
45
+ "deepseek-harness",
46
+ "agentic-workflow",
47
+ "super-agent",
48
+ "ai-assistant",
49
+ "accountability",
50
+ "plugins"
51
+ ],
52
+ "publishConfig": {
53
+ "access": "public"
54
+ }
55
+ }