zelari-code 2.25.0 → 2.27.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 +4 -4
- package/dist/cli/app.js +2 -1
- package/dist/cli/app.js.map +1 -1
- package/dist/cli/components/StatusBar.js +7 -1
- package/dist/cli/components/StatusBar.js.map +1 -1
- package/dist/cli/gitOps.js +22 -0
- package/dist/cli/gitOps.js.map +1 -1
- package/dist/cli/hooks/useChatTurn.js +5 -1
- package/dist/cli/hooks/useChatTurn.js.map +1 -1
- package/dist/cli/kraken/verifyStatus.js +113 -0
- package/dist/cli/kraken/verifyStatus.js.map +1 -0
- package/dist/cli/main.bundled.js +30718 -30254
- package/dist/cli/main.bundled.js.map +4 -4
- package/dist/cli/toolRegistry.js +17 -1
- package/dist/cli/toolRegistry.js.map +1 -1
- package/dist/cli/tools/krakenLive.js +9 -1
- package/dist/cli/tools/krakenLive.js.map +1 -1
- package/dist/cli/tools/krakenRadio.js.map +1 -1
- package/dist/cli/tools/planTaskTools.js +76 -4
- package/dist/cli/tools/planTaskTools.js.map +1 -1
- package/dist/cli/utils/doctor.js +47 -1
- package/dist/cli/utils/doctor.js.map +1 -1
- package/dist/cli/wizard/index.js +10 -0
- package/dist/cli/wizard/index.js.map +1 -1
- package/dist/cli/workspace/planStore.js +19 -0
- package/dist/cli/workspace/planStore.js.map +1 -1
- package/dist/cli/workspace/stubs.js +3 -0
- package/dist/cli/workspace/stubs.js.map +1 -1
- package/dist/cli/workspace/taskOverlap.js +78 -0
- package/dist/cli/workspace/taskOverlap.js.map +1 -0
- package/dist/cli/workspace/taskStaleness.js +100 -0
- package/dist/cli/workspace/taskStaleness.js.map +1 -0
- package/dist/cli/workspace/taskTouchGuard.js +181 -0
- package/dist/cli/workspace/taskTouchGuard.js.map +1 -0
- package/package.json +4 -3
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* verifyStatus — session-level verification state for the TUI (identity wave).
|
|
3
|
+
*
|
|
4
|
+
* The strict gate (verificationBridge, ADR-0023/0026) already decides whether
|
|
5
|
+
* a build turn may finish. This module PROJECTS that decision onto UI the
|
|
6
|
+
* user can see at all times:
|
|
7
|
+
*
|
|
8
|
+
* - Verifica chip: prova: PASS | RIPARA | BLOCCATO (P1 as product)
|
|
9
|
+
* - Permessi chip: phase gate + strict-done declaration (P2+P3 honesty)
|
|
10
|
+
* - Block explanation: why a turn was stopped, which criteria miss proof
|
|
11
|
+
*
|
|
12
|
+
* Store discipline mirrors tools/krakenLive.ts: ephemeral, per-process,
|
|
13
|
+
* fail-open. A missing/never-evaluated state renders NO chip — never a fake
|
|
14
|
+
* one (EMPTY ≠ absent).
|
|
15
|
+
*/
|
|
16
|
+
import { strictDoneEnabled } from './verificationBridge.js';
|
|
17
|
+
/**
|
|
18
|
+
* Map a strict-gate evaluation onto the three-state session contract.
|
|
19
|
+
* `blocked` (CompletionPolicy BLOCKED) is the hard stop; every other blocked
|
|
20
|
+
* outcome (REPAIR_REQUIRED, legacy gate) means work remains — never pass.
|
|
21
|
+
*/
|
|
22
|
+
export function verifyStateFromGate(evaluation) {
|
|
23
|
+
if (!evaluation.blocked)
|
|
24
|
+
return 'pass';
|
|
25
|
+
const verdict = evaluation.evaluation?.verdict;
|
|
26
|
+
if (verdict === 'BLOCKED')
|
|
27
|
+
return 'blocked';
|
|
28
|
+
return 'repair';
|
|
29
|
+
}
|
|
30
|
+
/** Verifica chip label. Italian on purpose: this is the product contract. */
|
|
31
|
+
export function formatVerifyChip(state) {
|
|
32
|
+
if (state === 'pass')
|
|
33
|
+
return { label: 'prova: PASS', tone: 'green' };
|
|
34
|
+
if (state === 'blocked')
|
|
35
|
+
return { label: 'prova: BLOCCATO', tone: 'red' };
|
|
36
|
+
return { label: 'prova: RIPARA', tone: 'yellow' };
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Permessi chip: what the agent may write RIGHT NOW, honestly declared.
|
|
40
|
+
* - plan phase never writes (P2 phase gate);
|
|
41
|
+
* - build + strict-on: proof is mandatory before "done" (P1);
|
|
42
|
+
* - build with strict opted out: declared fail-open, shown as such (P3) —
|
|
43
|
+
* never hidden to look safer than it is.
|
|
44
|
+
*/
|
|
45
|
+
export function permissionsChip(phase, strictOn = strictDoneEnabled()) {
|
|
46
|
+
if (phase === 'plan')
|
|
47
|
+
return { label: 'scrive: no (piano)', tone: 'yellow' };
|
|
48
|
+
return strictOn
|
|
49
|
+
? { label: 'scrive: sì · prova obbligatoria', tone: 'green' }
|
|
50
|
+
: { label: 'scrive: sì · senza prova (dichiarato)', tone: 'yellow' };
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Human-readable explanation of a strict-gate outcome: verdict word, how
|
|
54
|
+
* much proof passed, WHICH criteria are still unsatisfied, and the rule.
|
|
55
|
+
* Used where the gate stops a turn — the user sees why, not an exit code.
|
|
56
|
+
*/
|
|
57
|
+
export function formatStrictBlockExplanation(evaluation) {
|
|
58
|
+
const state = verifyStateFromGate(evaluation);
|
|
59
|
+
const gate = evaluation.gate;
|
|
60
|
+
if (state === 'pass') {
|
|
61
|
+
return `[verifica] PASS — ${gate.passed}/${gate.total} prove superate.`;
|
|
62
|
+
}
|
|
63
|
+
const word = state === 'blocked' ? 'BLOCCATO' : 'RIPARA';
|
|
64
|
+
const lines = [
|
|
65
|
+
`[verifica] ${word} — ${gate.passed}/${gate.total} prove superate; il turno non può dichiararsi finito senza prova.`,
|
|
66
|
+
];
|
|
67
|
+
const evalr = (evaluation.evaluation ?? null);
|
|
68
|
+
if (evalr) {
|
|
69
|
+
const byId = new Map();
|
|
70
|
+
for (const c of evalr.criteria ?? [])
|
|
71
|
+
byId.set(c.id, c.text);
|
|
72
|
+
const unsatisfied = (evalr.results ?? []).filter((r) => r.status !== 'pass');
|
|
73
|
+
if (unsatisfied.length > 0) {
|
|
74
|
+
lines.push('Mancano:');
|
|
75
|
+
for (const r of unsatisfied.slice(0, 8)) {
|
|
76
|
+
lines.push(` • ${byId.get(r.criterionId) ?? r.criterionId} [${r.status}]`);
|
|
77
|
+
}
|
|
78
|
+
if (unsatisfied.length > 8) {
|
|
79
|
+
lines.push(` • … e altri ${unsatisfied.length - 8}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
lines.push('La prova è obbligatoria: chiudo il turno solo quando ogni criterio richiesto ha evidenza.');
|
|
84
|
+
return lines.join('\n');
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Record the latest strict-gate evaluation. Single writer discipline: the
|
|
88
|
+
* turn loop (TUI useChatTurn) calls this right after each evaluation —
|
|
89
|
+
* including the post-repair re-check, so a successful repair flips the
|
|
90
|
+
* chip to PASS instead of lying on RIPARA.
|
|
91
|
+
*/
|
|
92
|
+
export function recordStrictGateEvaluation(evaluation) {
|
|
93
|
+
const g = globalThis;
|
|
94
|
+
g.__zelariVerifyState = {
|
|
95
|
+
state: verifyStateFromGate(evaluation),
|
|
96
|
+
at: Date.now(),
|
|
97
|
+
passed: evaluation.gate.passed,
|
|
98
|
+
total: evaluation.gate.total,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Current Verifica chip for the StatusBar. Null before the first evaluation
|
|
103
|
+
* of the process — no verdict has been observed yet, so no chip (honesty
|
|
104
|
+
* over decoration).
|
|
105
|
+
*/
|
|
106
|
+
export function getVerifyChip() {
|
|
107
|
+
const g = globalThis;
|
|
108
|
+
const s = g.__zelariVerifyState;
|
|
109
|
+
if (!s)
|
|
110
|
+
return null;
|
|
111
|
+
return formatVerifyChip(s.state);
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=verifyStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyStatus.js","sourceRoot":"","sources":["../../../src/cli/kraken/verifyStatus.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,iBAAiB,EAAkC,MAAM,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