@yandy-r/ycc-opencode 6.2.0 → 6.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  # @yandy-r/ycc-opencode
2
2
 
3
3
  Experimental, opt-in [OpenCode](https://opencode.ai) V2 plugin carrying the ycc bundle
4
- (version 6.2.0). It is unlisted and never the default install: the
4
+ (version 6.2.1). It is unlisted and never the default install: the
5
5
  `install.sh --target opencode` file copy remains the primary path.
6
6
 
7
7
  Requires OpenCode `>=2.0.30` (V2 plugin API; V1 hook plugins are not supported).
@@ -11,7 +11,7 @@ Requires OpenCode `>=2.0.30` (V2 plugin API; V1 hook plugins are not supported).
11
11
  Add the package to the V2 `plugins` array in your own `opencode.json`, pinned to an exact release:
12
12
 
13
13
  ```json
14
- { "plugins": ["@yandy-r/ycc-opencode@6.2.0"] }
14
+ { "plugins": ["@yandy-r/ycc-opencode@6.2.1"] }
15
15
  ```
16
16
 
17
17
  Pin the version instead of using the bare name. Right after a release, the registry can briefly serve
package/index.js CHANGED
@@ -47,9 +47,9 @@
47
47
  // short-circuits before hooks) and its mutated effect/message is
48
48
  // final (plugin/src/promise/permission.ts). It turns the effect into
49
49
  // deny when the packaged rules deny any resource, and an
50
- // external_directory allow into ask when the packaged rules ask for a
51
- // resource no saved approval covers. The event's agent is optional;
52
- // without it the session's agent is used, as the host does.
50
+ // external_directory allow into ask unless a saved approval covers
51
+ // every resource the packaged rules ask for. The event's agent is
52
+ // optional; without it the session's agent is used, as the host does.
53
53
  // * ctx.tool.hook("execute.before") rejects a call to a tool whose
54
54
  // permission action the packaged rules wholly deny, which also covers
55
55
  // tools that never request a permission.
@@ -60,23 +60,42 @@
60
60
  // and request settings, because config.agent mutates them in place.
61
61
  //
62
62
  // Saved approvals: an "always" reply makes the host save the request's
63
- // `save` patterns for the project (permission.ts reply, saved.add) and
64
- // append them as allow rules after every configured rule, so the evaluate
65
- // event cannot tell a saved approval from a config-level allow, and no
66
- // plugin API lists saved permissions (v2.0.30-v2.1.1). The host publishes
67
- // permission.asked (the request, `save` included) and permission.replied
68
- // on the bus that ctx.event.subscribe streams for this location, so the
69
- // package records the same patterns in its own storage, one key per
70
- // pattern under the project (ctx.storage.scan reads them back), and keeps
71
- // an allow they cover. After saving, the host re-evaluates every other
72
- // pending request in the same fiber and publishes an "always" reply,
73
- // without saving anything, for each one that now evaluates to allow. At
74
- // least one resource of such a request is covered by the patterns just
75
- // recorded (the rest may be allowed by config), so a reply to a request
76
- // any recorded pattern already partly covers records nothing. Recording
77
- // happens in memory before any await, so that same-fiber re-evaluation
78
- // already sees it.
79
- //
63
+ // `save` patterns for the project (permission.ts reply, saved.add). The
64
+ // evaluate event cannot tell a saved approval from a config-level allow,
65
+ // and plugins get no API or bus event for saved approvals (v2.0.30-v2.2.5;
66
+ // ctx.permission is list/get/reply for pending requests, hook, assert).
67
+ // The floor therefore asks the host itself, with a saved-approval probe:
68
+ // a child session of the asking session (ctx.session.create with
69
+ // parentID), run as the same agent, whose own permissions are
70
+ // `external_directory * ask`, and a ctx.permission.assert there for the
71
+ // resources in question. evaluateInput merges the agent's rules (config
72
+ // rules included) with the session's, so the session's ask comes last
73
+ // and overrides any config-level allow; it then appends the project's
74
+ // saved approvals as allow rules after all of them. The probe's effect is
75
+ // therefore allow exactly when saved approvals cover every resource, as
76
+ // long as no evaluate hook running before this package's changed it. So
77
+ // a second assert in the same session asks for a sentinel directory no
78
+ // real approval covers; if that also comes back allow (a hook approves
79
+ // every request, or a saved approval covers `/`), the probe proves
80
+ // nothing and the floor prompts. This package's own evaluate hook
81
+ // recognises each probe evaluation by the session id and a per-assert
82
+ // metadata token, records the effect, and turns it into deny so the probe
83
+ // never prompts; the assert's rejection is expected. An assert that does
84
+ // not settle within PROBE_TIMEOUT_MS (this hook gone, e.g. the plugin
85
+ // unloaded mid-probe, or an earlier hook slow) counts as no answer and
86
+ // has its pending request rejected (ctx.permission.list/reply); its token
87
+ // stays registered until the assert settles, so a late evaluation is
88
+ // still denied. The probe session is removed again
89
+ // (ctx.session.remove) in every case. Because the host is asked each
90
+ // time, a removed saved approval takes effect at once and one saved
91
+ // before this package loaded is honoured. Each loaded copy of this module
92
+ // has its own probe map: another copy whose hook runs first sees this
93
+ // copy's probe evaluation as an ordinary check and may run one nested
94
+ // probe of its own, whose evaluation this copy's hook then sees already
95
+ // denied and leaves alone, so the nesting stops after one level and both
96
+ // copies reach the same answer. Older package versions kept their own
97
+ // copy of saved approvals in plugin storage; setup removes those records.
98
+
80
99
  // Coexistence with the primary file-copy install (install.sh --target
81
100
  // opencode): config agents/skills/commands apply in the `post` plugin group,
82
101
  // which replays after any user package on every state rebuild
@@ -98,6 +117,7 @@ import { fileURLToPath } from "node:url";
98
117
  import { dirname, isAbsolute, join, relative as relativePath } from "node:path";
99
118
  import { cpSync, mkdtempSync, readdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
100
119
  import { tmpdir } from "node:os";
120
+ import { randomUUID } from "node:crypto";
101
121
 
102
122
  import { registerSensitiveGuard } from "./ycc-sensitive-guard/index.js";
103
123
 
@@ -115,6 +135,12 @@ const RESTRICTED_RULES = new Map(
115
135
  const FLOOR_DENIED = "Permission denied by ycc restricted-agent rules: ";
116
136
  // The only action the floor raises from allow to ask.
117
137
  const EXTERNAL = "external_directory";
138
+ // Saved-approval probe asserts in flight: metadata token -> { sessionID, effect }.
139
+ const PROBES = new Map();
140
+ const PROBE_KEY = "yccSavedApprovalProbe";
141
+ const PROBE_TITLE = "ycc saved-approval probe";
142
+ // How long one probe assert may take before its pending request is rejected.
143
+ const PROBE_TIMEOUT_MS = 5000;
118
144
 
119
145
  // Token the generator writes where a package asset path is needed; it points
120
146
  // at the *rendered* tree created below, which sits beside the package root.
@@ -363,93 +389,124 @@ async function sessionAgent(ctx, sessionID) {
363
389
  return (session?.data ?? session)?.agent;
364
390
  }
365
391
 
366
- // Saved external_directory approvals of one project, mirrored from the host:
367
- // one storage key per pattern, so instances sharing a project never
368
- // overwrite each other's records.
369
- function savedPrefix(ctx) {
370
- return `saved/${EXTERNAL}/${encodeURIComponent(ctx.location.project.id)}/`;
371
- }
372
-
373
- async function storedPatterns(ctx) {
374
- const patterns = [];
375
- const prefix = savedPrefix(ctx);
376
- let after;
377
- do {
378
- const page = await ctx.storage.scan({ prefix, after });
379
- for (const entry of page.entries) if (typeof entry.value === "string") patterns.push(entry.value);
380
- after = page.next;
381
- } while (after !== undefined);
382
- return patterns;
383
- }
384
-
385
- // Recorded patterns: this instance's in-memory records (loaded at setup, then
386
- // set as soon as a reply arrives) plus those other locations of the project
387
- // stored since.
388
- async function savedPatterns(ctx, recorded) {
392
+ // Reject every pending permission request of a probe session. Best effort.
393
+ async function rejectPending(ctx, sessionID) {
389
394
  try {
390
- return [...recorded, ...(await storedPatterns(ctx))];
395
+ const listed = await ctx.permission.list({ sessionID });
396
+ const requests = listed?.data ?? listed;
397
+ for (const request of Array.isArray(requests) ? requests : []) {
398
+ try {
399
+ await ctx.permission.reply({ sessionID, requestID: request.id, decision: "reject" });
400
+ } catch {
401
+ // The request may have settled meanwhile.
402
+ }
403
+ }
391
404
  } catch {
392
- return [...recorded];
405
+ // Removing the session ends whatever is left.
393
406
  }
394
407
  }
395
408
 
396
- function matches(resource, patterns) {
397
- return patterns.some((pattern) => wildcardMatch(resource, pattern));
409
+ // One probe assert in the probe session: the effect this package's evaluate
410
+ // hook saw for it, or undefined when it saw none or the assert timed out. The
411
+ // token stays registered until the assert settles, so an evaluation that
412
+ // reaches the hook only after the timeout (a slow earlier hook) is still
413
+ // denied instead of prompting in a probe session that is already gone.
414
+ async function probeEffect(ctx, sessionID, agent, resources) {
415
+ const token = randomUUID();
416
+ const slot = { sessionID, effect: undefined };
417
+ PROBES.set(token, slot);
418
+ const settled = Promise.resolve()
419
+ .then(() =>
420
+ ctx.permission.assert({ sessionID, agent, action: EXTERNAL, resources, metadata: { [PROBE_KEY]: token } }),
421
+ )
422
+ .then(
423
+ () => "settled",
424
+ // Expected: the evaluate hook denies every probe evaluation.
425
+ () => "settled",
426
+ )
427
+ .finally(() => PROBES.delete(token));
428
+ let timer;
429
+ try {
430
+ const expired = new Promise((resolve) => {
431
+ timer = setTimeout(resolve, PROBE_TIMEOUT_MS, "expired");
432
+ });
433
+ if ((await Promise.race([settled, expired])) === "expired") {
434
+ await rejectPending(ctx, sessionID);
435
+ return undefined;
436
+ }
437
+ return slot.effect;
438
+ } finally {
439
+ clearTimeout(timer);
440
+ }
398
441
  }
399
442
 
400
- // Record the `save` patterns of every external_directory request the user
401
- // answers "always", as the host saves them (any agent and session of the
402
- // project). A reply this package never saw asked, any other reply, and a reply
403
- // to a request a recorded pattern already partly covers (the host's
404
- // re-evaluation of other pending requests, which saves nothing) record
405
- // nothing; the cost is one more prompt when a genuine "always" overlaps an
406
- // earlier record. Events are handled one at a time; a failed write loses only
407
- // that record, until this instance is rebuilt.
408
- function trackSavedApprovals(ctx, signal, recorded) {
409
- const asked = new Map();
410
- void (async () => {
411
- for await (const event of ctx.event.subscribe({ signal })) {
443
+ // Whether the project's saved approvals cover every resource for this agent,
444
+ // asked of the host in a short-lived child session (see the contract above).
445
+ // The sentinel sits at the filesystem root rather than under the temp
446
+ // directory, which users commonly approve. Any failure, or no effect seen,
447
+ // counts as not covered.
448
+ async function savedApprovalsCover(ctx, sessionID, agent, resources) {
449
+ let probe;
450
+ try {
451
+ const created = await ctx.session.create({
452
+ parentID: sessionID,
453
+ agent,
454
+ title: PROBE_TITLE,
455
+ permissions: [{ action: EXTERNAL, resource: "*", effect: "ask" }],
456
+ });
457
+ probe = (created?.data ?? created)?.id;
458
+ if (typeof probe !== "string") return false;
459
+ if ((await probeEffect(ctx, probe, agent, resources)) !== "allow") return false;
460
+ const sentinel = await probeEffect(ctx, probe, agent, [`/ycc-saved-approval-probe-${randomUUID()}/*`]);
461
+ return sentinel !== undefined && sentinel !== "allow";
462
+ } catch {
463
+ return false;
464
+ } finally {
465
+ if (probe !== undefined) {
412
466
  try {
413
- if (event.type === "permission.asked") {
414
- const { id, action, resources, save } = event.data;
415
- if (action === EXTERNAL && save?.length) asked.set(id, { resources, save });
416
- } else if (event.type === "permission.replied") {
417
- const request = asked.get(event.data.requestID);
418
- asked.delete(event.data.requestID);
419
- if (!request || event.data.reply !== "always") continue;
420
- const known = [...recorded];
421
- if (request.resources.some((resource) => matches(resource, known))) continue;
422
- for (const pattern of request.save) recorded.add(pattern);
423
- for (const pattern of request.save) {
424
- await ctx.storage.set(savedPrefix(ctx) + encodeURIComponent(pattern), pattern);
425
- }
426
- }
467
+ await ctx.session.remove({ sessionID: probe });
427
468
  } catch {
428
- // Unrecorded patterns prompt again once this instance is rebuilt.
469
+ // Best effort: the probe holds no pending request by now.
429
470
  }
430
471
  }
431
- })().catch(() => {
432
- // Without the event stream nothing is recorded: saved approvals prompt.
433
- });
472
+ }
473
+ }
474
+
475
+ // Old package versions kept their own record of saved approvals, one key per
476
+ // pattern under this prefix. Best effort; setup never waits for it.
477
+ async function removeStaleRecords(ctx) {
478
+ const prefix = `saved/${EXTERNAL}/${encodeURIComponent(ctx.location.project.id)}/`;
479
+ const keys = [];
480
+ let after;
481
+ do {
482
+ const page = await ctx.storage.scan({ prefix, after });
483
+ for (const entry of page.entries) keys.push(entry.key);
484
+ after = page.next;
485
+ } while (after !== undefined);
486
+ for (const key of keys) await ctx.storage.remove(key);
434
487
  }
435
488
 
436
489
  // A packaged deny is enforced on top of the host's effect for every action.
437
490
  // Every restricted ruleset starts with `* * deny`, so any action or resource
438
491
  // outside the agent's own allowlist is denied here. The packaged `ask` a
439
492
  // restricted agent ships is external_directory: a host allow is raised back
440
- // to ask unless a recorded saved approval covers every resource it asks for,
493
+ // to ask unless the host's saved approvals cover every resource it asks for,
441
494
  // so a config-level allow cannot skip the prompt and an "always" answer is not
442
495
  // prompted again. Every other action keeps the host's allow or ask.
443
- async function registerPermissionFloor(ctx, signal) {
496
+ async function registerPermissionFloor(ctx) {
444
497
  if (RESTRICTED_RULES.size === 0) return;
445
- const recorded = new Set();
446
- trackSavedApprovals(ctx, signal, recorded);
447
- try {
448
- for (const pattern of await storedPatterns(ctx)) recorded.add(pattern);
449
- } catch {
450
- // Unloaded records are still read by the evaluate hook's own scan.
451
- }
498
+ void removeStaleRecords(ctx).catch(() => {
499
+ // Stale records grant nothing; they only take up storage.
500
+ });
452
501
  await ctx.permission.hook("evaluate", async (event) => {
502
+ const token = event.metadata?.[PROBE_KEY];
503
+ const probe = typeof token === "string" ? PROBES.get(token) : undefined;
504
+ if (probe && probe.sessionID === event.sessionID) {
505
+ // This copy's saved-approval probe: keep the effect, never prompt.
506
+ probe.effect = event.effect;
507
+ event.effect = "deny";
508
+ return;
509
+ }
453
510
  if (event.effect === "deny") return;
454
511
  let agent = event.agent;
455
512
  if (agent === undefined) {
@@ -473,9 +530,7 @@ async function registerPermissionFloor(ctx, signal) {
473
530
  if (event.effect !== "allow" || event.action !== EXTERNAL) return;
474
531
  const asked = event.resources.filter((_, index) => effects[index] === "ask");
475
532
  if (asked.length === 0) return;
476
- if (asked.every((resource) => matches(resource, [...recorded]))) return;
477
- const saved = await savedPatterns(ctx, recorded);
478
- if (!asked.every((resource) => matches(resource, saved))) event.effect = "ask";
533
+ if (!(await savedApprovalsCover(ctx, event.sessionID, agent, asked))) event.effect = "ask";
479
534
  });
480
535
  await ctx.tool.hook("execute.before", async (event) => {
481
536
  const rules = RESTRICTED_RULES.get(event.agent);
@@ -501,18 +556,14 @@ export default {
501
556
  id: "yandy-r.ycc-opencode",
502
557
  async setup(ctx) {
503
558
  const renderedRoot = renderTree();
504
- const events = new AbortController();
505
- const dispose = () => {
506
- events.abort();
507
- teardown(renderedRoot);
508
- };
559
+ const dispose = () => teardown(renderedRoot);
509
560
  try {
510
561
  await registerSkills(ctx, renderedRoot);
511
562
  await registerAgents(ctx, renderedRoot);
512
563
  await registerCommands(ctx);
513
564
  await registerMcp(ctx);
514
565
  await registerInstructions(ctx);
515
- await registerPermissionFloor(ctx, events.signal);
566
+ await registerPermissionFloor(ctx);
516
567
  await registerSensitiveGuard(ctx);
517
568
  } catch (error) {
518
569
  dispose();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yandy-r/ycc-opencode",
3
- "version": "6.2.0",
3
+ "version": "6.2.1",
4
4
  "description": "Experimental opt-in OpenCode V2 plugin registering the ycc bundle (skills, agents, commands, MCP servers, and session instructions) through its setup hook. The file-copy install remains the primary path.",
5
5
  "type": "module",
6
6
  "main": "./index.js",
package/registration.json CHANGED
@@ -7230,10 +7230,6 @@
7230
7230
  "type": "remote",
7231
7231
  "url": "https://mcp.linear.app/mcp"
7232
7232
  },
7233
- "linear-personal": {
7234
- "type": "remote",
7235
- "url": "https://mcp.linear.app/mcp"
7236
- },
7237
7233
  "vercel": {
7238
7234
  "type": "remote",
7239
7235
  "url": "https://mcp.vercel.com"
@@ -157,7 +157,7 @@ In linear mode, before Git branch preparation:
157
157
  1. Resolve and print the mode (`--shell`), then apply the Linear call gate. A missing or unauthorized MCP stops the run with the gate message; there is no local fallback for a plan that exists only in Linear.
158
158
  2. Run Lookup for the plan kind (`parallel-plan` for `implement-plan`, `prp-plan` for `prp-implement`). Map the hit to a slug: the Document title prefix before `·`, else the feature Project name. An issue reference with sub-issues is the parent tracking issue; any other issue resolves through its parent. Either way the run covers the whole plan. Lookup step 7 asks; never report "no plan" before querying Linear.
159
159
  3. Hydrate once with Load into the current checkout's cache: `--ensure --kind=<kind> --slug=<slug>`, then pull the Document body and stamp identity. `implement-plan` also hydrates `shared` when that Document exists; a missing `shared` Document is a warning, like a missing local `shared.md`. Load's Conflict rule applies; never overwrite unpushed local edits.
160
- 4. Use the absolute cache path as `PLAN_PATH` for parsing, prompts and validation. Linear-mode plans are never moved into the feature worktree (`move-plan-to-worktree.sh` is skipped); worktree tasks read the plan by absolute path. Derive `WT_FEATURE_SLUG` (and any team context) from the cache slug, never from the cache basename, sanitized for branch preparation: lowercase, replace `[^a-z0-9-]` with `-`, collapse runs, trim `-`, truncate to 40 characters. Resolver calls keep the unsanitized cache slug. The cache itself is gitignored; the only dirty path `--ensure` can leave is a `.gitignore` (at `ARTIFACT_ROOT`, which may be a package directory) whose sole change appends one `.ycc/artifacts/` rule line, possibly after a missing final newline, even when the committed file already has the rule; branch preparation accepts exactly that change, in the working tree, the index, or both, and carries it onto the feature branch.
160
+ 4. Use the absolute cache path as `PLAN_PATH` for parsing, prompts and validation. Linear-mode plans are never moved into the feature worktree (`move-plan-to-worktree.sh` is skipped); worktree tasks read the plan by absolute path. Derive `WT_FEATURE_SLUG` (and any team context) from the cache slug, never from the cache basename, sanitized for branch preparation: lowercase, replace `[^a-z0-9-]` with `-`, collapse runs, trim `-`, truncate to 40 characters. Resolver calls keep the unsanitized cache slug. The cache itself is gitignored; the only dirty path `--ensure` can leave is a `.gitignore` (at `ARTIFACT_ROOT`, which may be a package directory) whose sole change appends one `.ycc/artifacts/` rule line, possibly after a missing final newline, even when the committed file already has the rule; branch preparation accepts exactly that change, in the working tree, the index, or both (the working tree may match as raw bytes or, under `core.autocrlf` or `eol=crlf`, after Git turns its CRLF into LF), and carries it onto the feature branch.
161
161
  5. Read the `tasks` map from the plan's frontmatter. If it is missing, rebuild it in memory from the parent tracking issue's sub-issues by literal task heading id, as in Plan task issues, without creating issues or writing the map to the cache. A task with no issue still runs; list it as untracked in the report and suggest re-saving the plan with its planning skill.
162
162
 
163
163
  ### Status sync
@@ -9,7 +9,7 @@
9
9
  - Artifact store
10
10
  - How to Update This Document
11
11
 
12
- As of 2026-10-19
12
+ As of 2026-11-04
13
13
 
14
14
  This file is the authoritative source for which ycc bundle capabilities are supported on each
15
15
  deployment target. Downstream scripts parse the table below; read the Parser Grammar section
@@ -22,7 +22,7 @@ before editing the table.
22
22
  The first table below (Capability Matrix) is parsed by `ycc/skills/compatibility-audit/scripts/audit-target-features.sh`.
23
23
  Follow these rules exactly or the parser will misread cells:
24
24
 
25
- - **Column order**: `capability, claude, cursor, codex, opencode, omp` — do not reorder.
25
+ - **Column order**: `capability, claude, cursor, codex, opencode, omp, pi` — do not reorder.
26
26
  - **Cell vocabulary**: exactly one of `supported`, `partial`, or `unsupported` — no other tokens,
27
27
  no trailing punctuation, no parenthetical notes inside the cell.
28
28
  - **Notes** belong in the Notes section below the table, keyed as `capability:target`.
@@ -44,19 +44,19 @@ Follow these rules exactly or the parser will misread cells:
44
44
 
45
45
  ## Capability Matrix
46
46
 
47
- | capability | claude | cursor | codex | opencode | omp |
48
- | ----------------- | --------- | ----------- | ----------- | ----------- | ----------- |
49
- | SKILLS | supported | supported | supported | supported | partial |
50
- | COMMANDS | supported | partial | unsupported | supported | partial |
51
- | AGENTS | supported | partial | supported | supported | partial |
52
- | HOOKS.PreToolUse | supported | partial | unsupported | partial | unsupported |
53
- | HOOKS.PostToolUse | supported | partial | unsupported | partial | unsupported |
54
- | HOOKS.Stop | supported | partial | unsupported | partial | unsupported |
55
- | MCP | supported | supported | partial | supported | partial |
56
- | INSTALL_PATH | supported | supported | supported | supported | partial |
57
- | DANGEROUS_MODE | supported | unsupported | unsupported | unsupported | unsupported |
58
- | WORKTREE | supported | partial | partial | partial | partial |
59
- | MODS | supported | unsupported | unsupported | unsupported | unsupported |
47
+ | capability | claude | cursor | codex | opencode | omp | pi |
48
+ | ----------------- | --------- | ----------- | ----------- | ----------- | ----------- | ----------- |
49
+ | SKILLS | supported | supported | supported | supported | partial | unsupported |
50
+ | COMMANDS | supported | partial | unsupported | supported | partial | unsupported |
51
+ | AGENTS | supported | partial | supported | supported | partial | unsupported |
52
+ | HOOKS.PreToolUse | supported | partial | unsupported | partial | unsupported | unsupported |
53
+ | HOOKS.PostToolUse | supported | partial | unsupported | partial | unsupported | unsupported |
54
+ | HOOKS.Stop | supported | partial | unsupported | partial | unsupported | unsupported |
55
+ | MCP | supported | supported | partial | supported | partial | unsupported |
56
+ | INSTALL_PATH | supported | supported | supported | supported | partial | unsupported |
57
+ | DANGEROUS_MODE | supported | unsupported | unsupported | unsupported | unsupported | unsupported |
58
+ | WORKTREE | supported | partial | partial | partial | partial | unsupported |
59
+ | MODS | supported | unsupported | unsupported | unsupported | unsupported | unsupported |
60
60
 
61
61
  ---
62
62
 
@@ -67,14 +67,15 @@ from installer-managed artifacts and gated work in `ycc/settings/packages.json`.
67
67
  `listed: false` packages are not published catalog entries; generated trees and successful spikes
68
68
  alone do not make them shipping user install paths. This does not revise the capability verdicts above.
69
69
 
70
- | target | native, listed today | install.sh fallback today | unlisted or gated native packages |
71
- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------- |
72
- | Claude | `ycc@ycc`, `ycc-mcp@ycc`, `ycc-hooks@ycc` (2.1.300+), `ycc-all@ycc`; `status-bar@ycc-mods` | Rules, settings, statusline, MCP, standalone skills/agents; hooks via the native `ycc-hooks` plugin at project scope (global hooks link with `--global`) | `ycc-agents@ycc` in v7.0.0 |
73
- | Cursor | `ycc`, `ycc-rules`, `ycc-mcp`, `ycc-hooks` via the root `.cursor-plugin/marketplace.json` (interactive `/plugins`); hooks `sessionStart` only | Skills, agents, commands, rules, settings under `~/.cursor/`; optional hooks | None |
74
- | Codex | `ycc@ycc`, `ycc-mcp@ycc` via the root `.agents/plugins/marketplace.json` | Agent TOMLs, `AGENTS.md`, `config.toml` | `ycc-hooks` excluded (YAN-1149) |
75
- | opencode | None | Skills, agents, commands, shared, `opencode.json`, `AGENTS.md` | `@yandy-r/ycc-opencode` npm plugin: experimental, opt-in, unpublished |
76
- | `agents` | None | Skills and `ycc-shared` copied into `~/.agents/` | None planned |
77
- | `omp` | `ycc@ycc`, `ycc-mcp@ycc`, `ycc-rules@ycc` via the root `.omp-plugin/marketplace.json` (omp `>=18.12.2`) | `install.sh --target omp`: local export (`--mode local`) or the repository catalog (`--mode repo`) installed through `omp plugin` (user or project scope); opt-in `--rules` (`AGENTS.md`) and `--settings` (`config.yml`), user scope only | `ycc-hooks` and `ycc-all` excluded (herdr: `herdr integration install omp`) |
70
+ | target | native, listed today | install.sh fallback today | unlisted or gated native packages |
71
+ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
72
+ | Claude | `ycc@ycc`, `ycc-mcp@ycc`, `ycc-hooks@ycc` (2.1.300+), `ycc-all@ycc`; `status-bar@ycc-mods` | Rules, settings, statusline, MCP, standalone skills/agents; hooks via the native `ycc-hooks` plugin at project scope (global hooks link with `--global`) | `ycc-agents@ycc` in v7.0.0 |
73
+ | Cursor | `ycc`, `ycc-rules`, `ycc-mcp`, `ycc-hooks` via the root `.cursor-plugin/marketplace.json` (interactive `/plugins`); hooks `sessionStart` only | Skills, agents, commands, rules, settings under `~/.cursor/`; optional hooks | None |
74
+ | Codex | `ycc@ycc`, `ycc-mcp@ycc` via the root `.agents/plugins/marketplace.json` | Agent TOMLs, `AGENTS.md`, `config.toml` | `ycc-hooks` excluded (YAN-1149) |
75
+ | opencode | None | Skills, agents, commands, shared, `opencode.json`, `AGENTS.md` | `@yandy-r/ycc-opencode` npm plugin: experimental, opt-in, unpublished |
76
+ | `agents` | None | Skills and `ycc-shared` copied into `~/.agents/` | None planned |
77
+ | `omp` | `ycc@ycc`, `ycc-mcp@ycc`, `ycc-rules@ycc` via the root `.omp-plugin/marketplace.json` (omp `>=18.12.2`) | `install.sh --target omp`: local export (`--mode local`) or the repository catalog (`--mode repo`) installed through `omp plugin` (user or project scope); opt-in `--rules` (`AGENTS.md`) and `--settings` (`config.yml`), user scope only | `ycc-hooks` and `ycc-all` excluded (herdr: `herdr integration install omp`) |
78
+ | `pi` | None | None | `ycc`, `ycc-mcp`, `ycc-rules` deferred to v6.3.0 (ADR 0003, pi `>=1.2.0`); `ycc-hooks` and `ycc-all` excluded |
78
79
 
79
80
  Native dependency resolution is a Claude platform feature, not a cross-runtime guarantee.
80
81
  The Claude `ycc-all` meta plugin's automatic dependency install was verified on Claude Code 2.1.301 and in the v6.0.0 maintainer clean-host verification; Cursor and Codex have no
@@ -106,6 +107,12 @@ The recommendation in `docs/research/ystack/recommendation.md` is qualified by
106
107
  (YAN-1172, YAN-1173, YAN-1175). Since YAN-1180 the three rows are listed and the repository
107
108
  publishes the root `.omp-plugin/marketplace.json`.
108
109
  YAN-1174: ycc ships no OMP hooks; herdr reporting is herdr's own OMP integration.
110
+ - `pi-runtime-contract.md`: tested on Pi (`@earendil-works/pi-coding-agent`) 1.5.0 and 1.2.0;
111
+ supported floor `>=1.2.0`, recommended 1.5.0. Pi gets a generated `packages/pi/` tree
112
+ (YAN-1188) installed by absolute path with `pi install`; there is no catalog. Pi has no
113
+ built-in subagents, no shell hooks or `hooks.json`, no `WorktreeCreate` event, and no approval
114
+ modes, and a Pi package cannot depend on another, so `ycc-all` is omitted. See ADR 0003. No Pi
115
+ generator or installer ships yet, so every `pi` cell above is `unsupported`.
109
116
 
110
117
  ---
111
118
 
@@ -451,10 +458,10 @@ Partial: `scripts/generate_omp_packages.py` builds `packages/omp/ycc-mcp/` whose
451
458
  placeholders). `install.sh install --target omp` installs it as
452
459
  `ycc-mcp@ycc` with `ycc@ycc` (see INSTALL_PATH:omp). OMP's plugin MCP loader reads it natively,
453
460
  names servers `ycc-mcp:<server>`, and expands `${VAR}` in `env`, `url` and `headers` at load
454
- (unset variables arrive literally). The generated `.mcp.json` differs from the source in one
455
- way (YAN-1291): a later http/sse server whose connection equals an earlier one gets
456
- `?ycc-server=<name>` on its URL, so `ycc-mcp:linear-personal` loads beside `ycc-mcp:linear`
457
- with its own OAuth login; the other targets keep the source URL. Listed in the root OMP catalog
461
+ (unset variables arrive literally). The generator would add `?ycc-server=<name>` to the URL of a
462
+ later http/sse server whose connection equals an earlier one (YAN-1291), so both could load with
463
+ their own OAuth logins; the current source has no such duplicates, so the generated `.mcp.json`
464
+ equals the source byte-for-byte. Listed in the root OMP catalog
458
465
  since YAN-1180, after the YAN-1178 live acceptance on the real tree. Gaps:
459
466
  `ycc-mcp:playwright` is dropped while `browser.enabled` is on; plugin timeouts below 1000 ms are
460
467
  ignored; per-server disable is the user `disabledServers` list, and `plugin-overrides.json` does
@@ -517,13 +524,78 @@ No native-parity claim. Source: ADR 0002; `worktree-strategy.md` §1.
517
524
  Unsupported. The Claude Code mod API differs from OMP's `ExtensionAPI`; the status-bar mod is
518
525
  not ported. Source: ADR 0002.
519
526
 
527
+ **SKILLS:pi**
528
+ Unsupported today: ycc ships no Pi skill tree. Planned `partial` (YAN-1184): Pi discovers package
529
+ `skills/<name>/SKILL.md` natively as `/skill:<name>`, and `disable-model-invocation` maps natively,
530
+ but Pi leaves `${CLAUDE_PLUGIN_ROOT}`, `/ycc:<name>` and body `$ARGUMENTS` literal, so the generator
531
+ must rewrite them and ship `_shared` inside the package. Floor pi `>=1.2.0`. Coexistence: Pi
532
+ discovers `~/.agents/skills` by default, so copies from the `agents` target load unadapted and
533
+ outrank a package skill of the same name (no namespacing, spike §1.5); YAN-1193 adds owned
534
+ `-~/.agents/skills/<n>/SKILL.md` dedupe overrides. Source: ADR 0003; spike §1.5, §3.
535
+
536
+ **COMMANDS:pi**
537
+ Unsupported today: ycc ships no Pi commands. Planned `partial` (YAN-1185): public entrypoints are
538
+ `ycc:<name>` extension commands that call `sendUserMessage("/skill:<name> …", {expandPromptTemplates: true})`,
539
+ because a prompt template that emits `/skill:x` is not expanded again. Source: ADR 0003 decision 2.
540
+
541
+ **AGENTS:pi**
542
+ Unsupported today: Pi has no built-in subagents and ycc ships no Pi agents. Planned `partial`
543
+ (YAN-1186): a ycc `subagent` extension tool loads the generated agent definitions from the package,
544
+ maps Claude tool names and models, and spawns child `pi --mode json -p --no-session` runs with depth
545
+ and concurrency limits. A verbatim ycc agent fails on Pi. Source: ADR 0003 decision 3; spike §2.7.
546
+
547
+ **HOOKS.PreToolUse:pi**
548
+ Unsupported. Pi never runs shell hooks or `hooks/hooks.json`; the closest surface is a TypeScript
549
+ extension `tool_call` handler, and `ycc-hooks` is excluded on Pi, so ycc ships no hook port (YAN-1191).
550
+ The ADR 0003 planned verdict is `partial` only for TypeScript handlers, never for shell hooks.
551
+ Source: ADR 0003 decision 5; spike §3.
552
+
553
+ **HOOKS.PostToolUse:pi**
554
+ Same constraint as HOOKS.PreToolUse:pi. The closest Pi event is `tool_result`.
555
+
556
+ **HOOKS.Stop:pi**
557
+ Same constraint as HOOKS.PreToolUse:pi. The closest Pi events are `agent_settled` and
558
+ `agent_before_settle`.
559
+
560
+ **MCP:pi**
561
+ Unsupported today: ycc ships no Pi MCP package. Planned `partial` (YAN-1190): Pi never reads
562
+ `mcp.json` from a package, so `ycc-mcp` becomes a registrar extension calling `pi.registerMcpServer`
563
+ (a same-name user `mcp.json` entry wins), with an opt-in `install.sh --mcp` merge into
564
+ `<agentDir>/mcp.json` as the fallback. Tools are named `mcp__<server>__<tool>` and SSE is rejected.
565
+ Source: ADR 0003 decision 4; spike §2.5.
566
+
567
+ **INSTALL_PATH:pi**
568
+ Unsupported today: no installable Pi package (`packages/pi/*/package.json`, written by the
569
+ YAN-1188 generator) and no `install.sh --target pi` exist. Skills generated earlier under
570
+ `packages/pi/ycc/skills` (YAN-1184) do not count. `scripts/validate_capability_matrix.py` and the
571
+ `PI1` audit fail if an installable package exists while this cell is `unsupported`, and fail if any
572
+ `pi` cell claims support or any `pi` package row is `included` without one. Planned `partial`
573
+ (YAN-1188, YAN-1189): `pi install <abs path>` at user scope or `pi install -l --approve <dir>` at
574
+ project scope, with no catalog. Floor pi `>=1.2.0`, recommended 1.5.0. Installed extensions are
575
+ full-trust code with no sandbox. Source: ADR 0003 decisions 1, 7, 8.
576
+
577
+ **DANGEROUS_MODE:pi**
578
+ Unsupported by design. Pi has no approval modes ("does not ask for approval before every tool
579
+ call"), so there is no `--dangerously-skip-permissions` analogue to emit; an extension `tool_call`
580
+ gate is the only way to add approvals. Source: ADR 0003 decision 6; spike §2.6.
581
+
582
+ **WORKTREE:pi**
583
+ Unsupported today: no ycc skill tree ships on Pi, and Pi has no `WorktreeCreate` event or
584
+ worktree API. Planned `partial` (YAN-1187): skills run `git worktree add` under `.pi/worktrees/`
585
+ through `bash`, and subagent `cwd` points there. Source: ADR 0003; spike §2.4.
586
+
587
+ **MODS:pi**
588
+ Unsupported by design. The Claude Code mod API differs from Pi's `ExtensionAPI`
589
+ (`ctx.ui.setStatus`/`setWidget`/`setFooter`); a status-bar port is new code outside the lockstep.
590
+ Source: ADR 0003 package matrix.
591
+
520
592
  ---
521
593
 
522
594
  ## Artifact store
523
595
 
524
596
  Descriptive only; this is not a parsed capability row. The artifact store (`ycc/skills/_shared/references/artifact-store.md`) is skill-level and identical on claude, cursor, codex, opencode and omp: store resolution, the `.ycc/artifacts/` cache and the `.plans-config` pointer are plain files and Bash helpers, so no target needs extra support for `store: local`.
525
597
 
526
- - **Linear mode needs a Linear MCP in the running runtime.** ycc ships the `linear` / `linear-personal` servers from `ycc-mcp` where the MCP row is supported (claude, cursor, opencode). On codex and omp the MCP row is `partial`: the servers install, but a user's runtime may lack, shadow or not yet have authorized them (see the MCP:codex and MCP:omp notes), so linear mode can be unavailable there until a Linear MCP is configured by hand.
598
+ - **Linear mode needs a Linear MCP in the running runtime.** ycc ships the `linear` server from `ycc-mcp` where the MCP row is supported (claude, cursor, opencode). On codex and omp the MCP row is `partial`: the server installs, but a user's runtime may lack, shadow or not yet have authorized it (see the MCP:codex and MCP:omp notes), so linear mode can be unavailable there until a Linear MCP is configured by hand.
527
599
  - Without a reachable, authorized Linear MCP, skills stop at the Linear call gate before any local write and suggest `store: local`. Local mode never calls Linear.
528
600
  - Every generator emits `.ycc/artifacts/` and `.plans-config` paths verbatim; no target rewrites them. `scripts/validate-artifact-store.sh` checks the occurrence counts of each generated skills tree against `ycc/skills` and that a committed `store: linear` pointer is tracked and not ignored.
529
601
 
@@ -182,6 +182,12 @@ REPO_ROOT="$(git rev-parse --show-toplevel)"
182
182
  # cwd relative to REPO_ROOT ("" at the root, else ending in "/").
183
183
  REPO_PREFIX="$(git rev-parse --show-prefix)"
184
184
 
185
+ # is_blob_text <oid> <text> — succeed when <text> hashes to blob <oid>, so
186
+ # content bash read into a string lost no NUL bytes on the way.
187
+ is_blob_text() {
188
+ [[ "$1" == "$(printf '%s' "$2" | git -C "$REPO_ROOT" hash-object --no-filters --stdin)" ]]
189
+ }
190
+
185
191
  # Accept a .gitignore (path relative to REPO_ROOT) whose working-tree and
186
192
  # stage-0 contents each equal its HEAD content (empty when new) or HEAD plus
187
193
  # one cache rule line, and at least one differs from HEAD. The working tree
@@ -189,15 +195,21 @@ REPO_PREFIX="$(git rev-parse --show-prefix)"
189
195
  # else 100644); the index mode must be 100644 or 100755 and equal HEAD's.
190
196
  # Refuse conflict stages and staged deletions; no index entry for a path new
191
197
  # to HEAD counts as equal to HEAD. Blobs are read by oid so a path like
192
- # `0:x/.gitignore` is never parsed as a revision.
198
+ # `0:x/.gitignore` is never parsed as a revision. The working tree passes when
199
+ # either its bytes or, under a line-ending conversion (core.autocrlf, eol=crlf,
200
+ # text=auto), the content Git's clean conversion produces is HEAD or HEAD plus
201
+ # the rule; the latter only when that content is the bytes with CRLF turned
202
+ # into LF. Content holding NUL bytes, which bash strings drop, is refused.
193
203
  is_artifact_gitignore() {
194
- local path="$1" file head='' index work entry mode type oid stage
195
- local head_mode='' index_mode='' index_oid='' work_mode
204
+ local path="$1" file head='' index work norm entry mode type oid stage
205
+ local head_mode='' index_mode='' index_oid='' work_mode clean_oid
196
206
  file="$REPO_ROOT/$path"
197
207
  [[ -f "$file" && ! -L "$file" ]] || return 1
198
208
  # The x sentinel keeps trailing newlines that command substitution strips.
199
209
  work=$(cat -- "$file" && printf x) || return 1
200
210
  work=${work%x}
211
+ oid=$(git -C "$REPO_ROOT" hash-object --no-filters -- "$path") || return 1
212
+ is_blob_text "$oid" "$work" || return 1
201
213
  # ls-tree -z: "<mode> <type> <oid>\t<path>".
202
214
  while IFS= read -r -d '' entry; do
203
215
  [[ "${entry#*$'\t'}" == "$path" ]] || continue
@@ -206,6 +218,7 @@ is_artifact_gitignore() {
206
218
  head_mode=$mode
207
219
  head=$(git -C "$REPO_ROOT" cat-file blob "$oid" && printf x) || return 1
208
220
  head=${head%x}
221
+ is_blob_text "$oid" "$head" || return 1
209
222
  done < <(git -C "$REPO_ROOT" --literal-pathspecs ls-tree -z HEAD -- "$path" 2>/dev/null)
210
223
  # ls-files -s -z: "<mode> <oid> <stage>\t<path>", one entry per stage.
211
224
  while IFS= read -r -d '' entry; do
@@ -220,6 +233,7 @@ is_artifact_gitignore() {
220
233
  [[ -z "$head_mode" || "$index_mode" == "$head_mode" ]] || return 1
221
234
  index=$(git -C "$REPO_ROOT" cat-file blob "$index_oid" && printf x) || return 1
222
235
  index=${index%x}
236
+ is_blob_text "$index_oid" "$index" || return 1
223
237
  elif [[ -n "$head_mode" ]]; then
224
238
  return 1
225
239
  fi
@@ -228,8 +242,16 @@ is_artifact_gitignore() {
228
242
  read -r _ work_mode _ <<<"${entry#:}"
229
243
  [[ "$work_mode" == "${index_mode:-${head_mode:-100644}}" ]] || return 1
230
244
  fi
231
- [[ "$work" != "$head" || "$index" != "$head" ]] || return 1
232
- is_head_plus_rule "$head" "$work" && is_head_plus_rule "$head" "$index"
245
+ is_head_plus_rule "$head" "$index" || return 1
246
+ if ! is_head_plus_rule "$head" "$work"; then
247
+ # Only a clean conversion that just turns CRLF into LF may qualify.
248
+ norm=${work//$'\r\n'/$'\n'}
249
+ [[ "$norm" != "$work" ]] || return 1
250
+ clean_oid=$(git -C "$REPO_ROOT" hash-object --path="$path" -- "$path") || return 1
251
+ is_blob_text "$clean_oid" "$norm" && is_head_plus_rule "$head" "$norm" || return 1
252
+ work=$norm
253
+ fi
254
+ [[ "$work" != "$head" || "$index" != "$head" ]]
233
255
  }
234
256
 
235
257
  # Plan-artifact paths relative to the directory the plan was written from.
@@ -142,7 +142,7 @@ if not isinstance(packages, dict):
142
142
  print(f"draft-notes.sh: FAIL: {path}: packages must be an object", file=sys.stderr)
143
143
  sys.exit(1)
144
144
 
145
- RUNTIME_ORDER = ("claude", "codex", "cursor", "opencode", "agents", "omp")
145
+ RUNTIME_ORDER = ("claude", "codex", "cursor", "opencode", "agents", "omp", "pi")
146
146
  rows = []
147
147
  for key in sorted(packages):
148
148
  package = packages[key]
@@ -49,7 +49,7 @@ MANIFEST_SUBDIRS = (".claude-plugin", ".codex-plugin", ".cursor-plugin")
49
49
  OMP_MANIFEST_SUBDIRS = (".omp-plugin", ".claude-plugin")
50
50
  EXCLUDED_NAME = "ycc-mods"
51
51
  EXCLUDED_SOURCE_PREFIX = "ycc/mods"
52
- PACKAGE_RUNTIMES = ("claude", "codex", "cursor", "opencode", "agents", "omp")
52
+ PACKAGE_RUNTIMES = ("claude", "codex", "cursor", "opencode", "agents", "omp", "pi")
53
53
  MODEL_REL = "ycc/settings/packages.json"
54
54
  Key = str | int
55
55
 
@@ -195,6 +195,14 @@ def _model_manifests(root: Path) -> list[tuple[str, str, bool, bool]]:
195
195
  for rel in (*(f"{base}/{sub}/plugin.json" for sub in OMP_MANIFEST_SUBDIRS), f"{base}/package.json"):
196
196
  manifests.append((label, rel, status == "included", required))
197
197
  continue
198
+ if runtime == "pi" and mechanism == "native" and "/" not in key:
199
+ # A Pi package's only manifest is packages/pi/<key>/package.json (ADR 0003), but its
200
+ # layout is not final until the packages/pi generator (YAN-1188) lands: an included
201
+ # row fails closed, and a deferred or excluded row suppresses that manifest, like OMP.
202
+ if status == "included":
203
+ raise ReleaseError(f"{MODEL_REL}: {label}: Pi manifest layout is not defined yet")
204
+ manifests.append((label, f"packages/{runtime}/{key}/package.json", False, required))
205
+ continue
198
206
  if mechanism == "native" and runtime in PACKAGE_RUNTIMES[:3] and "/" not in key:
199
207
  subdir = MANIFEST_SUBDIRS[PACKAGE_RUNTIMES.index(runtime)]
200
208
  if runtime == "claude" and key == "ycc":
@@ -10,7 +10,7 @@ metadata:
10
10
  # compatibility-audit
11
11
 
12
12
  This skill audits the health of every generated compatibility target for the
13
- `ycc` plugin — Claude, Cursor, Codex, opencode, and omp (oh-my-pi) — and produces a structured,
13
+ `ycc` plugin — Claude, Cursor, Codex, opencode, omp (oh-my-pi), and pi — and produces a structured,
14
14
  per-target triage report. It detects bundle drift between the `ycc/` source
15
15
  tree and the generated bundles, validates install assumptions (path conventions,
16
16
  shebang lines, executable bits), and surfaces feature-capability gaps using the
@@ -36,10 +36,14 @@ modifies any file.
36
36
  Parse `$ARGUMENTS` for:
37
37
 
38
38
  - **--target** (optional, default `all`) — restrict the audit to a single
39
- target. Accepted values: `claude`, `cursor`, `codex`, `opencode`, `omp`, `all`. When `all` is
40
- specified, phases 2–5 run once per target in the set `{claude, cursor, codex, opencode, omp}`.
39
+ target. Accepted values: `claude`, `cursor`, `codex`, `opencode`, `omp`, `pi`, `all`. When `all`
40
+ is specified, phases 2–5 run once per target in the set
41
+ `{claude, cursor, codex, opencode, omp, pi}`.
41
42
  `omp` has no generated tree or generator yet: skip Phases 2 and 3 for it and
42
43
  report them as `not generated yet` rather than failures.
44
+ `pi` is modeled but has no generated `packages/pi/` tree or generator yet (ADR 0003,
45
+ YAN-1188): skip Phases 2 and 3 for it and report them as `not generated yet`. Phase 4
46
+ still runs its `PI1` check.
43
47
  - **--json** (flag, default off) — emit the final triage report as a
44
48
  machine-readable JSON envelope instead of Markdown. Per-target sections are
45
49
  preserved inside the envelope as structured objects.
@@ -66,7 +70,7 @@ required for Phase 5.
66
70
 
67
71
  Parse `$ARGUMENTS` as described above. Resolve `--target` to a concrete list:
68
72
 
69
- - `all` → `[claude, cursor, codex, opencode, omp]`
73
+ - `all` → `[claude, cursor, codex, opencode, omp, pi]`
70
74
  - any single value → a one-element list
71
75
 
72
76
  If `--dry-run` was passed, print the resolved target list, the scripts that
@@ -152,7 +156,8 @@ Wrap the per-target objects in a top-level envelope:
152
156
  "cursor": { "drift": {...}, "validation": {...}, "install": {...}, "features": {...}, "verdict": "PASS|WARN|FAIL" },
153
157
  "codex": { "drift": {...}, "validation": {...}, "install": {...}, "features": {...}, "verdict": "PASS|WARN|FAIL" },
154
158
  "opencode":{ "drift": {...}, "validation": {...}, "install": {...}, "features": {...}, "verdict": "PASS|WARN|FAIL" },
155
- "omp": { "drift": {...}, "validation": {...}, "install": {...}, "features": {...}, "verdict": "PASS|WARN|FAIL" }
159
+ "omp": { "drift": {...}, "validation": {...}, "install": {...}, "features": {...}, "verdict": "PASS|WARN|FAIL" },
160
+ "pi": { "drift": {...}, "validation": {...}, "install": {...}, "features": {...}, "verdict": "PASS|WARN|FAIL" }
156
161
  },
157
162
  "audited_at": "<ISO-8601 timestamp>"
158
163
  }
@@ -35,7 +35,10 @@ and that plugin-root variable references are rewritten target-appropriately (kep
35
35
  absolute path in generated Cursor and Codex bundles). For `omp`, `OM1` passes while the root
36
36
  `.omp-plugin/` is absent only if the matrix marks `INSTALL_PATH:omp` `unsupported` or `partial`
37
37
  (`partial` with no listed OMP package: installed by `install.sh --target omp` from a generated
38
- export); once the catalog exists, `OM2` requires a valid `.omp-plugin/marketplace.json`.
38
+ export); once the catalog exists, `OM2` requires a valid `.omp-plugin/marketplace.json`. For
39
+ `pi`, `PI1` fails closed both ways on an installable package (`packages/pi/*/package.json`): until
40
+ one exists every `pi` matrix cell must be `unsupported` (a skills-only `packages/pi/ycc/skills`
41
+ tree does not count), and once one exists `INSTALL_PATH:pi` must not be `unsupported`.
39
42
 
40
43
  **Feature-vs-matrix** — output of `audit-target-features.sh`. Cross-references
41
44
  capabilities in the source tree against `target-capability-matrix.md`. Features present
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env bash
2
2
  # audit-install-assumptions.sh — validate install-path assumptions for each
3
- # generated compatibility target (Claude, Cursor, Codex, opencode, omp).
3
+ # generated compatibility target (Claude, Cursor, Codex, opencode, omp, pi).
4
4
  #
5
5
  # Flags:
6
- # --target=<claude|cursor|codex|opencode|omp|all> (default: all)
6
+ # --target=<claude|cursor|codex|opencode|omp|pi|all> (default: all)
7
7
  # --format=<human|json> (default: human)
8
8
  # --help, -h print usage and exit 0
9
9
  #
@@ -12,7 +12,7 @@
12
12
  set -euo pipefail
13
13
 
14
14
  usage() { cat <<'EOF'
15
- Usage: audit-install-assumptions.sh [--target=<claude|cursor|codex|opencode|omp|all>]
15
+ Usage: audit-install-assumptions.sh [--target=<claude|cursor|codex|opencode|omp|pi|all>]
16
16
  [--format=<human|json>] [--help|-h]
17
17
  [repo-root]
18
18
 
@@ -42,7 +42,7 @@ for arg in "$@"; do
42
42
  ;;
43
43
  esac
44
44
  done
45
- case "$TARGET" in all|claude|cursor|codex|opencode|omp) ;;
45
+ case "$TARGET" in all|claude|cursor|codex|opencode|omp|pi) ;;
46
46
  *) echo "audit-install-assumptions.sh: unknown --target: $TARGET" >&2; usage >&2; exit 2 ;; esac
47
47
  case "$FORMAT" in human|json) ;;
48
48
  *) echo "audit-install-assumptions.sh: unknown --format: $FORMAT" >&2; usage >&2; exit 2 ;; esac
@@ -356,6 +356,62 @@ PY
356
356
  else record "omp" "OM2" "FAIL" "${mkt} is not valid JSON"; fi
357
357
  }
358
358
 
359
+ # ---------------------------------------------------------------------------
360
+ # pi checks
361
+ # ---------------------------------------------------------------------------
362
+ run_pi_checks() {
363
+ local pdir="${REPO_ROOT}/packages/pi"
364
+ local matrix="${REPO_ROOT}/ycc/skills/_shared/references/target-capability-matrix.md"
365
+
366
+ # PI1: the installable tree and every matrix pi verdict must agree (ADR 0003). The tree
367
+ # counts as present only once packages/pi/*/package.json exists (YAN-1188): skills land
368
+ # under packages/pi/ycc/skills earlier (YAN-1184). With no installable package every pi
369
+ # cell must be unsupported; with one, INSTALL_PATH:pi must no longer be unsupported.
370
+ if [[ ! -f "$matrix" ]]; then
371
+ record "pi" "PI1" "FAIL" "${matrix} does not exist — cannot read the pi column"; return
372
+ fi
373
+ local verdicts; set +e
374
+ verdicts=$(python3 - "$matrix" <<'PY'
375
+ import sys
376
+ header = None
377
+ for raw in open(sys.argv[1], encoding="utf-8"):
378
+ s = raw.strip()
379
+ if not s.startswith("|"):
380
+ if header is not None:
381
+ break
382
+ continue
383
+ cells = [c.strip() for c in s.strip("|").split("|")]
384
+ if all(c and set(c) == {"-"} for c in cells):
385
+ continue
386
+ if header is None:
387
+ header = cells
388
+ continue
389
+ if "pi" in header and len(cells) == len(header):
390
+ print(f"{cells[0]}={cells[header.index('pi')]}")
391
+ PY
392
+ ); local parse_rc=$?; set -e
393
+ if [[ $parse_rc -ne 0 ]]; then
394
+ record "pi" "PI1" "FAIL" "matrix parse failed (python rc=${parse_rc})"; return
395
+ fi
396
+ local install_path marker="${pdir}/*/package.json"
397
+ install_path="$(sed -n 's/^INSTALL_PATH=//p' <<<"$verdicts")"
398
+ if [[ -z "$install_path" ]]; then
399
+ record "pi" "PI1" "FAIL" "INSTALL_PATH:pi not found in ${matrix}"
400
+ elif ! compgen -G "$marker" >/dev/null; then
401
+ local claimed
402
+ claimed="$(grep -v '=unsupported$' <<<"$verdicts" | tr '\n' ' ' || true)"
403
+ if [[ -z "${claimed// /}" ]]; then
404
+ record "pi" "PI1" "PASS" "${marker} not generated yet (every matrix pi verdict is unsupported)"
405
+ else
406
+ record "pi" "PI1" "FAIL" "${marker} does not exist but the matrix claims ${claimed% }"
407
+ fi
408
+ elif [[ "$install_path" == "unsupported" ]]; then
409
+ record "pi" "PI1" "FAIL" "${marker} exists but matrix INSTALL_PATH:pi=unsupported"
410
+ else
411
+ record "pi" "PI1" "PASS" ""
412
+ fi
413
+ }
414
+
359
415
  # ---------------------------------------------------------------------------
360
416
  # Dispatch
361
417
  # ---------------------------------------------------------------------------
@@ -365,7 +421,8 @@ case "$TARGET" in
365
421
  codex) run_codex_checks ;;
366
422
  opencode) run_opencode_checks ;;
367
423
  omp) run_omp_checks ;;
368
- all) run_claude_checks; run_cursor_checks; run_codex_checks; run_opencode_checks; run_omp_checks ;;
424
+ pi) run_pi_checks ;;
425
+ all) run_claude_checks; run_cursor_checks; run_codex_checks; run_opencode_checks; run_omp_checks; run_pi_checks ;;
369
426
  esac
370
427
 
371
428
  OVERALL_RC=0
@@ -375,7 +432,7 @@ for s in "${CS[@]}"; do [[ "$s" == "FAIL" ]] && { OVERALL_RC=1; break; }; done
375
432
  # Human output
376
433
  # ---------------------------------------------------------------------------
377
434
  emit_human() {
378
- local tgts=(); [[ "$TARGET" == "all" ]] && tgts=(claude cursor codex opencode omp) || tgts=("$TARGET")
435
+ local tgts=(); [[ "$TARGET" == "all" ]] && tgts=(claude cursor codex opencode omp pi) || tgts=("$TARGET")
379
436
  local n=${#CI[@]}
380
437
  for tgt in "${tgts[@]}"; do
381
438
  local pass=0 fail=0 i=0
@@ -419,7 +476,7 @@ ss=[rd(f"{tmp}/s_{i}") for i in range(n)]; ds=[rd(f"{tmp}/d_{i}") for i in range
419
476
  def build(t):
420
477
  ch=[{"id":ids[i],"status":ss[i],"detail":ds[i] or None} for i in range(n) if ts[i]==t]
421
478
  return {"checks":ch,"ok":all(c["status"]!="FAIL" for c in ch)}
422
- names=["claude","cursor","codex","opencode","omp"] if tgt=="all" else [tgt]
479
+ names=["claude","cursor","codex","opencode","omp","pi"] if tgt=="all" else [tgt]
423
480
  out={t:build(t) for t in names}
424
481
  print(json.dumps({"as_of":datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
425
482
  "targets":out,"ok":all(v["ok"] for v in out.values())},indent=2))
@@ -7,7 +7,7 @@
7
7
  #
8
8
  # Flags:
9
9
  # --target=<t>|all Restrict findings to one target: claude, cursor, codex,
10
- # opencode, omp, or all (default: all). `--target <t>` also works.
10
+ # opencode, omp, pi, or all (default: all). `--target <t>` also works.
11
11
  # --format=human|json Output format (default: human)
12
12
  # --strict Exit 1 if any verdict is "unsupported"
13
13
  # --help Show this help and exit 0
@@ -22,7 +22,7 @@
22
22
  #
23
23
  # The parser reads ONE markdown table from the matrix file. Rules:
24
24
  # - The header row must be exactly (after per-cell whitespace trim):
25
- # capability | claude | cursor | codex | opencode | omp
25
+ # capability | claude | cursor | codex | opencode | omp | pi
26
26
  # - Separator rows (cells of dashes) are skipped.
27
27
  # - Each data cell must be one of: supported | partial | unsupported
28
28
  # - The "As of <date>" line is expected anywhere in the file as:
@@ -47,7 +47,7 @@ verdict lines.
47
47
 
48
48
  Flags:
49
49
  --target=<t>|all Restrict findings to one target: claude, cursor, codex,
50
- opencode, omp, or all (default: all). `--target <t>` also works.
50
+ opencode, omp, pi, or all (default: all). `--target <t>` also works.
51
51
  --format=human|json Output format (default: human)
52
52
  --strict Exit 1 if any verdict is "unsupported"
53
53
  --help Show this help and exit 0
@@ -64,7 +64,7 @@ EOF
64
64
  # ---------------------------------------------------------------------------
65
65
 
66
66
  # Canonical target order; must match the matrix header after `capability`.
67
- ALL_TARGETS=("claude" "cursor" "codex" "opencode" "omp")
67
+ ALL_TARGETS=("claude" "cursor" "codex" "opencode" "omp" "pi")
68
68
 
69
69
  FORMAT="human"
70
70
  STRICT=0
@@ -114,7 +114,7 @@ case "$FORMAT" in
114
114
  esac
115
115
 
116
116
  case "$TARGET" in
117
- all|claude|cursor|codex|opencode|omp) ;;
117
+ all|claude|cursor|codex|opencode|omp|pi) ;;
118
118
  *)
119
119
  echo "audit-target-features.sh: unknown --target value: $TARGET" >&2
120
120
  usage >&2
@@ -182,7 +182,7 @@ fi
182
182
  # ---------------------------------------------------------------------------
183
183
  # Parse the capability matrix via Python
184
184
  # Outputs: one line per capability row in the form:
185
- # <capability>|<claude>|<cursor>|<codex>|<opencode>|<omp>
185
+ # <capability>|<claude>|<cursor>|<codex>|<opencode>|<omp>|<pi>
186
186
  # First line is the "As of ..." date (prefixed with "AS_OF:").
187
187
  # ---------------------------------------------------------------------------
188
188
 
@@ -193,7 +193,7 @@ matrix_path = sys.argv[1]
193
193
  matrix_rel = sys.argv[2]
194
194
 
195
195
  VOCABULARY = {"supported", "partial", "unsupported"}
196
- EXPECTED_HEADER = ["capability", "claude", "cursor", "codex", "opencode", "omp"]
196
+ EXPECTED_HEADER = ["capability", "claude", "cursor", "codex", "opencode", "omp", "pi"]
197
197
 
198
198
  lines = open(matrix_path).read().splitlines()
199
199
 
@@ -281,15 +281,16 @@ fi
281
281
  AS_OF_LINE="$(echo "$PARSE_RESULT" | grep "^AS_OF:" | sed 's/^AS_OF://')"
282
282
 
283
283
  # Build parallel arrays: CAPS, VERDICTS_CLAUDE, VERDICTS_CURSOR, VERDICTS_CODEX,
284
- # VERDICTS_OPENCODE, VERDICTS_OMP
284
+ # VERDICTS_OPENCODE, VERDICTS_OMP, VERDICTS_PI
285
285
  declare -a CAPS=()
286
286
  declare -a VERDICTS_CLAUDE=()
287
287
  declare -a VERDICTS_CURSOR=()
288
288
  declare -a VERDICTS_CODEX=()
289
289
  declare -a VERDICTS_OPENCODE=()
290
290
  declare -a VERDICTS_OMP=()
291
+ declare -a VERDICTS_PI=()
291
292
 
292
- while IFS='|' read -r cap cl cu co oc om; do
293
+ while IFS='|' read -r cap cl cu co oc om pi; do
293
294
  [[ "$cap" == AS_OF:* ]] && continue
294
295
  [[ -z "$cap" ]] && continue
295
296
  CAPS+=("$cap")
@@ -298,6 +299,7 @@ while IFS='|' read -r cap cl cu co oc om; do
298
299
  VERDICTS_CODEX+=("$co")
299
300
  VERDICTS_OPENCODE+=("$oc")
300
301
  VERDICTS_OMP+=("$om")
302
+ VERDICTS_PI+=("$pi")
301
303
  done < <(echo "$PARSE_RESULT" | grep -v "^AS_OF:")
302
304
 
303
305
  # ---------------------------------------------------------------------------
@@ -411,6 +413,7 @@ lookup_verdict() {
411
413
  codex) echo "${VERDICTS_CODEX[$i]}"; return ;;
412
414
  opencode) echo "${VERDICTS_OPENCODE[$i]}"; return ;;
413
415
  omp) echo "${VERDICTS_OMP[$i]}"; return ;;
416
+ pi) echo "${VERDICTS_PI[$i]}"; return ;;
414
417
  *)
415
418
  echo "audit-target-features.sh: lookup_verdict: unknown target '$target'" >&2
416
419
  exit 2