# Changelog

## Unreleased

- Bundle the published `ntn-skills@0.3.0` CLI and its complete `ntn-skills`, `ntn-skills-maintain` and `ntn-skills-sync` Skills. Select them through ordinary `$...@builtin` discovery on Pi/OMP/Tern, without a Notion connection or a separate shared Skill installation.
- Retire the experimental `/ntn-skills` command mirror, save bridge and duplicate Tern management palette. Keep `/context-broker` for session, View, status and refresh controls; use the selected builtin Skill and public CLI for content maintenance and synchronization.
- Refresh matching source discovery after a verified CLI write or recovery of its original operation, including progress JSONL and OMP artifact output. Preserve active snapshots and unresolved operations.

- Select default Notion metadata through saved Views. Support per-source `default_view_id`, first-View fallback and session `/context-broker views` / `view`. Inject current metadata before the first user-triggered request and replace it on subsequent switches without unloading active Skill snapshots. Preserve branch/resume choices and independent sessions.
- Keep full `$` discovery separate from View selection. Retain valid exact records and nonblocking warnings from partial catalogs; continue to reject selected-content permission and integrity failures.

- Snapshot native prompt metadata before asynchronous dollar catalog work. Retire captured menu contexts at session boundaries, bind retained providers to the current session, and observe startup refresh rejections so delayed discovery cannot crash Pi after a session replacement or reload. Add deterministic delayed-refresh coverage with old-menu prompt pinning and replacement-session completion.
- Restore first-root normalized-name precedence for unscoped local Skills across discovery, native prompt fallback and configured invocations. Keep existing `@local` references callable without a collision, preserve independent source and record-kind identities, and verify actual Pi/OMP submissions with shadowed duplicate roots.
- Order shared Notion catalogs by exclusive invocation reservations and immutable publication directories, preserving source freshness independently. Prevent delayed-response rollback, retain corrupt latest observations as ordering fences, and retire verified duplicate snapshot stages without deleting diagnostic bytes. Add deterministic equal-time and clock-rollback acceptance alongside actual concurrent Pi/OMP first-body verification.
- Document daily `SOURCE_RESPONSE_INVALID` failures caused by a newer source CLI paired with an older installed Broker schema, including upstream metadata. Require matching host installation, process restart and real terminal selection/body evidence after full resource initialization.
- Supply pinned Skill refs, snapshot IDs and database-scoped resource-read argument arrays beside selected Notion bodies. Prefer `read SNAPSHOT --path RELATIVE` so Pi/OMP can read resources with hidden local directories and without shell URI rewriting. Distinguish introduction from adopting workflow style or prerequisites; add an isolated real-model consumer recipe with normal tools, neutral cwd and request/tool path-exposure evidence.
- Add default lightweight ntn-skills XML guidance for Pi/OMP using the configured CLI argv and source/database scopes. Reuse effective-context deduplication, preserve guidance across repeat/fork/resume, and restore missing guidance after compaction or rewind without requiring a Skill invocation; guard provider requests against missing guidance as well.
- Refine CLI guidance from real Pi print model traces: provide database-scoped argument arrays and top-level read fields, distinguish positional `files` targets from pinned relative `read --from`, reuse complete bodies for introductions, read supporting resources only when needed, and inspect CLI errors before continuing discovery. Add an escaped, path-mode-aware Skill directory beside Pi's loaded body so named resources can be read directly without directory searches.
- Add live Notion cache lifecycle acceptance across real Pi/OMP terminals and a Tern/OMP composer: independent empty CLI/Broker roots, repeated/new-session/new-process reuse, direct owned page/resource edits, guarded inspection and acceptance of the exact edited publication, actual default five-minute expiry, active-context snapshot pinning and matching resource consumption. Preserve complete-body digests, per-surface HTTP/CLI/provider evidence and owned cleanup receipts.
- Remove the whole-command timeout for interactive Notion Skill loading. Apply `requestTimeoutMs` to each source CLI network attempt (default 30000), retaining cancellation, process-tree cleanup and the bounded local identity probe. Verify a 65-second native load, request-failure recovery and Stop/Escape cancellation; give the genuine native tool-read case its own cold host and cache.
- Match upstream subscription prefixes such as `$pstack/` and `$pstack/cor` across automatic, terminal and detached completion. Scope explicit subscription queries to its Skills, retain exact page selectors, and invalidate old metadata indexes and CLI catalog recipes that cached repository basenames. Reload existing OMP sessions with `/restart` after upgrading the extension.
- Display upstream Skill candidates as `repo/skill name` from validated CLI catalog provenance, retaining complete invocation selectors in details and exact selection values across Pi, OMP and detached/manual completion. Add native and Pi terminal acceptance routes for repository labels and selected-body delivery.
- Persist Notion metadata by credential/remote-catalog identity across Pi/OMP and projects, removing cwd, command spelling, source labels and policy partitions. Resolve equivalent database selectors through the CLI, share immutable scope/record/snapshot exports, retain original validation time and evaluate TTL per consumer. Add reusable dual-host shared-cache acceptance for cross-project reuse, refresh, old-session pinning and new-revision reuse, alongside existing menu refresh/failure checks. Keep partial-menu item positions stable, typed source failures and selected-snapshot authorization.
- Align native and daily manual-picker probes with the current insertion-only picker. Verify a single initial `$` before refining the query, preserve cached choices through a failed background refresh, and report the catalog-cache scenario's actual assertions.

- Decouple OMP composer/editor/completion startup from Notion metadata discovery. Keep metadata publication separate from session activation generations, preserve late default-catalog metadata in the composed system prompt, and retain Pi's synchronous discovery and source-failure isolation. Add the installed cold-input, `/new`, retained `/restart` and fresh-process verification matrix.
- Align integration harnesses with v3 record snapshots, verified exported resources, central builtin data roots and the current CLI command contract. Assert persisted continuation body deduplication, isolate npm workspace installation and document independent unrun shared-content cases.
- Keep cold catalog lookups alive until initial suggestions resolve and cancel superseded requests without waiting for remote discovery. For OMP's forced-file completion protocol, return existing candidates during refresh; partial-capable menus retain selection identity through updates. Preserve edited drafts when cancelled preparation finishes late.
- Add a daily installed `captured --invocation dollar` acceptance route for unchecked Notion Skills: actual native popup and capsule, no provider dispatch on selection, and one complete pinned snapshot body on submission. Keep native slash and manual-search results explicitly unrun in this route. Use short system-temp sockets, an explicit owned launch directory, current record-identity snapshot paths and snapshot-projection read/export equality.
- Align Pi PTY readiness with version-3 snapshot receipts and canonical ContentRecord identities, retaining exact source completion, locator, scope, file inventory and byte/hash checks before accepting terminal input.

- Restrict the independent historical Bundle converter to catalog/session schema fields; preserve authored literals, immutable snapshots and resource paths instead of rewriting every string. Add a byte-corruption regression covering structured references and retained source identities.
- Preserve official CLI display names and consume their invocation aliases unchanged, including Unicode, digits and percent-encoded punctuation. Align local aliases with the same NFC naming syntax; keep qualified candidate identity/ref selection exact and reject control characters without decoding invocation payloads.
- Pass unmatched unqualified/qualified names, aliases and sources through as exact user text, including runtime paths; keep valid mixed Skill/Prompt/Router preparation and a single dispatch. Treat selected-target typed not-found as a soft miss without source fallback; retain ambiguity and genuine selected-record access, network, catalog and integrity failures, cancellation/session guards and literal-example/bootstrap protections.
- Retain local Router declarations when entries are absent (`ENOENT`/`ENOTDIR`) or exceed the discovery scan limit (`LOCAL_ENTRY_TOO_LARGE`), preserving name, path, ref and id with an unavailable reason (including byte count/limit for oversized entries). Keep Router counts intact without reading unavailable entry bodies during discovery.

- Preserve the original OMP autocomplete provider receiver for native inline hints and synchronous helpers, preventing private-field errors during ordinary typing and native editor descriptions. Bind decoration hooks to their constructed editor instance.
- Verify Broker consumer and independent Tern runtime installs with npm's default peer resolution in clean isolated homes. Keep Pi/OMP peers optional, use exact direct official Effect dependencies instead of consumer-wide overrides, and compare official runtime file inventories between the two installed closures.
- Refresh OMP dollar completion when the caret moves into a valid prefix without changing text. Bind candidates to the current draft, cursor and generation; abort obsolete lookups, reject split UTF-16 cursors, preserve foreign autocomplete and accepted chip deletion/undo, and keep clicks inside accepted chips closed.
- Bind explicit activation to host interactive/RPC input or native command receipts for the current session and preparation generation. Before-agent bootstrap text and unrelated extension messages cannot initiate activation; Markdown code and escaped examples remain literal. Preserve qualified selectors, failed-input drafts and active Prompt snapshot authority until the turn ends.
- Consume strict ContentRecord catalogs and pinned read/export receipts for Skill, Router and Prompt. Use JSON tuple identities and portable v2; rename domain Bundle to Router with explicit historical conversion. Keep Router members lazy and Prompt requirements at user-task level for every submission, sharing fixed prepared snapshots with cancellation/session generation guards. Add identity/kind/source/ref to shared v1 completion candidates.
- Keep submitted Prompt entry/resource reads pinned after `agent_start` releases preparation; discard turn authority on completion or lifecycle reset and prepare fresh snapshots on the next submission. Cover upstream snapshot changes in both host submission contracts.
- Compare immutable Notion record receipts and verified inventories structurally so JSON property order cannot create false conflicts; retain full metadata, content and file hash conflict checks.
- Request explicit CLI snapshot projections for host preparation, verify every exported file hash/byte length/role and the exact pinned read entry, and retain generated Router members and resources. Rebuild source-projection cache receipts once as version 3 while preserving invalidated directories; keep authored source exports separate.

- Add reusable isolated Pi PTY verification for real candidate selection, draft acceptance and submission in both native/dollar directions. Keep controlled-provider, live Notion, installed artifacts and real-model proof separate; record actual owned-process exits, safe helper help/doctor and installed entry hashes in the existing verification routes.
- Select the running host adapter once from the extension API. Keep `CONTEXT_BROKER_HOST` limited to fallback default paths; move OMP loaded-Skill guidance and editor installation into its adapter, type native input/events and receipt protocols, and retain cancelled handoffs until the pending consumer acknowledges them. Reuse the existing dual-host, source, global-config and native-editor verification routes.
- Preserve Pi native Skill arguments after any whitespace separator. Share the matching native activation receipt with the current injection consumer so a `/skill:` invocation containing its own `$` selector delivers one body before session persistence. Cover the actual dual-host provider boundary in the existing integration runner.

- Advertise only Notion Skills checked with `Default Context` in the native Pi/OMP default catalog while retaining every record for explicit selection, search, completion and reads. Prepare checked bodies/resources in the background without session activation or loading records; share scoped in-flight work, retain CLI freshness validation, and cancel obsolete generations. Keep detached Tern completion metadata-only and host differences in adapters within one package.
- Keep cold preparation UI verification independent of background prefetch and previously loaded instructions: use an unchecked controlled page and fresh sessions, compare the first request with the actual pinned export, and resume the exact recorded error/recovery session.
- Verify native Stop during checked-Skill background preparation with an empty cache, preserving the shared download, blocking the cancelled submission and consuming the prepared body and resource on explicit retry.
- Exercise native session changes and graceful RPC EOF with retained lifecycle events and source-process exits. Keep Pi's outgoing runtime disposal distinct from OMP's surviving background preparation and native composer cancellation.
- Require bundled builtin-management CLI capabilities during builds; allow an explicit `NTN_SKILLS_BUILD_ENTRY` for a matching local CLI checkout. This build path does not establish registry publication or installed-host acceptance.
- Keep the selected CLI's official Effect/platform/SQLite 4.0.5 runtime external in both identical Node consumers. Pin Broker production dependencies and overrides, reject mismatched selected manifests/installations, and install Tern's real production closure under `query/node_modules` for inclusion in the standalone tar archive.
- Bind OMP profile configuration to the host's `getAgentDir()` before configuration loading and recognize compiled `omp-*` entries. Keep builtin installation independent of host profiles; Tern management needs no mandatory `agentDir`, and optional `builtinAgentDirs` selects additional distribution roots. Broker and companion keep separate matching CLI bundles.
- Add built-in filesystem and Notion `sources` alongside existing roots/catalogs, with source identities, namespaces and strict configuration examples/schema. Keep Notion authentication in the existing CLI.
- Publish filesystem metadata and Notion records checked with `Default Context` to the default host Skill catalog, and activate only selected entries through native read, native `/skill:`, `$` chips and Tern manual search. Preserve canonical source tokens and fail on ambiguous unqualified identities; filesystem selection copies the complete Skill directory/resources into a shared process snapshot.
- Read selected Notion page-id references and export complete pinned snapshots/resources into caches isolated by source, scope, page and snapshot. Block incomplete discovery/activation with sanitized source errors.
- Keep source activation failures owned by host gates so denied, malformed and timed-out reads block the turn without terminating the host.
- Add explicit metadata refresh and document search-index coverage limits, exhaustive explicit-database scope, pinned selection/session behavior and restart requirements.
- Extend broker verification and add the Notion integration verification Skill with nine feature maps; route CLI consumption verification to the CLI repository. Verification procedures do not claim a completed run.
- Add daily installation verification using the actual broker configuration and installed Tern/OMP components, with native slash-menu selection, dollar chips, manual search, live Notion reads and separate captured-provider/model modes. Retain action, content and process-cleanup evidence.
- Wait for the actual agent turn to finish when an OMP print/json source Skill command triggers an asynchronous custom message; native `/skill:` no longer exits successfully before the provider request begins.
- Preserve one source body when switching between native `/skill:` and `$` in OMP and Pi. Reuse the active context without creating another loaded receipt. OMP resolves exact native metadata entry paths; Pi transforms already-loaded native invocations before host expansion and pairs first-use command receipts with expanded user-message digests still present in the active context. Same-name entries from other sources and user-authored XML do not suppress activation. Require one body in both transition directions for both hosts.
- Replace duplicate source Skill loading labels with persistent, collapsible transcript `Read ntn-skills://<alias>` records showing source, elapsed time, and running/done/error states. Retain terminal records and restore them on resume; mark old running records interrupted. Keep empty message content and display-only details out of provider context, compaction, and branch summaries. Start preparation synchronously on Enter with an editable draft, blocked resubmission, and native running/Stop. Send the original prompt/images and full selected body once after success; failure, timeout, cancellation, and session changes prevent deferred provider dispatch. Preserve real `skill://` tool reads, source deadlines, nonvisible read waits, and the cancellable headless guard.
- Bundle `ntn-skills` and its runtime/license closure with the broker and independent Tern query; require only official `ntn` externally and check its version, API capability and authentication. Isolate unavailable sources so local/healthy discovery and ordinary chat continue, block unavailable selections, and recover after explicit refresh. Cover missing dependencies in both hosts, native UI and unpacked production installs.
- Disambiguate same-name local and source completion entries with readable `$name@local` and `$name@namespace` selectors instead of identity hashes. Preserve source identities, native names, canonical namespace/page tokens and explicit ambiguity rejection; report invocation errors with actionable selectors instead of disguising them as source activation failures.
- Use `$alias@namespace` for every Notion completion and manual-search candidate, including nonconflicting Skills. Keep page disambiguators before the namespace for duplicate aliases. Show `Read ntn-skills://alias` without the namespace prefix while retaining source details, native host names, and resource identities.
- Verify daily native Skill consumption against the installed host's rendering of the pinned portable export, retaining exact full-message matching when OMP compacts Markdown table spacing. Keep dollar selection checks tied to the actual installed completion candidate.
- Preserve dots inside source selectors such as `$ui-alpha@team.prod` during submission while excluding trailing sentence periods; verify completion-to-body selection and repeated OMP consumption.
- Clarify OMP/Tern loaded-Skill consumption in the per-turn system prompt and dollar payload: complete bodies satisfy read-before-use, identify the invocation and native source name, and carry a resource directory that respects path privacy. Use loaded instructions directly while retaining on-demand resource reads and normal loading after context removal. Keep this prompt rule specific to OMP.
- Extend daily installed Tern/OMP verification with cold model `$` capsule submission, exact raw/XML-escaped body counting, and observed entry/metadata/resource reads and snapshot globs. Keep native and captured entrypoints explicit and preserve owned-process cleanup evidence.
- Run real Notion model consumption independently in Pi and OMP, defaulting to both hosts with an explicit single-host selector. Retain each host's metadata/read/resource/provider/final-response evidence and report unrun hosts. Document Pi terminal selection separately from Tern/OMP UI and require one body across native/dollar transitions for both hosts.

- Shorten the bilingual project entrypoints, move detailed broker configuration into bundled package references, and make the bilingual Tern package guides own installation, profiles, updates and local development. Include documentation link targets and both Tern languages in distribution artifacts.
- Document OMP/Tern plugin coexistence, sole ownership of injection by the OMP broker, and the verified Esc-then-shortcut sequence for switching to manual search; simultaneous menus are not covered.
- Split the repository into independently distributable Pi/OMP and Tern packages. Preserve the npm name `pi-context-broker` and move local extension entry paths under `packages/context-broker`.
- Add a standalone JSON completion CLI shared with the Tern distribution, preserving Skill/Bundle discovery and ranking.
- Add an optional Tern native search dialog on Ctrl+Alt+Shift+K with UTF-16 draft replacement, stale-draft cancellation, and a bundled query requiring Node.js 22+. The dialog does not submit prompts.
- Include the bundled Tern query and license notices in Git so the companion installs directly from its GitHub subdirectory without a build or npm release.
- Add automatic caret-anchored OMP Skill/Bundle dropdowns using the native editor completion UI, including native Surface edits. Keep the Tern centered picker as an optional manual command.
- Accept OMP's AbortSignal autocomplete contract as well as Pi's options object so candidate queries no longer fail on OMP 18.10.3.
- Allow `$` completion directly after prose and multiple times in one draft, with matching submit-time invocation parsing.
- Render accepted OMP Skill/Bundle candidates as native atomic chips using `/skill:` styling, whole-chip deletion and undo, while expanding back to `$name` on submission. Preserve built-in autocomplete hints, inline replacements and forced file completion.
- Keep clicks inside accepted OMP chips from reopening dollar completion while allowing caret-only moves into ordinary dollar prefixes to refresh candidates. Cover multiple chip positions, deletion, undo and new completion.
- Widen broker dollar menus in Tern to 720 px, reserve more space for long names, and constrain the popup to narrow panes. Scope companion styling to broker-marked menus while preserving native slash completion layout.
- Correct OMP activation guidance: use `/restart` after extension code updates; `/reload-plugins` refreshes discovery state and `/reload` is not a built-in command in OMP 18.10.3.
- Restrict XML fallback deduplication to broker custom messages with matching record kinds, so ordinary quoted examples and same-name bundles cannot suppress real skill loading.
- Add actual provider-body-count regressions for both CLI hosts, compaction retention/removal, forks, rewinds and persistent continuation; run pinned host checks before CI publication.
- Add independent artifact installation checks, repeatable native Tern/OMP interaction acceptance, and an explicit guarded `magpie/group/flash-free` default-compaction smoke with transport evidence.
- Execute the configured release `checkCommand` before release commits, tags and pushes; remove the obsolete local-check bypass and add behavior regressions for failure, success and planning modes.
- Resolve Volta host shims before isolating fixture HOME, launch Node host entries directly, and terminate only fixture process groups on timeout to prevent recursive Pi startup.
- Add the project-local `.agents/skills/verify-context-broker` Skill with five feature maps and a read-only Doctor, execution/evidence helper; retain command transcripts and actual runtime versions.
- Start and retain ownership of the native UI verification daemon explicitly; wait for the owned window/daemon to exit and preserve process and cleanup receipts with screenshots.
- Remember **Not Now** for OMP update management in each native verification window's temporary config before startup, avoiding repeated **Manage omp** prompts while preserving the daily Tern preference.

- Apply first-root normalized-name precedence to configured skill invocations as well as `$` discovery, so overlapping runtime and source roots do not make `skill:` and keyword-rule targets ambiguous.

- Follow directory and `SKILL.md` symlinks during discovery while preserving the discovered path for relative references. Skip broken links and ancestor cycles, retain scan limits, and cover first-root precedence through autocomplete and injection.

- Remove entity Bundle Skill materialization (`exposeBundlesAsSkills`, `/context-broker materialize`, generated lifecycle, compact entity routing, and member path anchors). Context Broker now keeps runtime virtual Bundle discovery/injection separate from durable Router Skills owned by the distributing Skill repository.

- Support multiple keyword trigger profiles in one rule file through a top-level `rules` array, enabling generated scene-to-Bundle rule projections while preserving legacy single-profile files.
- Allow keyword rules to inject catalog bundle indexes with explicit `bundle:<name>` targets.
- Keep unprefixed rule targets Skill-only and make Bundle rule lookup exact and fail-closed.

## 0.0.2

- Let a catalog bundle intentionally shadow a same-name skill in `$` lookup.
- Rank matching bundles before same-score skills in `$` autocomplete.

## 0.0.1

- Initial standalone Pi/OMP context-broker package.
- Supports explicit `$name` context injection for skills and bundle records.
- Adds `/context-broker` diagnostics commands.
- Adds path privacy controls and bounded skill scanning defaults.
