pi-incise 0.2.0 → 0.3.1
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 +16 -12
- package/extension/minicpm-list.ts +10 -3
- package/extension/profiles.ts +11 -8
- package/extension/safe-routed.ts +903 -106
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -16,12 +16,16 @@ Prebuilt binaries are provided for macOS arm64/x64 and glibc Linux arm64/x64. Wi
|
|
|
16
16
|
|
|
17
17
|
Choose the profile when starting Pi:
|
|
18
18
|
|
|
19
|
+
* **Ornith 1.5 9B (recommended):** `INCISE_PROFILE=auto pi --thinking off`
|
|
19
20
|
* **Gemma (recommended):** `INCISE_PROFILE=auto pi`
|
|
20
|
-
* **
|
|
21
|
-
* **MiniCPM list-addition evaluation:** `INCISE_PROFILE=minicpm-list pi`
|
|
21
|
+
* **MiniCPM5 2B (recommended):** `INCISE_PROFILE=auto pi --thinking off`
|
|
22
22
|
* **Unknown or changing model families:** `INCISE_PROFILE=standard pi`
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
For Ornith, configure its Pi model entry with `maxTokens: 2048` and `samplingParams.parallel_tool_calls: false`. The measured result used temperature 0.6, top-p 0.95, top-k 20, min-p 0, presence penalty 0, and repeat penalty 1 through llama.cpp.
|
|
25
|
+
|
|
26
|
+
For MiniCPM5, the measured result used the official Q8_0 checkpoint through llama.cpp, thinking off, a 65,536-token context, `maxTokens: 8192`, temperature 0.7, and top-p 0.95. The profile does not silently change provider decoding settings.
|
|
27
|
+
|
|
28
|
+
The package default is `standard` for model-agnostic compatibility. `auto` enables the measured `safe-routed` profile for Gemma, MiniCPM, and Ornith; unknown families stay on `standard`. If a local provider exposes a generic model ID, set `INCISE_MODEL_FAMILY=gemma`, `INCISE_MODEL_FAMILY=minicpm`, `INCISE_MODEL_FAMILY=ornith`, or `INCISE_MODEL_FAMILY=unknown`.
|
|
25
29
|
|
|
26
30
|
After Pi starts, run `/incise-doctor`. It reports the requested and effective profiles, detected model family, selected binary, schema state, registered tools, and last route.
|
|
27
31
|
|
|
@@ -29,23 +33,23 @@ After Pi starts, run `/incise-doctor`. It reports the requested and effective pr
|
|
|
29
33
|
|
|
30
34
|
The default `standard` profile registers `table_edit`, `list_edit`, `section_edit`, `frontmatter_edit`, `table_get`, `md_tables`, `md_lists`, and `md_outline`. Inspect document structure with the relevant read tool before editing, and follow the remedy in any Incise refusal. The former `measured` profile name remains an alias for `standard`.
|
|
31
35
|
|
|
32
|
-
Set `INCISE_PROFILE=safe-routed`
|
|
36
|
+
Set `INCISE_PROFILE=safe-routed` to use guarded request routing directly, or use `auto` with a measured Gemma, MiniCPM, or Ornith identity. The routed profile retains standard tools as fallback. For requests it can prove unambiguous, it inspects current structure and replaces the broad surface for that turn with one small action-specific tool. Host-owned routes cover exact table reads and mutations, list relations and checkbox state, literal section insertion, append, deletion, rename, level changes and qualified body replacement, plus typed, create-only, delete, and compound frontmatter edits. Each write carries the inspected hash and permits one successful routed mutation. Ambiguous, unsupported, or structurally inconsistent requests fall back without reinterpretation.
|
|
33
37
|
|
|
34
|
-
`
|
|
38
|
+
`auto` selects once on the first model-bearing turn. Gemma, MiniCPM, and Ornith use `safe-routed`; unknown identities use `standard`. `/incise-doctor` reports the requested profile, effective profile, model family, selection reason, and last route.
|
|
35
39
|
|
|
36
|
-
Set `INCISE_PROFILE=safe-small` only to
|
|
40
|
+
Set `INCISE_PROFILE=safe-small` only to reproduce the earlier experimental small-model composition. It omits generic multi-action tools and destructive section/frontmatter operations, but that older MiniCPM5 run failed its family and safety gates and has been superseded by the measured `auto` route profile.
|
|
37
41
|
|
|
38
|
-
Set `INCISE_PROFILE=minicpm-list` to
|
|
39
|
-
|
|
40
|
-
The preregistered real-Pi run reached 16/21 rather than the adapter-independent result of 21/21. Every executed mutation was correct and no document was damaged, but five trials stopped in prose instead of invoking the sole active phase tool. A paired forced-choice follow-up also reached 16/21 even though every observed active-phase request transmitted the exact advertised tool choice; the local MiniCPM/llama.cpp path did not enforce it. Compact list-only framing reached 19/21 and eliminated all no-call failures, but two previously correct trials wrote the wrong new item text. Neither treatment is shipped, and the profile remains evaluation-only.
|
|
42
|
+
Set `INCISE_PROFILE=minicpm-list` only to reproduce the earlier MiniCPM-specific list-addition pipeline. It supports list additions only; the general MiniCPM recommendation is now `auto`.
|
|
41
43
|
|
|
42
44
|
## Measured results
|
|
43
45
|
|
|
44
|
-
The current
|
|
46
|
+
The current MiniCPM5 2B `auto` profile completed **480/480 full-composition trials (100%) with zero harmful outcomes**. Tables were 60/60, lists 100/100, sections 150/150, frontmatter 110/110, and table reads 60/60. All **470/470 routed trials** passed exact tool-surface and host-resolved-argument audits; all 10 standard fallbacks exposed the unchanged eight-tool surface. The recorded configuration used the official Q8_0 checkpoint through llama.cpp with thinking off, a 65,536-token context, `maxTokens: 8192`, temperature 0.7, and top-p 0.95.
|
|
47
|
+
|
|
48
|
+
The current Ornith 1.5 9B `auto` profile completed **480/480 full-composition trials (100%) with zero harmful outcomes**. Tables were 60/60, lists 100/100, sections 150/150, frontmatter 110/110, and table reads 60/60. All **360/360 routed trials** passed the exact route audit; all 120 fallback trials retained the standard tool surface. The recorded configuration used the official Q8 checkpoint through llama.cpp, thinking off, `maxTokens: 2048`, and `parallel_tool_calls: false`.
|
|
45
49
|
|
|
46
|
-
The
|
|
50
|
+
The current Gemma `auto` profile completed **475/479 usable trials (99.2%) with zero harmful outcomes**. Tables, lists, frontmatter, and table reads were perfect; sections were 145/149 with four loud refusals. Every one of the 17 MiniCPM v3 affected tasks then passed across three seeds for Gemma (**51/51**) and Ornith (**51/51**) before the MiniCPM composition run.
|
|
47
51
|
|
|
48
|
-
These results are tied to the recorded models, llama.cpp runtime, Pi version, prompts, schemas, tasks, seeds, and
|
|
52
|
+
These results are tied to the recorded models, llama.cpp runtime, Pi version, prompts, schemas, tasks, seeds, graders, and inference settings. See [the full findings](../../bench/FINDINGS.md), [MiniCPM composition analysis](../../bench/results/minicpm5_safe_routed_composition_v3_20260925_corrected_analysis.json), [Ornith final analysis](../../bench/results/ornith_final_v2_safe_routed_20260923_analysis.json), and [Gemma v8 analysis](../../bench/results/gemma_safe_routed_full_v8_20260922_analysis.json).
|
|
49
53
|
|
|
50
54
|
## Binary resolution
|
|
51
55
|
|
|
@@ -13,6 +13,7 @@ export type ListRoute = "append" | "after" | "between";
|
|
|
13
13
|
export interface ListEntry {
|
|
14
14
|
heading: string;
|
|
15
15
|
ordinal: number;
|
|
16
|
+
loose?: boolean;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export interface ListItem {
|
|
@@ -64,9 +65,15 @@ export function routeListRequest(prompt: string): ListRoute {
|
|
|
64
65
|
|
|
65
66
|
export function parseListSummary(text: string): ListEntry[] {
|
|
66
67
|
const entries: ListEntry[] = [];
|
|
67
|
-
const
|
|
68
|
-
for (
|
|
69
|
-
|
|
68
|
+
const lines = text.split(/\r?\n/);
|
|
69
|
+
for (let index = 0; index < lines.length; index += 1) {
|
|
70
|
+
const match = lines[index].match(/^ heading "(.*)" ordinal ([0-9]+)$/);
|
|
71
|
+
if (!match) continue;
|
|
72
|
+
entries.push({
|
|
73
|
+
heading: match[1],
|
|
74
|
+
ordinal: Number(match[2]),
|
|
75
|
+
...(/\bloose\b/i.test(lines[index + 1] ?? "") ? { loose: true } : {}),
|
|
76
|
+
});
|
|
70
77
|
}
|
|
71
78
|
return entries;
|
|
72
79
|
}
|
package/extension/profiles.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type RequestedProfile =
|
|
|
6
6
|
| "minicpm-list";
|
|
7
7
|
|
|
8
8
|
export type EffectiveProfile = Exclude<RequestedProfile, "auto">;
|
|
9
|
-
export type ModelFamily = "gemma" | "minicpm" | "unknown";
|
|
9
|
+
export type ModelFamily = "gemma" | "minicpm" | "ornith" | "unknown";
|
|
10
10
|
|
|
11
11
|
export interface ModelIdentity {
|
|
12
12
|
id?: string;
|
|
@@ -39,16 +39,17 @@ export function modelFamily(
|
|
|
39
39
|
): ModelFamily {
|
|
40
40
|
if (override !== undefined && override !== "") {
|
|
41
41
|
const normalized = override.toLowerCase();
|
|
42
|
-
if (normalized === "gemma" || normalized === "minicpm" || normalized === "unknown") {
|
|
42
|
+
if (normalized === "gemma" || normalized === "minicpm" || normalized === "ornith" || normalized === "unknown") {
|
|
43
43
|
return normalized;
|
|
44
44
|
}
|
|
45
45
|
throw new Error(
|
|
46
|
-
`Unknown INCISE_MODEL_FAMILY ${JSON.stringify(override)}. Use gemma, minicpm, or unknown.`,
|
|
46
|
+
`Unknown INCISE_MODEL_FAMILY ${JSON.stringify(override)}. Use gemma, minicpm, ornith, or unknown.`,
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
const identity = `${model?.provider ?? ""} ${model?.id ?? ""} ${model?.name ?? ""}`.toLowerCase();
|
|
50
50
|
if (/mini[-_ ]?cpm/.test(identity)) return "minicpm";
|
|
51
51
|
if (/gemma/.test(identity)) return "gemma";
|
|
52
|
+
if (/ornith/.test(identity)) return "ornith";
|
|
52
53
|
return "unknown";
|
|
53
54
|
}
|
|
54
55
|
|
|
@@ -73,13 +74,17 @@ export function selectProfile(
|
|
|
73
74
|
reason: `explicit INCISE_PROFILE=${requested}`,
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
|
-
if (family === "gemma") {
|
|
77
|
+
if (family === "gemma" || family === "minicpm" || family === "ornith") {
|
|
77
78
|
return {
|
|
78
79
|
requested,
|
|
79
80
|
effective: "safe-routed",
|
|
80
81
|
family,
|
|
81
82
|
model: label,
|
|
82
|
-
reason:
|
|
83
|
+
reason: family === "gemma"
|
|
84
|
+
? "auto selected the measured Gemma routing capabilities"
|
|
85
|
+
: family === "minicpm"
|
|
86
|
+
? "auto selected the measured MiniCPM routing capabilities"
|
|
87
|
+
: "auto selected the measured Ornith routing capabilities",
|
|
83
88
|
};
|
|
84
89
|
}
|
|
85
90
|
return {
|
|
@@ -87,8 +92,6 @@ export function selectProfile(
|
|
|
87
92
|
effective: "standard",
|
|
88
93
|
family,
|
|
89
94
|
model: label,
|
|
90
|
-
reason:
|
|
91
|
-
? "auto kept the standard profile because no general MiniCPM profile has passed evaluation"
|
|
92
|
-
: "auto kept the model-agnostic standard profile for an unknown model family",
|
|
95
|
+
reason: "auto kept the model-agnostic standard profile for an unknown model family",
|
|
93
96
|
};
|
|
94
97
|
}
|