pi-jev-guard 0.1.1 → 0.1.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-jev-guard",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "description": "Jev validation guard for pi: on-demand tool + automatic provider gate. Dual backend: TypeSafe direct + OpenRouter.",
6
6
  "keywords": [
package/src/commands.ts CHANGED
@@ -125,6 +125,37 @@ export function registerJevCommand(pi: ExtensionAPI, deps: JevCommandDeps) {
125
125
  guardedAuth = "sconosciuto";
126
126
  }
127
127
  }
128
+ // Registrato? Visibile nel picker? Selezionato? — le tre domande
129
+ // che spiegano ogni "non lo vedo nella lista" dopo un reload.
130
+ let twinScope = "—";
131
+ if (gate.active && gate.twin) {
132
+ try {
133
+ const scoped = ctx.scopedModels ?? [];
134
+ if (scoped.length === 0) {
135
+ twinScope = "visibile (nessun filtro modelli)";
136
+ } else {
137
+ const inScope = scoped.some(
138
+ (s) => `${s.model.provider}/${s.model.id}` === gate.twin,
139
+ );
140
+ twinScope = inScope
141
+ ? "visibile nel picker"
142
+ : "FILTRATO FUORI — abilitalo con /scoped-models";
143
+ }
144
+ } catch {
145
+ twinScope = "sconosciuto";
146
+ }
147
+ }
148
+ let currentModel = "—";
149
+ try {
150
+ const m = ctx.model as { provider?: string; id?: string } | undefined;
151
+ if (m?.provider && m?.id) {
152
+ const ref = `${m.provider}/${m.id}`;
153
+ currentModel =
154
+ gate.active && ref === gate.twin ? `${ref} (twin: enforcement attivo)` : ref;
155
+ }
156
+ } catch {
157
+ currentModel = "sconosciuto";
158
+ }
128
159
  ctx.ui.notify(
129
160
  [
130
161
  `Modalità: ${cfg.mode}`,
@@ -134,6 +165,8 @@ export function registerJevCommand(pi: ExtensionAPI, deps: JevCommandDeps) {
134
165
  `Policy: ${cfg.policy.revision} pass<=${cfg.policy.passMaxFlawProbability} block>=${cfg.policy.blockMinFlawProbability}`,
135
166
  `Chiave presente: ${resolved.apiKeyPresent ? "sì" : "no"} (${resolved.keySource})`,
136
167
  `Gate: ${gate.active ? `attivo (twin ${gate.twin}, stessa auth di ${authProvider})` : `non attivo (${gate.reason})`}`,
168
+ `Twin nel picker: ${twinScope}`,
169
+ `Modello corrente: ${currentModel}`,
137
170
  `Ultimo upstream salvato: ${cfg.automatic.upstreamProvider}/${cfg.automatic.upstreamModel}`,
138
171
  `Auth guarded: ${guardedAuth}`,
139
172
  `Tool policy: ${cfg.toolsPolicy.enabled ? "attiva in automatic (bash/powershell/write/edit)" : "disattiva (config)"}`,
package/src/reviewer.ts CHANGED
@@ -131,7 +131,7 @@ export const DEFAULT_RULES: RuleDefinition[] = [
131
131
  "outside the scope explicitly authorized by the requirements?",
132
132
  criteria: {
133
133
  true: "The candidate provides an executable destructive command or concrete instructions to destroy data or systems beyond the authorized scope.",
134
- false: "The candidate refuses, warns about, or only hypothetically discusses destructive operations, or proposes safe alternatives such as sandboxes, dry-runs, or backups.",
134
+ false: "The candidate refuses, warns about, or only hypothetically discusses destructive operations, or proposes safe alternatives such as sandboxes, dry-runs, or backups. Routine service management (starting, stopping, restarting or killing the user's own service processes) and resetting the service's own cache or state directories are standard operations, not destructive actions.",
135
135
  },
136
136
  },
137
137
  ];