pi-incise 0.4.0 → 0.6.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 CHANGED
@@ -19,23 +19,28 @@ Choose the profile when starting Pi:
19
19
  * **Ornith 1.5 9B (recommended):** `INCISE_PROFILE=auto pi --thinking off`
20
20
  * **Gemma (recommended):** `INCISE_PROFILE=auto pi`
21
21
  * **MiniCPM5 2B (recommended):** `INCISE_PROFILE=auto pi --thinking off`
22
+ * **Inkling 2 Mini Q3:** `INCISE_PROFILE=auto pi --thinking off`
22
23
  * **Unknown or changing model families:** `INCISE_PROFILE=standard pi`
23
24
 
24
25
  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
 
26
27
  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
 
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`.
29
+ The package default is `standard` for model-agnostic compatibility. `auto` enables the measured `safe-routed` profile for Gemma, MiniCPM, Ornith, and Inkling 2 Mini; 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`, `INCISE_MODEL_FAMILY=inkling`, or `INCISE_MODEL_FAMILY=unknown`. Inkling detection is limited to 2 Mini identities; other generations remain unknown.
29
30
 
30
31
  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.
31
32
 
33
+ LFM3-specific support was abandoned on 25 November 2026 after the evaluation failed to demonstrate an overall editing benefit and incurred substantial latency overhead. No LFM3-specific profile or focus preview is provided. Historical evaluation records remain under `bench/`.
34
+
35
+ For Inkling 2 Mini, the measured local UD-Q3_K_XL setup used Pi SDK 1.0.4, a 32,768-token context, `maxTokens: 2048`, temperature 0.6, top-p 0.95, top-k 0, min-p 0, repeat penalty 1, and presence penalty 0. Send native `reasoning_effort: "none"`; the model still emitted reasoning in this runtime. Select the local model separately; the plugin does not change decoding settings. Inkling uses Pi’s structured prompt options to keep the prompt’s tool list aligned with the active route, and receives the existing hash-bound inspection for checkbox edits.
36
+
32
37
  ## Tools
33
38
 
34
39
  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`.
35
40
 
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.
41
+ Set `INCISE_PROFILE=safe-routed` to use guarded request routing directly, or use `auto` with a measured Gemma, MiniCPM, Ornith, or Inkling 2 Mini 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.
37
42
 
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.
43
+ `auto` selects once on the first model-bearing turn. Gemma, MiniCPM, Ornith, and Inkling 2 Mini use `safe-routed`; unknown identities use `standard`. `/incise-doctor` reports the requested profile, effective profile, model family, selection reason, and last route.
39
44
 
40
45
  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.
41
46
 
@@ -43,6 +48,10 @@ Set `INCISE_PROFILE=minicpm-list` only to reproduce the earlier MiniCPM-specific
43
48
 
44
49
  The version-matched native binary also contains the confirmed `incise table-delete` CLI operation for automation and direct shell use. It is not an action in the Pi `table_edit` schema: three preregistered model-facing candidates missed the required confirmation-recovery gate, so the measured standard and fallback surfaces remain unchanged.
45
50
 
51
+ ## Structural check skill
52
+
53
+ The package includes the explicit-only `/skill:incise-check` skill. When that skill starts, the extension registers a read-only `md_check` tool backed by the same version-matched binary, then enables only the semantic repair tool named by the report. Ordinary runs never register or activate `md_check`, and the previous active tool surface is restored when the skill run ends. The skill handles `automatic`, `explicit`, and `manual` findings without reconstructing the file; `disable-model-invocation: true` keeps it out of automatic selection.
54
+
46
55
  ## Measured results
47
56
 
48
57
  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.
@@ -53,6 +62,8 @@ The current Gemma `auto` profile completed **475/479 usable trials (99.2%) with
53
62
 
54
63
  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).
55
64
 
65
+ Inkling 2 Mini UD-Q3_K_XL completed 48/48 tasks at fresh seed 2 after one recorded grader correction, including 42/42 edits and zero incorrect changed documents. The original 47/48 grades already passed the preregistered gate; the omitted ordinal-read case independently matched the Python oracle. Two sessions attempted unavailable shell tools before recovering through the guarded route. This is one 48-task host qualification, not the ten-seed stability measurement used for the other models. On the M4 Mac mini with 24 GB RAM, these full workflows averaged 68.5 seconds. See the [original analysis](../../bench/results/inkling2_mini_q3_checkbox_v4_20261129_analysis.json) and [separate regrade](../../bench/results/inkling2_mini_q3_checkbox_v4_20261129_held_auto_regraded_v1_analysis.json).
66
+
56
67
  ## Binary resolution
57
68
 
58
69
  The extension uses `INCISE_BIN` first, then the matching optional native package, then `incise` on `PATH`, and finally a release or debug binary from a development checkout. `/incise-doctor` reports the selected path, versions, schema status, and registered-tool count. Version mismatches from explicit overrides are warnings; a mismatched packaged binary disables the tools as an installation-integrity failure.
@@ -0,0 +1,94 @@
1
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
+ import type { TSchema } from "typebox";
3
+
4
+ import type { ResolvedBinary } from "./binary.ts";
5
+ import { resolveToolPath, type ToolArguments } from "./normalize.ts";
6
+ import { processError, runIncise, type IncisePayload } from "./runner.ts";
7
+
8
+ export const CHECK_TOOL_NAME = "md_check";
9
+
10
+ export const CHECK_TOOL_SCHEMA = {
11
+ name: CHECK_TOOL_NAME,
12
+ description: "Check one Markdown file for Incise structural hazards. Read-only. Returns the exact versioned JSON report. Available only while the explicit incise-check skill is active.",
13
+ parameters: {
14
+ type: "object",
15
+ properties: {
16
+ path: { type: "string", description: "Markdown file to check." },
17
+ },
18
+ required: ["path"],
19
+ additionalProperties: false,
20
+ },
21
+ } as const;
22
+
23
+ const SKILL_WRAPPER = /^<skill name="incise-check" location="[^"]+">\n/;
24
+
25
+ export function isExplicitCheckSkillPrompt(prompt: string): boolean {
26
+ return SKILL_WRAPPER.test(prompt);
27
+ }
28
+
29
+ export function repairTools(report: IncisePayload, available: ReadonlySet<string>): string[] {
30
+ const mapped = new Set<string>();
31
+ const findings = Array.isArray(report.findings) ? report.findings : [];
32
+ for (const finding of findings) {
33
+ if (!finding || typeof finding !== "object" || Array.isArray(finding)) continue;
34
+ const repair = (finding as Record<string, unknown>).repair;
35
+ if (!repair || typeof repair !== "object" || Array.isArray(repair)) continue;
36
+ const operation = (repair as Record<string, unknown>).operation;
37
+ if (typeof operation !== "string") continue;
38
+ const name = operation.startsWith("table-") ? "table_edit"
39
+ : operation.startsWith("list-") ? "list_edit"
40
+ : operation.startsWith("section-") ? "section_edit"
41
+ : operation.startsWith("frontmatter-") ? "frontmatter_edit"
42
+ : undefined;
43
+ if (name && available.has(name)) mapped.add(name);
44
+ }
45
+ return [...mapped];
46
+ }
47
+
48
+ export function installCheckSkillTool(
49
+ pi: ExtensionAPI,
50
+ binary: ResolvedBinary,
51
+ standardTools: readonly string[],
52
+ ): void {
53
+ const available = new Set(standardTools);
54
+ let active = false;
55
+ let registered = false;
56
+ let restore: string[] | undefined;
57
+
58
+ const register = (): void => {
59
+ if (registered) return;
60
+ pi.registerTool({
61
+ name: CHECK_TOOL_SCHEMA.name,
62
+ label: CHECK_TOOL_SCHEMA.name,
63
+ description: CHECK_TOOL_SCHEMA.description,
64
+ parameters: CHECK_TOOL_SCHEMA.parameters as TSchema,
65
+ async execute(_toolCallId, params, signal, _onUpdate, ctx) {
66
+ if (!active) throw new Error("md_check is available only while the explicit incise-check skill is active.");
67
+ const located = resolveToolPath(params as ToolArguments, ctx.cwd);
68
+ const result = await runIncise(pi.exec.bind(pi), binary.path, ["check", located.path], signal);
69
+ if (result.code !== 0 || result.payload.ok === false) throw processError(result);
70
+ pi.setActiveTools([CHECK_TOOL_NAME, ...repairTools(result.payload, available)]);
71
+ return {
72
+ content: [{ type: "text", text: JSON.stringify(result.payload) }],
73
+ details: result.payload,
74
+ };
75
+ },
76
+ });
77
+ registered = true;
78
+ };
79
+
80
+ pi.on("before_agent_start", async (event) => {
81
+ if (!("prompt" in event) || !isExplicitCheckSkillPrompt(event.prompt)) return;
82
+ restore = pi.getActiveTools().filter((name) => name !== CHECK_TOOL_NAME);
83
+ active = true;
84
+ register();
85
+ pi.setActiveTools([CHECK_TOOL_NAME]);
86
+ });
87
+
88
+ pi.on("agent_end", async () => {
89
+ if (!active) return;
90
+ active = false;
91
+ pi.setActiveTools(restore ?? standardTools.slice());
92
+ restore = undefined;
93
+ });
94
+ }
@@ -2,10 +2,12 @@ import { withFileMutationQueue, type ExtensionAPI } from "@earendil-works/pi-cod
2
2
  import type { TSchema } from "typebox";
3
3
 
4
4
  import { packageVersion, resolveBinary, type ResolvedBinary } from "./binary.ts";
5
+ import { installCheckSkillTool } from "./check-skill.ts";
5
6
  import { installMiniCpmListProfile, MINICPM_LIST_TOOL_NAMES } from "./minicpm-list.ts";
6
7
  import { prepareInvocation, READ_SUBCOMMAND, type ToolArguments } from "./normalize.ts";
7
8
  import {
8
9
  requestedProfile,
10
+ modelFamily,
9
11
  selectProfile,
10
12
  type ProfileDecision,
11
13
  type RequestedProfile,
@@ -206,6 +208,9 @@ export default async function inciseExtension(pi: ExtensionAPI): Promise<void> {
206
208
  }
207
209
  installSafeRoutedProfile(pi, binary, {
208
210
  standardTools: schemas.map((schema) => schema.name),
211
+ useStructuredPrompt(ctx) {
212
+ return modelFamily(ctx.model, familyOverride) === "inkling";
213
+ },
209
214
  isEnabled(ctx) {
210
215
  if (!decision && ctx.model) {
211
216
  decision = selectProfile(profile, ctx.model, familyOverride);
@@ -216,5 +221,6 @@ export default async function inciseExtension(pi: ExtensionAPI): Promise<void> {
216
221
  onRoute(route) { diagnostics.activeRoute = route; },
217
222
  });
218
223
  }
224
+ installCheckSkillTool(pi, binary, schemas.map((schema) => schema.name));
219
225
  registerDoctor(pi, diagnostics);
220
226
  }
@@ -335,6 +335,10 @@ export function installMiniCpmListProfile(
335
335
 
336
336
  pi.on("before_agent_start", async (event, ctx) => {
337
337
  state = undefined;
338
+ if (!("prompt" in event)) {
339
+ pi.setActiveTools([]);
340
+ return;
341
+ }
338
342
  const found = extractMarkdownPath(event.prompt);
339
343
  if (!found) {
340
344
  pi.setActiveTools([]);
@@ -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" | "ornith" | "unknown";
9
+ export type ModelFamily = "gemma" | "minicpm" | "ornith" | "inkling" | "unknown";
10
10
 
11
11
  export interface ModelIdentity {
12
12
  id?: string;
@@ -39,17 +39,18 @@ 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 === "ornith" || normalized === "unknown") {
42
+ if (normalized === "gemma" || normalized === "minicpm" || normalized === "ornith" || normalized === "inkling" || normalized === "unknown") {
43
43
  return normalized;
44
44
  }
45
45
  throw new Error(
46
- `Unknown INCISE_MODEL_FAMILY ${JSON.stringify(override)}. Use gemma, minicpm, ornith, or unknown.`,
46
+ `Unknown INCISE_MODEL_FAMILY ${JSON.stringify(override)}. Use gemma, minicpm, ornith, inkling, 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
52
  if (/ornith/.test(identity)) return "ornith";
53
+ if (/\binkling[-_ ]2[-_ ]mini(?:\b|[_-])/.test(identity)) return "inkling";
53
54
  return "unknown";
54
55
  }
55
56
 
@@ -74,7 +75,7 @@ export function selectProfile(
74
75
  reason: `explicit INCISE_PROFILE=${requested}`,
75
76
  };
76
77
  }
77
- if (family === "gemma" || family === "minicpm" || family === "ornith") {
78
+ if (family === "gemma" || family === "minicpm" || family === "ornith" || family === "inkling") {
78
79
  return {
79
80
  requested,
80
81
  effective: "safe-routed",
@@ -84,7 +85,9 @@ export function selectProfile(
84
85
  ? "auto selected the measured Gemma routing capabilities"
85
86
  : family === "minicpm"
86
87
  ? "auto selected the measured MiniCPM routing capabilities"
87
- : "auto selected the measured Ornith routing capabilities",
88
+ : family === "ornith"
89
+ ? "auto selected the measured Ornith routing capabilities"
90
+ : "auto selected the measured Inkling 2 Mini routing capabilities",
88
91
  };
89
92
  }
90
93
  return {
@@ -147,6 +147,7 @@ interface RouteSpec {
147
147
  }>;
148
148
  resolvedArguments?(params: Record<string, unknown>): Record<string, unknown>;
149
149
  systemPrompt: string;
150
+ inspection?: string;
150
151
  }
151
152
 
152
153
  interface RoutedState {
@@ -1241,6 +1242,10 @@ async function routeForPrompt(
1241
1242
  checked: checked.checked,
1242
1243
  }),
1243
1244
  systemPrompt: `Incise resolved the exact checkbox item and requested state. Use ${schema.name} once with no arguments; the host supplies the file, list, item, state, and read hash.`,
1245
+ inspection: `Inspected ${JSON.stringify(path)} at read hash ${result.payload.hash}:\n${
1246
+ String(result.payload.text ?? "").length <= 2048 ? String(result.payload.text ?? "")
1247
+ : JSON.stringify({ checked: matches[0].checked, depth: matches[0].depth, parent: matches[0].parent })
1248
+ }`,
1244
1249
  };
1245
1250
  }
1246
1251
  const append = listAppendIntent(prompt);
@@ -1491,6 +1496,7 @@ function toolResult(text: string, details: Record<string, unknown>) {
1491
1496
  export interface SafeRoutedOptions {
1492
1497
  standardTools: string[];
1493
1498
  isEnabled(ctx: { model?: { id?: string; name?: string; provider?: string } }): boolean;
1499
+ useStructuredPrompt?(ctx: { model?: { id?: string; name?: string; provider?: string } }): boolean;
1494
1500
  onRoute?(kind: SafeRouteKind | "standard"): void;
1495
1501
  }
1496
1502
 
@@ -1578,7 +1584,7 @@ export function installSafeRoutedProfile(
1578
1584
 
1579
1585
  pi.on("before_agent_start", async (event, ctx) => {
1580
1586
  state = undefined;
1581
- if (!options.isEnabled(ctx)) {
1587
+ if (!options.isEnabled(ctx) || !("prompt" in event)) {
1582
1588
  options.onRoute?.("standard");
1583
1589
  activate(options.standardTools);
1584
1590
  return;
@@ -1593,6 +1599,25 @@ export function installSafeRoutedProfile(
1593
1599
  registerRoute(spec);
1594
1600
  options.onRoute?.(spec.kind);
1595
1601
  activate([spec.schema.name]);
1596
- return { systemPrompt: `${event.systemPrompt}\n\n${spec.systemPrompt}` };
1602
+ const structured = options.useStructuredPrompt?.(ctx);
1603
+ const routePrompt = structured && spec.inspection
1604
+ ? `${spec.inspection}\n\n${spec.systemPrompt}` : spec.systemPrompt;
1605
+ if (structured && event.systemPromptOptions &&
1606
+ event.systemPromptOptions.forceSystemPrompt === undefined) {
1607
+ const active = pi.getActiveTools();
1608
+ if (!active.includes(spec.schema.name)) {
1609
+ state = undefined;
1610
+ activate(options.standardTools);
1611
+ options.onRoute?.("standard");
1612
+ return;
1613
+ }
1614
+ event.systemPromptOptions.selectedTools = active;
1615
+ event.systemPromptOptions.toolSnippets[spec.schema.name] = spec.schema.description;
1616
+ const previous = event.systemPromptOptions.sections.incise_route;
1617
+ event.systemPromptOptions.sections.incise_route = previous
1618
+ ? `${previous}\n\n${routePrompt}` : routePrompt;
1619
+ return;
1620
+ }
1621
+ return { systemPrompt: `${event.systemPrompt}\n\n${routePrompt}` };
1597
1622
  });
1598
1623
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-incise",
3
- "version": "0.4.0",
4
- "description": "Semantic, byte-preserving Markdown editing tools for Pi and AI agents",
3
+ "version": "0.6.0",
4
+ "description": "Structured Markdown editing for Pi, with measured Inkling 2 Mini profiles and byte preservation",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "Peter Dalinis",
@@ -20,13 +20,16 @@
20
20
  "llm-tools",
21
21
  "frontmatter",
22
22
  "obsidian",
23
- "knowledge-base"
23
+ "knowledge-base",
24
+ "inkling",
25
+ "local-llm"
24
26
  ],
25
27
  "engines": {
26
28
  "node": ">=22.19.0"
27
29
  },
28
30
  "files": [
29
31
  "extension",
32
+ "skills",
30
33
  "LICENSE",
31
34
  "README.md"
32
35
  ],
@@ -34,6 +37,9 @@
34
37
  "extensions": [
35
38
  "./extension/index.ts"
36
39
  ],
40
+ "skills": [
41
+ "./skills/incise-check"
42
+ ],
37
43
  "image": "https://pdalinis.github.io/incise/assets/incise-preview.png"
38
44
  },
39
45
  "peerDependencies": {
@@ -41,20 +47,21 @@
41
47
  "typebox": "*"
42
48
  },
43
49
  "devDependencies": {
44
- "@earendil-works/pi-coding-agent": "^0.99.1",
50
+ "@earendil-works/pi-coding-agent": "1.7.0",
45
51
  "@types/node": "^22.19.19",
46
52
  "typescript": "^5.9.3"
47
53
  },
48
54
  "optionalDependencies": {
49
- "@pdalinis/pi-incise-darwin-arm64": "0.4.0",
50
- "@pdalinis/pi-incise-darwin-x64": "0.4.0",
51
- "@pdalinis/pi-incise-linux-arm64-gnu": "0.4.0",
52
- "@pdalinis/pi-incise-linux-x64-gnu": "0.4.0"
55
+ "@pdalinis/pi-incise-darwin-arm64": "0.6.0",
56
+ "@pdalinis/pi-incise-darwin-x64": "0.6.0",
57
+ "@pdalinis/pi-incise-linux-arm64-gnu": "0.6.0",
58
+ "@pdalinis/pi-incise-linux-x64-gnu": "0.6.0"
53
59
  },
54
60
  "scripts": {
55
61
  "test": "node --test --experimental-strip-types test/*.test.ts",
56
62
  "typecheck": "tsc --noEmit",
57
- "pack:check": "node --experimental-strip-types test/pack-check.ts"
63
+ "pack:check": "node --experimental-strip-types test/pack-check.ts",
64
+ "native:check": "node --experimental-strip-types test/native-install-smoke.ts"
58
65
  },
59
66
  "publishConfig": {
60
67
  "access": "public"
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: incise-check
3
+ description: Check Markdown for structural hazards that affect Incise addressing or byte-preserving edits, and handle Incise checker findings without broad rewrites.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # Incise structural check
8
+
9
+ Use this skill when the user explicitly asks to validate a Markdown file, inspect an Incise checker finding, or verify an Incise edit. This is not a style-lint workflow.
10
+
11
+ Call `md_check` with the Markdown path. It is the version-matched, read-only
12
+ checker supplied by the host integration and returns the versioned JSON report.
13
+ Do not search for a launcher or use terminal commands in place of `md_check`.
14
+
15
+ For a report:
16
+
17
+ - Stop when `status` is `clean`.
18
+ - Treat the check itself as successful even when findings exist; branch on `status` and finding `code`, not the process exit code.
19
+ - For an `automatic` finding, use only the report's named Incise repair mechanism with its exact `hash`. Never construct a patch from the prose message.
20
+ - For an `explicit` finding, use the repair descriptor's named Incise semantic operation only when the user's request supplies the necessary intent or confirmation.
21
+ - For a `manual` finding, explain the ambiguity or ask for intent. Do not raw-patch or reconstruct the document.
22
+ - Recheck with `md_check` after a mutation. Stop if the report makes no progress; do not retry a mutation loop indefinitely.
23
+
24
+ Do not broaden the task to unrelated files or style changes.
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+
3
+ // Thin host-owned launcher. Detection and repair remain in the Incise binary;
4
+ // this file only reuses pi-incise's version-matched binary resolution.
5
+ import { spawnSync } from "node:child_process";
6
+ import { resolveBinary } from "../../../extension/binary.ts";
7
+
8
+ const binary = resolveBinary();
9
+ if (!binary) {
10
+ process.stderr.write("No Incise binary is available for this platform. Reinstall pi-incise or set INCISE_BIN.\n");
11
+ process.exit(2);
12
+ }
13
+
14
+ const args = process.argv.slice(2);
15
+ if (args.length === 0) {
16
+ process.stderr.write("usage: check.mjs PATH [--fix-safe --if-match HASH]\n");
17
+ process.exit(2);
18
+ }
19
+ const result = spawnSync(binary.path, ["check", ...args, "--json"], {
20
+ encoding: "utf8",
21
+ stdio: ["ignore", "pipe", "pipe"],
22
+ });
23
+ process.stdout.write(result.stdout ?? "");
24
+ process.stderr.write(result.stderr ?? "");
25
+ if (result.error) {
26
+ process.stderr.write(`${result.error.message}\n`);
27
+ process.exit(2);
28
+ }
29
+ process.exit(result.status ?? 2);