Skip to content

feat(v0.19): skills lifecycle, follow-up chaining, multilingual picker search & woken-turn reliability - #141

Merged
rlaope merged 1 commit into
masterfrom
feat/v0.19-skills-lifecycle-and-woken-reliability
Dec 1, 2026
Merged

rlaope merged 1 commit into
masterfrom
feat/v0.19-skills-lifecycle-and-woken-reliability

Conversation

@rlaope

@rlaope rlaope commented Dec 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Skills lifecycle & follow-up chaining (core/skills.ts, core/commands.ts, index.ts, tui/cli.ts, tui/app.ts):
    • Added /skills show <name> across chat (with withoutHome() scrubbing + one-click ▶ <slug> button) and dsh TUI card (formatSkillDetail(), symlink-safe & bounded, tenant-safe).
    • Added TUI /skills edit <name> launching $EDITOR on workspace skills (createIfMissing: false safety, refuses read-only global skills, unconditional clearSkillsCache()).
    • Enriched createSkillScaffold() with optional triggers/inputHint/next metadata & commented YAML hints, and attached a one-click ▶ <slug> button on chat /skills new <name> replies.
    • Added declarative next: YAML frontmatter skill chaining (followUpSkillButtons()): explicit and auto-matched chat skill turns attach up to 3 validated, in-scope ↪ <slug> follow-up buttons resolved via direct findSkill().
  • Multilingual Alt+S / /skills picker search (tui/picker.ts, tui/cli.ts):
    • Added hidden PickerRow.keywords so typing Korean/English/Chinese triggers (브리핑, 회의록, 주간, 리서치) in Alt+S matches skills immediately without cluttering visible rows.
  • Background-job & woken-turn reliability fixes (core/harness.ts, index.ts, PLAN.md):
    • summarizeTurn(session, firstSeq, endSeq) + releasing activeTurns before sessions.flush() (with activeTurns guards on streamForwarder/questionAnswerer and liveKeyOf fallback in deliveryWatcher) so woken answers during flush are delivered without leaking streams or merging into the original turn.
    • draining flag + cap exemption/promotion in keepForJobs/releaseWhenDone (plus releasingKept re-entrancy guard) so maxKeptAgents never silently disposes an already-woken finishing reply or lets draining agents starve real jobs.
    • watchJobs() reload/unload re-subscription and kept-agent sweep.
    • Accurate terminal busy(key) during kept-agent woken waits while excluding quiet turns across liveOrigins, runningTurns, and waiting.
    • Cleaned stale PLAN.md Open entries already resolved in v0.6/v0.12.

Verification

  • Independent Adversarial Reviewer audited master..HEAD and all 12 findings were fixed.
  • Full local gate (pnpm run build && pnpm run typecheck && pnpm test) passed (EXIT=0), including test/v19-skills-lifecycle-and-woken.test.ts (43/43), test/core.test.ts (673/673), and test/secrets.test.ts.
  • Real-model acceptance scenario node test/run-scenario.ts test/scenarios/auto-skills.json passed 1/1 in an isolated test home with zero tool calls.

Unverified

  • Live mobile Slack/Discord/Telegram rendering of ↪ <slug> follow-up buttons and manual TTY $EDITOR spawning for /skills edit were verified via fakes/unit tests rather than live mobile clients or a manual TTY editor.

…icker search, and woken-turn reliability

Problem:
- Users could list, run, and scaffold skills, but could not inspect a skill's
  triggers/workflow (`/skills show`) or edit workspace skills in `$EDITOR`
  (`/skills edit`), and `dsh` `Alt+S` picker filtering missed multilingual
  `triggers:` because `Picker` searched only `label` and `detail`.
- Creating a skill in chat required typing `/s:<name>` afterwards, and skills
  had no declarative way to offer follow-up skill buttons on completed chat
  answers.
- Four background-job / woken-turn gaps remained in `PLAN.md`: woken answers
  during `sessions.flush()` could be swallowed by `activeTurns` (or miss
  unmapped first-turn `liveKeyOf`), `maxKeptAgents` could silently dispose an
  already-woken finishing reply, a `jobs` service reload/unload left stale
  subscriptions, and terminal `busy(key)` undercounted while a kept agent
  waited for a woken turn.

Changes:
- Extended `core/skills.ts` with `next:` YAML frontmatter parsing (comment- and
  quote-aware YAML scalar/list parsing, >48-char slug rejection, self-loop
  exclusion), `followUpSkillButtons()`, `formatSkillDetail()` (symlink-safe,
  bounded read, zero host-path leakage), enriched `createSkillScaffold()` with
  optional `triggers`/`inputHint`/`next` & commented hints, and
  `clearSkillsCache()`.
- Wired `/skills show <name>` across `core/commands.ts`, `index.ts` (with
  `withoutHome()` scrubbing and one-click `▶ <slug>` button), and `tui/cli.ts`,
  plus TUI `/skills edit <name>` (`tui/app.ts` `createIfMissing: false` guard +
  unconditional cache invalidation), chat `/skills new` one-click run button,
  and declarative `next:` follow-up buttons (`↪ <slug>`) resolved via direct
  `findSkill()` after explicit and auto-matched skill turns.
- Added `PickerRow.keywords` in `tui/picker.ts` and passed skill `triggers:`
  from `tui/cli.ts` so `Alt+S` / `/skills` filters across Korean/English/Chinese
  triggers without cluttering visible rows.
- Fixed the 4 background-job / woken-turn reliability bugs in `core/harness.ts`
  and `index.ts`: `summarizeTurn(session, firstSeq, endSeq)` isolation +
  releasing `activeTurns` before `sessions.flush()` with `activeTurns` guards on
  `streamForwarder`/`questionAnswerer` and `liveKeyOf` fallback in
  `deliveryWatcher`; `draining` flag + cap exemption/promotion in `keepForJobs`
  and `releaseWhenDone` (with `releasingKept` re-entrancy guard); `watchJobs()`
  reload/unload re-subscription and kept-agent sweep; and accurate `busy(key)`
  excluding quiet turns in `liveOrigins`, `runningTurns`, and `waiting`.
- Added hermetic cross-platform suite `test/v19-skills-lifecycle-and-woken.test.ts`,
  wired CI (Ubuntu + Windows), added real-model acceptance scenario
  `test/scenarios/auto-skills.json`, and updated `PLAN.md`, `CHANGELOG.md`, and
  `docs/setup.md` (removing stale `Open` bullets already fixed in v0.6/v0.12).

Verified:
- Independent adversarial review completed and all 12 findings fixed.
- Full local gate (`pnpm run build && pnpm run typecheck && pnpm test`) passed
  (`EXIT=0`), including `test/v19-skills-lifecycle-and-woken.test.ts` (43/43),
  `test/core.test.ts` (673/673), `test/v18-natural-skills-ux.test.ts`, and
  `test/secrets.test.ts`.
- Real-model scenario `node test/run-scenario.ts test/scenarios/auto-skills.json`
  passed 1/1 in an isolated test home with zero tool calls.

Unverified:
- Live mobile Slack/Discord/Telegram rendering of `↪ <slug>` follow-up buttons
  and interactive TTY `$EDITOR` spawning for `/skills edit` were verified via
  fakes/unit tests rather than live mobile clients or a manual TTY editor.

Signed-off-by: rlaope <rlaope@users.noreply.github.com>
@rlaope
rlaope merged commit f85a490 into master Dec 1, 2026
5 checks passed
@rlaope
rlaope deleted the feat/v0.19-skills-lifecycle-and-woken-reliability branch December 1, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant