Commit Graph
11 Commits
Author SHA1 Message Date
haelyra 4e337f0a43 fix: integrate contributor snapshot allocation revision 2026-10-11 10:48:41 -04:00
Eneko Ruiz 6d8e69df52 fix: skip occupied snapshot paths without overflowing 2026-10-11 16:29:15 +02:00
haelyra a7e5c4d030 fix: preserve snapshot paths and reject malformed skill tracking rows 2026-10-11 06:32:21 -04:00
haelyra 2f8b126e3a Merge reviewed contributor PR #3507 for incoming stewardship 2026-10-11 06:17:51 -04:00
haelyra a33e5b3312 Merge reviewed contributor PR #3506 for incoming stewardship 2026-10-11 06:17:51 -04:00
Eneko Ruiz 1ae4b88e06 fix: skip non-object skill execution JSONL rows 2026-10-11 11:35:31 +02:00
Eneko Ruiz acb75bc1ed fix: ignore directories when listing skill snapshots 2026-10-11 11:33:41 +02:00
Eneko Ruiz 32bbddab1d fix: keep unchanged skill rates stable at zero threshold 2026-10-11 11:31:21 +02:00
YogurDungeon b4943a5e4b fix: record skill runs under OpenCode and report unmeasured skills honestly
Under OpenCode the skill-health dashboard had no writer and no honest
fallback, so it reported every discovered skill as healthy (#2463).

Root cause: `post:skill:track` is only wired for Claude Code, where
`posttooluse-dispatcher.js` fans the event out to `skill-run-tracker.js`.
The OpenCode plugin re-implements the harness events instead of reusing that
dispatcher, so nothing ever wrote `skill-runs.jsonl` — and the tracker's
matcher only accepted the exact Claude Code tool name `Skill`, while OpenCode
calls the tool `skill`, so even wiring it would have dropped every event.
Commands that locate ECC through the inlined resolver in
`scripts/lib/resolve-ecc-root.js` also fell back to `~/.claude`, which does
not contain ECC, so they could not find their scripts.

Changes:

- `.opencode/plugins/ecc-hooks.ts`: dispatch `post:skill:track` from
  `tool.execute.after`. The tracker module is imported lazily and behind
  try/catch, matching the existing `changed-files-store` pattern: this file is
  OpenCode's startup entry point, so a static import failure would crash the
  session before any hook runs (#2530). The module is reused rather than
  reimplemented, keeping its identifier validation, length bounds and
  "never persist prompt text" guarantees.
- `scripts/hooks/skill-run-tracker.js`: match the tool name case-insensitively
  so `Skill` and `skill` are both accepted.
- `scripts/lib/skill-evolution/health.js`: split the summary into
  measured/healthy/declining/unmeasured instead of deriving `healthy = total -
  declining`, which turned "no telemetry" into "everything is fine" for every
  skill.
- `scripts/lib/skill-evolution/dashboard.js`: show the breakdown and warn
  explicitly when skills have no recorded runs, since absence of telemetry is
  not a health signal.

Under OpenCode the resolver also needs `CLAUDE_PLUGIN_ROOT`, which only the
plugin can supply: `shell.env` exports it when a root is found, without
replacing a root the user set or one an earlier plugin already put in
`output.env`.

Root discovery is per capability and probes required runtime files — never
optional content. Probing for `skills/continuous-learning-v2` (the
`workflow-quality` module) rejected supported modular installs that ship the
plugin and tracker without that optional module, disabling telemetry and the
root export for exactly those users.

Also fixes an incidental bug: the compiled plugin bundle is ESM, where
`__dirname` is undefined, so the ECC version lookup silently fell back to its
default. The module directory is now derived from `import.meta.url`.

Tests: `tests/opencode-plugin-hooks.test.js` covers the telemetry dispatch
(skill tool recorded, other tools ignored, minimal profile respected), a
modular install without the optional skills module, the root export and both
override paths; `tests/hooks/skill-run-tracker.test.js` covers the
case-insensitive matcher; `tests/lib/skill-evolution.test.js` and
`tests/lib/skill-dashboard.test.js` cover the unmeasured bucket, the warning
and the aged-out-coverage wording.

Refs #2463, #2530
2026-10-07 19:45:21 -05:00
Affaan Mustafa fc96be4924 test: cover skill tracker edge paths 2026-04-29 19:21:03 -04:00
Affaan MustafaandGitHub d5371d28aa feat: add skill evolution foundation (#514) 2026-03-15 21:47:39 -07:00