From 913396337be8b943b609474944550818e3a9d791 Mon Sep 17 00:00:00 2001 From: Guilherme Beira Date: Fri, 19 Jun 2026 08:29:00 -0300 Subject: [PATCH] refactor(directory): rename worker iii-directory -> directory Rename worker folder, manifest name:, crate/lib, function namespace (directory::*), worker dependencies (harness + approval-gate), CI allowlists + interface scripts, turn-orchestrator prompts, console fixtures, and docs from iii-directory to directory. Binary stays 'iii-directory' (Cargo [[bin]].name + iii.worker.yaml bin: + clap command name + invocation examples + e2e cargo artifact path); the engine installs/loads it under the worker name 'directory'. Update harness prompt golden length for the shortened worker name. External SDK deps (iii-sdk, iii-state, ...) untouched. --- .github/scripts/collect_worker_interface.py | 2 +- .../scripts/parse_publish_workers_input.py | 2 +- .../tests/test_normalize_worker_interface.py | 2 +- .github/scripts/validate_worker.py | 4 +- .github/workflows/create-tag.yml | 2 +- .github/workflows/release.yml | 2 +- README.md | 2 +- approval-gate/iii.worker.yaml | 2 +- .../src/components/chat/directory/parsers.ts | 4 +- .../chat/worker/__tests__/parsers.test.ts | 2 +- console/web/src/hooks/use-worker-lifecycle.ts | 2 +- .../src/stories/fixtures/engine-fixtures.ts | 18 +++--- .../src/stories/fixtures/worker-fixtures.ts | 6 +- {iii-directory => directory}/Cargo.lock | 56 +++++++++---------- {iii-directory => directory}/Cargo.toml | 4 +- {iii-directory => directory}/README.md | 14 ++--- {iii-directory => directory}/build.rs | 0 .../config.yaml.example | 10 ++-- .../examples/test_registry.rs | 4 +- {iii-directory => directory}/iii.worker.yaml | 2 +- {iii-directory => directory}/skills/SKILL.md | 4 +- {iii-directory => directory}/src/config.rs | 2 +- .../src/configuration.rs | 18 +++--- {iii-directory => directory}/src/fs_source.rs | 0 .../src/functions/download.rs | 0 .../src/functions/engine_fn.rs | 0 .../src/functions/error.rs | 0 .../src/functions/mod.rs | 6 +- .../src/functions/prompts.rs | 0 .../src/functions/registry.rs | 0 .../src/functions/skills.rs | 26 ++++----- {iii-directory => directory}/src/lib.rs | 2 +- {iii-directory => directory}/src/main.rs | 26 ++++----- {iii-directory => directory}/src/manifest.rs | 0 .../src/sources/git.rs | 0 .../src/sources/mod.rs | 2 +- .../src/sources/registry.rs | 10 ++-- .../src/trigger_types.rs | 0 {iii-directory => directory}/tests/bdd.rs | 0 .../tests/common/engine.rs | 0 .../tests/common/mod.rs | 0 .../tests/common/workers.rs | 2 +- .../tests/common/world.rs | 2 +- .../tests/e2e/.gitignore | 0 .../tests/e2e/README.md | 8 +-- .../tests/e2e/config.yaml | 8 +-- .../tests/e2e/reports/.gitkeep | 0 .../tests/e2e/run-tests.sh | 20 +++---- .../tests/features/download_registry.feature | 0 .../tests/features/download_repo.feature | 0 .../tests/features/prompts.feature | 0 .../tests/features/read.feature | 0 .../features/registry_worker_info.feature | 0 .../features/registry_worker_list.feature | 0 .../tests/steps/download_registry.rs | 0 .../tests/steps/download_repo.rs | 0 .../tests/steps/mod.rs | 0 .../tests/steps/prompts.rs | 0 .../tests/steps/read.rs | 2 +- .../tests/steps/registry.rs | 0 docs/architecture/skills-and-permissions.md | 2 +- docs/architecture/testing-and-ci.md | 2 +- docs/sops/binary-worker.md | 2 +- docs/sops/new-worker.md | 6 +- harness/Cargo.lock | 2 +- harness/iii.worker.yaml | 2 +- harness/prompts/anthropic.txt | 2 +- harness/prompts/cli.txt | 2 +- harness/prompts/default.txt | 2 +- harness/prompts/gpt.txt | 2 +- harness/prompts/kimi.txt | 2 +- harness/src/prompt/tests.rs | 4 +- shell/README.md | 4 +- 73 files changed, 155 insertions(+), 157 deletions(-) rename {iii-directory => directory}/Cargo.lock (99%) rename {iii-directory => directory}/Cargo.toml (97%) rename {iii-directory => directory}/README.md (97%) rename {iii-directory => directory}/build.rs (100%) rename {iii-directory => directory}/config.yaml.example (80%) rename {iii-directory => directory}/examples/test_registry.rs (95%) rename {iii-directory => directory}/iii.worker.yaml (92%) rename {iii-directory => directory}/skills/SKILL.md (99%) rename {iii-directory => directory}/src/config.rs (99%) rename {iii-directory => directory}/src/configuration.rs (93%) rename {iii-directory => directory}/src/fs_source.rs (100%) rename {iii-directory => directory}/src/functions/download.rs (100%) rename {iii-directory => directory}/src/functions/engine_fn.rs (100%) rename {iii-directory => directory}/src/functions/error.rs (100%) rename {iii-directory => directory}/src/functions/mod.rs (94%) rename {iii-directory => directory}/src/functions/prompts.rs (100%) rename {iii-directory => directory}/src/functions/registry.rs (100%) rename {iii-directory => directory}/src/functions/skills.rs (99%) rename {iii-directory => directory}/src/lib.rs (96%) rename {iii-directory => directory}/src/main.rs (95%) rename {iii-directory => directory}/src/manifest.rs (100%) rename {iii-directory => directory}/src/sources/git.rs (100%) rename {iii-directory => directory}/src/sources/mod.rs (98%) rename {iii-directory => directory}/src/sources/registry.rs (97%) rename {iii-directory => directory}/src/trigger_types.rs (100%) rename {iii-directory => directory}/tests/bdd.rs (100%) rename {iii-directory => directory}/tests/common/engine.rs (100%) rename {iii-directory => directory}/tests/common/mod.rs (100%) rename {iii-directory => directory}/tests/common/workers.rs (99%) rename {iii-directory => directory}/tests/common/world.rs (97%) rename {iii-directory => directory}/tests/e2e/.gitignore (100%) rename {iii-directory => directory}/tests/e2e/README.md (90%) rename {iii-directory => directory}/tests/e2e/config.yaml (84%) rename {iii-directory => directory}/tests/e2e/reports/.gitkeep (100%) rename {iii-directory => directory}/tests/e2e/run-tests.sh (98%) rename {iii-directory => directory}/tests/features/download_registry.feature (100%) rename {iii-directory => directory}/tests/features/download_repo.feature (100%) rename {iii-directory => directory}/tests/features/prompts.feature (100%) rename {iii-directory => directory}/tests/features/read.feature (100%) rename {iii-directory => directory}/tests/features/registry_worker_info.feature (100%) rename {iii-directory => directory}/tests/features/registry_worker_list.feature (100%) rename {iii-directory => directory}/tests/steps/download_registry.rs (100%) rename {iii-directory => directory}/tests/steps/download_repo.rs (100%) rename {iii-directory => directory}/tests/steps/mod.rs (100%) rename {iii-directory => directory}/tests/steps/prompts.rs (100%) rename {iii-directory => directory}/tests/steps/read.rs (99%) rename {iii-directory => directory}/tests/steps/registry.rs (100%) diff --git a/.github/scripts/collect_worker_interface.py b/.github/scripts/collect_worker_interface.py index 279a42051..96bd771f8 100644 --- a/.github/scripts/collect_worker_interface.py +++ b/.github/scripts/collect_worker_interface.py @@ -45,7 +45,7 @@ def _typed_schema_violations(functions: list[dict[str, object]]) -> list[str]: def _untyped_trigger_names(triggers: list[dict[str, object]]) -> list[str]: """Trigger names whose `invocation_schema` is the empty/AnyValue ('unknown') schema. Unlike functions, a schema-less trigger is NOT a hard publish blocker: - some trigger types legitimately take no binding config (e.g. iii-directory's + some trigger types legitimately take no binding config (e.g. directory's `directory::*::on-change`), so callers warn rather than fail.""" names: list[str] = [] for trigger in triggers: diff --git a/.github/scripts/parse_publish_workers_input.py b/.github/scripts/parse_publish_workers_input.py index 621891582..12cb230d4 100644 --- a/.github/scripts/parse_publish_workers_input.py +++ b/.github/scripts/parse_publish_workers_input.py @@ -18,7 +18,7 @@ "console", "database", "harness", - "iii-directory", + "directory", "image-resize", "mcp", "shell", diff --git a/.github/scripts/tests/test_normalize_worker_interface.py b/.github/scripts/tests/test_normalize_worker_interface.py index b74a2cfd0..6cb10dc9b 100644 --- a/.github/scripts/tests/test_normalize_worker_interface.py +++ b/.github/scripts/tests/test_normalize_worker_interface.py @@ -166,7 +166,7 @@ def test_surfaces_trigger_schemas_from_info_enriched_rows() -> None: def test_untyped_trigger_surfaces_empty_schema() -> None: - """A trigger type registered without a binding config (e.g. iii-directory's + """A trigger type registered without a binding config (e.g. directory's `directory::*::on-change`) has no schema in `::info` — normalize emits an empty `{}`, which the publish step warns (not errors) about.""" interface = normalize_worker_interface( diff --git a/.github/scripts/validate_worker.py b/.github/scripts/validate_worker.py index 57a004d83..b973ea4e8 100644 --- a/.github/scripts/validate_worker.py +++ b/.github/scripts/validate_worker.py @@ -8,7 +8,7 @@ 4. tests/ exists and is non-empty. 5. For workers in BOOTSTRAP_WORKERS, skills/SKILL.md exists, is non-empty, and is within the 256 KiB cap — the harness bootstraps these onto disk via - iii-directory on first boot; a missing or oversized file breaks the + directory on first boot; a missing or oversized file breaks the chat surface's orientation. If `--worker` is not in `--source-changed`, requirements 1, 3, and 4 are @@ -33,7 +33,7 @@ # skills/SKILL.md a hard PR gate. Keep in sync with what the harness # actually bootstraps. BOOTSTRAP_WORKERS = frozenset({ - "iii-directory", + "directory", "shell", }) diff --git a/.github/workflows/create-tag.yml b/.github/workflows/create-tag.yml index abac00670..45407c713 100644 --- a/.github/workflows/create-tag.yml +++ b/.github/workflows/create-tag.yml @@ -19,7 +19,7 @@ on: - database - email - harness - - iii-directory + - directory - lsp - lsp-vscode - image-resize diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 801a496df..7e74fc770 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ on: - 'database/v*' - 'email/v*' - 'harness/v*' - - 'iii-directory/v*' + - 'directory/v*' - 'lsp/v*' - 'image-resize/v*' - 'llm-router/v*' diff --git a/README.md b/README.md index b893616ff..0b2d4efec 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ npx skills add iii-hq/iii --all | [`session-manager`](session-manager/) | Rust | Durable, reactive, branching conversation store — fourteen `session::*` functions plus six trigger types; the transcript backend for `harness` and `console`. See [`session-manager/architecture/`](session-manager/architecture/). | | [`context-manager`](context-manager/) | Rust | Model-ready context assembly — four `context::*` functions for token counting, function-result pruning, and history compaction over caller-supplied messages. Storage-agnostic; summarisation via `llm-router` when installed. | | [`database`](database/) | Rust | PostgreSQL, MySQL, and SQLite client — query, execute, transactions, prepared statements, and change feeds. | -| [`iii-directory`](iii-directory/) | Rust | Engine introspection (functions / triggers / workers), workers-registry proxy, and filesystem-backed skill + prompt reader. | +| [`directory`](directory/) | Rust | Engine introspection (functions / triggers / workers), workers-registry proxy, and filesystem-backed skill + prompt reader. | | [`lsp`](lsp/) | Rust | Language Server for iii function ids, trigger configs, and worker discovery. Autocomplete / hover across JS/TS, Python, Rust. | | [`lsp-vscode`](lsp-vscode/) | Node | VS Code extension package `iii-lsp`, embedding the `lsp` server. | | [`image-resize`](image-resize/) | Rust | Image resize via channel I/O — JPEG/PNG/WebP with EXIF auto-orient, scale-to-fit / crop-to-fit. | diff --git a/approval-gate/iii.worker.yaml b/approval-gate/iii.worker.yaml index 58928a687..a298c019c 100644 --- a/approval-gate/iii.worker.yaml +++ b/approval-gate/iii.worker.yaml @@ -9,5 +9,5 @@ description: Policy and decision surface for human-held function calls — pre_t dependencies: iii-state: "^0.19.0" configuration: "^0.19.0" - iii-directory: "^1.0.0" + directory: "^1.0.0" session-manager: "^1.0.0" diff --git a/console/web/src/components/chat/directory/parsers.ts b/console/web/src/components/chat/directory/parsers.ts index d70e8c8c4..156953b09 100644 --- a/console/web/src/components/chat/directory/parsers.ts +++ b/console/web/src/components/chat/directory/parsers.ts @@ -1,7 +1,7 @@ /** - * Zod schemas for the `directory::*` namespace (iii-directory worker). + * Zod schemas for the `directory::*` namespace (directory worker). * - * Wire source: `iii-directory/src/functions/*.rs` + * Wire source: `directory/src/functions/*.rs` * - skills.rs — directory::skills::list / get / index * - download.rs — directory::skills::download * - prompts.rs — directory::prompts::list / get diff --git a/console/web/src/components/chat/worker/__tests__/parsers.test.ts b/console/web/src/components/chat/worker/__tests__/parsers.test.ts index 494320df0..356dc9472 100644 --- a/console/web/src/components/chat/worker/__tests__/parsers.test.ts +++ b/console/web/src/components/chat/worker/__tests__/parsers.test.ts @@ -63,7 +63,7 @@ describe('worker::list', () => { const payload = { workers: [ { name: 'iii-worker-manager', pid: null, running: true }, - { name: 'iii-directory', pid: 19052, running: true, version: '0.5.2' }, + { name: 'directory', pid: 19052, running: true, version: '0.5.2' }, { name: 'iii-stream', pid: null, running: true, version: '0.11.6' }, ], } diff --git a/console/web/src/hooks/use-worker-lifecycle.ts b/console/web/src/hooks/use-worker-lifecycle.ts index 9de0a44a9..844e7640d 100644 --- a/console/web/src/hooks/use-worker-lifecycle.ts +++ b/console/web/src/hooks/use-worker-lifecycle.ts @@ -8,7 +8,7 @@ import { getIiiClient } from '@/lib/iii-client' * own terminal. * * IMPORTANT: the engine `worker` trigger filters on BOTH `operations` and - * `stages`. The only working subscriber in the tree (the Rust `iii-directory` + * `stages`. The only working subscriber in the tree (the Rust `directory` * worker) always sets both; omitting `stages` matches no events, so this hook * always sends a stage filter (defaulting to the full lifecycle). * diff --git a/console/web/src/stories/fixtures/engine-fixtures.ts b/console/web/src/stories/fixtures/engine-fixtures.ts index 7cb26f54f..5c54fa6b7 100644 --- a/console/web/src/stories/fixtures/engine-fixtures.ts +++ b/console/web/src/stories/fixtures/engine-fixtures.ts @@ -67,7 +67,7 @@ export const engineFunctionsListDone = base( export const engineFunctionsListEmpty = base( 'engine-fn-list-empty', 'engine::functions::list', - { worker: 'iii-directory', search: 'nonexistent' }, + { worker: 'directory', search: 'nonexistent' }, { functions: [] }, ) @@ -79,12 +79,12 @@ export const engineFunctionsListRaw = base( functions: [ { function_id: 'directory::skills::download', - worker_name: 'iii-directory', + worker_name: 'directory', description: 'Download skill bundle from the registry', }, { function_id: 'directory::skills::list', - worker_name: 'iii-directory', + worker_name: 'directory', // description intentionally omitted for visual variance }, ], @@ -193,13 +193,13 @@ export const engineTriggersListDone = base( }, { id: 'directory::prompts::on-change', - worker_name: 'iii-directory', + worker_name: 'directory', description: 'Fires after every successful directory::skills::download that wrote at least one prompt.', }, { id: 'directory::skills::on-change', - worker_name: 'iii-directory', + worker_name: 'directory', description: 'Fires after every successful directory::skills::download that wrote at least one skill.', }, @@ -251,14 +251,14 @@ export const engineRegisteredTriggersListDone = base( export const engineRegisteredTriggersListPlainSummary = base( 'engine-reg-tr-plain', 'engine::registered-triggers::list', - { worker: 'iii-directory' }, + { worker: 'directory' }, { registered_triggers: [ { id: 'a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d', trigger_type: 'log', function_id: 'directory::log::watch', - worker_name: 'iii-directory', + worker_name: 'directory', config_summary: 'level=info, source=stdout', }, ], @@ -327,7 +327,7 @@ export const engineWorkersListDone = base( }, { id: '00000000-0000-0000-0000-000000000aaa', - name: 'iii-directory', + name: 'directory', description: null, version: '0.1.5', runtime: 'rust', @@ -365,7 +365,7 @@ export const engineWorkersListFiltered = base( workers: [ { id: '00000000-0000-0000-0000-000000000aaa', - name: 'iii-directory', + name: 'directory', description: null, version: '0.1.5', runtime: 'rust', diff --git a/console/web/src/stories/fixtures/worker-fixtures.ts b/console/web/src/stories/fixtures/worker-fixtures.ts index 2fcc86ecc..ad377a2bc 100644 --- a/console/web/src/stories/fixtures/worker-fixtures.ts +++ b/console/web/src/stories/fixtures/worker-fixtures.ts @@ -31,7 +31,7 @@ function base( /* ---------------- worker::list ---------------- */ /** Mirrors the user's screenshot: 7+ workers, mix of running engine builtins - * (null pid, null version) and a managed iii-directory with a real pid. */ + * (null pid, null version) and a managed directory with a real pid. */ export const workerListDone = base( 'worker-list', 'worker::list', @@ -41,7 +41,7 @@ export const workerListDone = base( { name: 'iii-worker-manager', pid: null, running: true }, { name: 'iii-pubsub', pid: null, running: true }, { name: 'iii-observability', pid: null, running: true }, - { name: 'iii-directory', pid: 19052, running: true, version: '0.5.2' }, + { name: 'directory', pid: 19052, running: true, version: '0.5.2' }, { name: 'iii-queue', pid: null, running: true, version: '0.11.6' }, { name: 'iii-state', pid: null, running: true, version: '0.11.6' }, { name: 'iii-stream', pid: null, running: true, version: '0.11.6' }, @@ -56,7 +56,7 @@ export const workerListRunningOnly = base( { running_only: true }, { workers: [ - { name: 'iii-directory', pid: 19052, running: true, version: '0.5.2' }, + { name: 'directory', pid: 19052, running: true, version: '0.5.2' }, { name: 'iii-queue', pid: null, running: true, version: '0.11.6' }, ], }, diff --git a/iii-directory/Cargo.lock b/directory/Cargo.lock similarity index 99% rename from iii-directory/Cargo.lock rename to directory/Cargo.lock index c851022a0..35f0921ca 100644 --- a/iii-directory/Cargo.lock +++ b/directory/Cargo.lock @@ -457,6 +457,34 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "directory" +version = "1.0.0" +dependencies = [ + "anyhow", + "arc-swap", + "async-trait", + "chrono", + "clap", + "cucumber", + "dirs", + "futures", + "glob", + "iii-sdk", + "reqwest", + "schemars", + "serde", + "serde_json", + "serde_yaml", + "tempfile", + "thiserror 2.0.18", + "tokio", + "tracing", + "tracing-subscriber", + "uuid", + "wiremock", +] + [[package]] name = "dirs" version = "5.0.1" @@ -1072,34 +1100,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "iii-directory" -version = "0.8.1" -dependencies = [ - "anyhow", - "arc-swap", - "async-trait", - "chrono", - "clap", - "cucumber", - "dirs", - "futures", - "glob", - "iii-sdk", - "reqwest", - "schemars", - "serde", - "serde_json", - "serde_yaml", - "tempfile", - "thiserror 2.0.18", - "tokio", - "tracing", - "tracing-subscriber", - "uuid", - "wiremock", -] - [[package]] name = "iii-observability" version = "0.16.0-next.2" diff --git a/iii-directory/Cargo.toml b/directory/Cargo.toml similarity index 97% rename from iii-directory/Cargo.toml rename to directory/Cargo.toml index ea9bdd114..9c369dfa1 100644 --- a/iii-directory/Cargo.toml +++ b/directory/Cargo.toml @@ -1,7 +1,7 @@ [workspace] [package] -name = "iii-directory" +name = "directory" version = "1.0.0" edition = "2021" publish = false @@ -11,7 +11,7 @@ name = "iii-directory" path = "src/main.rs" [lib] -name = "iii_directory" +name = "directory" path = "src/lib.rs" [dependencies] diff --git a/iii-directory/README.md b/directory/README.md similarity index 97% rename from iii-directory/README.md rename to directory/README.md index 3ebca3a29..df1a16e19 100644 --- a/iii-directory/README.md +++ b/directory/README.md @@ -1,4 +1,4 @@ -# iii-directory +# directory Workers registry HTTP proxy and filesystem-backed skill + prompt reader for the [iii engine](https://github.com/iii-hq/iii). Every @@ -50,7 +50,7 @@ registry view also surfaces publication metadata (`type`, `config`, ## Install ```bash -iii worker add iii-directory +iii worker add directory ``` `iii worker add` fetches the binary, writes a config block into @@ -61,10 +61,10 @@ iii worker add iii-directory ## Skills -Install the `iii-directory` agent skill for Claude Code, Cursor, and 30+ other agents: +Install the `directory` agent skill for Claude Code, Cursor, and 30+ other agents: ```bash -npx skills add iii-hq/workers --skill iii-directory +npx skills add iii-hq/workers --skill directory ``` Browse or install every worker skill at once: @@ -79,13 +79,13 @@ npx skills add iii-hq/workers --all ## Configuration Runtime settings live in the **`configuration` worker** under id -**`iii-directory`** (the same pattern `database` and `storage` use). At boot +**`directory`** (the same pattern `database` and `storage` use). At boot the worker registers its JSON Schema, reads the live value via `configuration::get` (the configuration worker env-expands `${VAR}`), and binds a `configuration` trigger so it re-fetches on change. -Persisted values default to `./data/configuration/iii-directory.yaml` (fs -adapter). Edit that file directly, call `configuration::set id=iii-directory`, +Persisted values default to `./data/configuration/directory.yaml` (fs +adapter). Edit that file directly, call `configuration::set id=directory`, or use the console Workers tab — all three propagate without a redeploy. ### Fields diff --git a/iii-directory/build.rs b/directory/build.rs similarity index 100% rename from iii-directory/build.rs rename to directory/build.rs diff --git a/iii-directory/config.yaml.example b/directory/config.yaml.example similarity index 80% rename from iii-directory/config.yaml.example rename to directory/config.yaml.example index 02dc1efae..022b2685d 100644 --- a/iii-directory/config.yaml.example +++ b/directory/config.yaml.example @@ -1,15 +1,15 @@ # Optional seed file for first-time registration # (`iii-directory --config ./config.yaml.example`). # -# As of this version, iii-directory's runtime config lives in the -# `configuration` worker under id `iii-directory` (the same pattern +# As of this version, directory's runtime config lives in the +# `configuration` worker under id `directory` (the same pattern # `database` and `storage` use). This file is only a SEED: when the worker # is launched with `--config ` AND no value is yet stored for id -# `iii-directory`, its contents are passed as `initial_value` on +# `directory`, its contents are passed as `initial_value` on # `configuration::register` (the configuration worker env-expands `${VAR}`). # After that first register the stored value is authoritative; edit it with -# `configuration::set id=iii-directory` (or the console Workers tab), or by -# editing `./data/configuration/iii-directory.yaml` directly. +# `configuration::set id=directory` (or the console Workers tab), or by +# editing `./data/configuration/directory.yaml` directly. # # Tunable fields hot-reload on change (registry_url, download_timeout_ms, # registry_cache_ttl_ms, filter_unregistered). Topology fields require a diff --git a/iii-directory/examples/test_registry.rs b/directory/examples/test_registry.rs similarity index 95% rename from iii-directory/examples/test_registry.rs rename to directory/examples/test_registry.rs index be79ba2a9..67c3bb0ed 100644 --- a/iii-directory/examples/test_registry.rs +++ b/directory/examples/test_registry.rs @@ -1,5 +1,5 @@ -use iii_directory::fs_source::{scan_prompts, scan_skills}; -use iii_directory::sources::registry::{download, VersionSpec}; +use directory::fs_source::{scan_prompts, scan_skills}; +use directory::sources::registry::{download, VersionSpec}; #[tokio::main] async fn main() -> Result<(), String> { diff --git a/iii-directory/iii.worker.yaml b/directory/iii.worker.yaml similarity index 92% rename from iii-directory/iii.worker.yaml rename to directory/iii.worker.yaml index f00abcb22..3cb07b9f3 100644 --- a/iii-directory/iii.worker.yaml +++ b/directory/iii.worker.yaml @@ -1,5 +1,5 @@ iii: v1 -name: iii-directory +name: directory language: rust deploy: binary manifest: Cargo.toml diff --git a/iii-directory/skills/SKILL.md b/directory/skills/SKILL.md similarity index 99% rename from iii-directory/skills/SKILL.md rename to directory/skills/SKILL.md index 94f052af3..2612377bd 100644 --- a/iii-directory/skills/SKILL.md +++ b/directory/skills/SKILL.md @@ -1,5 +1,5 @@ --- -name: iii-directory +name: directory description: >- Discovery entry point for the engine — read the skill and prompt docs that installed workers ship off local disk, browse the public iii workers registry @@ -7,7 +7,7 @@ description: >- which workers exist and how to call them. --- -# iii-directory +# directory The directory worker is how an agent finds its way around the engine. It does three things: serves the markdown docs installed workers ship (`directory::skills::*`), diff --git a/iii-directory/src/config.rs b/directory/src/config.rs similarity index 99% rename from iii-directory/src/config.rs rename to directory/src/config.rs index 42abedd4d..4059f018e 100644 --- a/iii-directory/src/config.rs +++ b/directory/src/config.rs @@ -199,7 +199,7 @@ impl SkillsConfig { } /// JSON Schema registered with the `configuration` worker so the - /// console can render an editor for the `iii-directory` entry. + /// console can render an editor for the `directory` entry. pub fn json_schema() -> Value { let root = schemars::schema_for!(SkillsConfig); let mut schema = diff --git a/iii-directory/src/configuration.rs b/directory/src/configuration.rs similarity index 93% rename from iii-directory/src/configuration.rs rename to directory/src/configuration.rs index 2db7b5f5c..df1dcc17d 100644 --- a/iii-directory/src/configuration.rs +++ b/directory/src/configuration.rs @@ -1,5 +1,5 @@ //! Integration with the `configuration` worker — register, fetch, and -//! hot-reload the `iii-directory` configuration entry. +//! hot-reload the `directory` configuration entry. //! //! Mirrors the `database` worker's pattern: register a JSON Schema + seed //! at boot, read the authoritative (env-expanded) value via @@ -23,7 +23,7 @@ use crate::config::{SharedConfig, SkillsConfig, Topology}; use crate::functions::registry::RegistryCache; use crate::functions::skills::RegisteredWorkersCache; -pub const CONFIG_ID: &str = "iii-directory"; +pub const CONFIG_ID: &str = "directory"; const CONFIG_FN_ID: &str = "directory::on-config-change"; const CONFIG_TIMEOUT_MS: u64 = 5_000; const CONFIG_RETRIES: u32 = 3; @@ -64,15 +64,15 @@ impl SharedState { } } -/// Register the `iii-directory` configuration schema with the configuration +/// Register the `directory` configuration schema with the configuration /// worker. When `seed` is present, its value is installed as `initial_value`. /// Otherwise, built-in defaults are seeded only when no stored value exists. pub async fn register_config(iii: &III, seed: Option<&SkillsConfig>) -> Result<(), String> { let mut payload = json!({ "id": CONFIG_ID, - "name": "iii-directory", + "name": "directory", "description": "Skills/prompts folders, workers-registry URL, download timeouts, \ - and skill-visibility filters for the iii-directory worker.", + and skill-visibility filters for the directory worker.", "schema": SkillsConfig::json_schema(), }); if let Some(seed) = seed { @@ -84,7 +84,7 @@ pub async fn register_config(iii: &III, seed: Option<&SkillsConfig>) -> Result<( Ok(()) } -/// Read the live `iii-directory` configuration (env-expanded by the +/// Read the live `directory` configuration (env-expanded by the /// configuration worker). pub async fn fetch_config(iii: &III) -> Result { let value = get_config_value(iii).await?; @@ -142,7 +142,7 @@ struct OnConfigChangeResponse { } /// Register the internal config-change handler and bind a `configuration` -/// trigger for `configuration:updated` on the `iii-directory` entry. +/// trigger for `configuration:updated` on the `directory` entry. pub fn register_config_trigger(iii: &III, state: SharedState) -> Result<(), IIIError> { let st = state.clone(); let engine = iii.clone(); @@ -157,7 +157,7 @@ pub fn register_config_trigger(iii: &III, state: SharedState) -> Result<(), IIIE } }) .description( - "Internal: reload tunable iii-directory settings from the authoritative \ + "Internal: reload tunable directory settings from the authoritative \ configuration when it changes.", ), ); @@ -201,7 +201,7 @@ async fn on_config_change(iii: &III, state: &SharedState) { return; } apply_config(state, cfg).await; - tracing::info!("iii-directory configuration reloaded (tunable fields applied; caches cleared)"); + tracing::info!("directory configuration reloaded (tunable fields applied; caches cleared)"); } async fn trigger_with_retry(iii: &III, function_id: &str, payload: Value) -> Result { diff --git a/iii-directory/src/fs_source.rs b/directory/src/fs_source.rs similarity index 100% rename from iii-directory/src/fs_source.rs rename to directory/src/fs_source.rs diff --git a/iii-directory/src/functions/download.rs b/directory/src/functions/download.rs similarity index 100% rename from iii-directory/src/functions/download.rs rename to directory/src/functions/download.rs diff --git a/iii-directory/src/functions/engine_fn.rs b/directory/src/functions/engine_fn.rs similarity index 100% rename from iii-directory/src/functions/engine_fn.rs rename to directory/src/functions/engine_fn.rs diff --git a/iii-directory/src/functions/error.rs b/directory/src/functions/error.rs similarity index 100% rename from iii-directory/src/functions/error.rs rename to directory/src/functions/error.rs diff --git a/iii-directory/src/functions/mod.rs b/directory/src/functions/mod.rs similarity index 94% rename from iii-directory/src/functions/mod.rs rename to directory/src/functions/mod.rs index 2ec708812..88f3a2e5c 100644 --- a/iii-directory/src/functions/mod.rs +++ b/directory/src/functions/mod.rs @@ -1,4 +1,4 @@ -//! Function registrations for `iii-directory` (formerly `skills` / `engine-catalog`). +//! Function registrations for `directory` (formerly `skills` / `engine-catalog`). //! //! All public functions sit under a single `directory::*` namespace, //! split into three sub-namespaces: @@ -55,7 +55,7 @@ pub fn register_all(iii: &Arc, cfg: &SharedConfig, trigger_types: &Register registry::register(iii, cfg); engine_fn::register(iii); tracing::info!( - "iii-directory registered 3 directory::skills::* (list + get + index), \ + "directory registered 3 directory::skills::* (list + get + index), \ 2 directory::prompts::* (list + get), 1 directory::skills::download, \ 2 directory::registry::workers::*, and 1 directory::engine::functions::info" ); @@ -75,7 +75,7 @@ pub fn register_all_with_cache( registry::register_with_cache(iii, cfg, registry_cache); engine_fn::register(iii); tracing::info!( - "iii-directory registered 3 directory::skills::* (list + get + index), \ + "directory registered 3 directory::skills::* (list + get + index), \ 2 directory::prompts::* (list + get), 1 directory::skills::download, \ 2 directory::registry::workers::*, and 1 directory::engine::functions::info" ); diff --git a/iii-directory/src/functions/prompts.rs b/directory/src/functions/prompts.rs similarity index 100% rename from iii-directory/src/functions/prompts.rs rename to directory/src/functions/prompts.rs diff --git a/iii-directory/src/functions/registry.rs b/directory/src/functions/registry.rs similarity index 100% rename from iii-directory/src/functions/registry.rs rename to directory/src/functions/registry.rs diff --git a/iii-directory/src/functions/skills.rs b/directory/src/functions/skills.rs similarity index 99% rename from iii-directory/src/functions/skills.rs rename to directory/src/functions/skills.rs index f33d3bdad..971d26381 100644 --- a/iii-directory/src/functions/skills.rs +++ b/directory/src/functions/skills.rs @@ -410,7 +410,7 @@ pub const ENGINE_NAMESPACE: &str = "iii"; /// /// 1. It has no namespace separator (single-segment id like `index`) — /// these are root/bundle docs that belong to everyone. -/// 2. Its top namespace segment is `directory` — the iii-directory +/// 2. Its top namespace segment is `directory` — the directory /// worker's OWN docs namespace; always visible regardless of what /// other workers are installed. /// 3. Its top namespace segment is `iii` — the engine's own skill @@ -430,7 +430,7 @@ pub(crate) fn filter_to_registered( let top_seg = s.id.split('/').next().unwrap_or(""); // Single-segment ids (no `/`) are root/bundle docs — always keep. !s.id.contains('/') - // The iii-directory worker's own docs namespace. + // The directory worker's own docs namespace. || top_seg == "directory" // The engine's own skill namespace (not a worker). || top_seg == ENGINE_NAMESPACE @@ -1914,7 +1914,7 @@ First paragraph. #[tokio::test] async fn get_suggests_nested_skill_id_on_two_segment_miss() { // Reported case: agent calls `directory::skills::get { id: - // "sandbox/exec" }` by analogy with the iii-directory layout + // "sandbox/exec" }` by analogy with the directory layout // (`directory/skills/get`), but the sandbox worker lays its // skills one folder deeper. The prose miss must name the // canonical id in its "Did you mean" list. @@ -2351,8 +2351,8 @@ First paragraph. "Memory tier.", ), entry( - "iii-directory/index", - "iii-directory", + "directory/index", + "directory", Some("index"), "Directory worker.", ), @@ -2413,8 +2413,8 @@ First paragraph. "Memory tier.", ), entry( - "iii-directory/index", - "iii-directory", + "directory/index", + "directory", Some("index"), "Directory worker.", ), @@ -2425,14 +2425,14 @@ First paragraph. "expected exactly two `##` headings; got: {body}" ); assert!(body.contains("\n## agent-memory\n"), "got: {body}"); - assert!(body.contains("\n## iii-directory\n"), "got: {body}"); + assert!(body.contains("\n## directory\n"), "got: {body}"); } #[test] fn render_index_includes_description_paragraph() { let body = render_index_markdown(&[entry( - "iii-directory/index", - "iii-directory", + "directory/index", + "directory", Some("index"), "Engine introspection and filesystem-backed skill reader.", )]); @@ -2440,7 +2440,7 @@ First paragraph. // separated by blank lines on either side. assert!( body.contains( - "\n## iii-directory\n\nEngine introspection and filesystem-backed skill reader.\n\nFull reference: call `directory::skills::get " + "\n## directory\n\nEngine introspection and filesystem-backed skill reader.\n\nFull reference: call `directory::skills::get " ), "description not framed correctly; got: {body}" ); @@ -2500,11 +2500,11 @@ First paragraph. // emits sections in the same order. let body = render_index_markdown(&[ entry("agent-memory/index", "agent-memory", Some("index"), "a"), - entry("iii-directory/index", "iii-directory", Some("index"), "b"), + entry("directory/index", "directory", Some("index"), "b"), entry("resend/index", "resend", Some("index"), "c"), ]); let am = body.find("## agent-memory").expect("am missing"); - let iii = body.find("## iii-directory").expect("iii missing"); + let iii = body.find("## directory").expect("iii missing"); let resend = body.find("## resend").expect("resend missing"); assert!( am < iii && iii < resend, diff --git a/iii-directory/src/lib.rs b/directory/src/lib.rs similarity index 96% rename from iii-directory/src/lib.rs rename to directory/src/lib.rs index a32f40421..329575a4d 100644 --- a/iii-directory/src/lib.rs +++ b/directory/src/lib.rs @@ -1,4 +1,4 @@ -//! `iii-directory` — workers registry HTTP proxy and filesystem-backed +//! `directory` — workers registry HTTP proxy and filesystem-backed //! skill + prompt reader. The binary in `src/main.rs` is a thin wrapper //! that wires the modules below to the iii engine. //! diff --git a/iii-directory/src/main.rs b/directory/src/main.rs similarity index 95% rename from iii-directory/src/main.rs rename to directory/src/main.rs index 8d5b7b758..70b4fcbaf 100644 --- a/iii-directory/src/main.rs +++ b/directory/src/main.rs @@ -32,16 +32,14 @@ use iii_sdk::{ }; use serde_json::json; -use iii_directory::config::{SharedConfig, SkillsConfig}; -use iii_directory::functions::download::{ - download_worker_skills, reconcile_decision, InFlightGuard, -}; -use iii_directory::functions::registry::RegistryCache; -use iii_directory::functions::skills::{ +use directory::config::{SharedConfig, SkillsConfig}; +use directory::functions::download::{download_worker_skills, reconcile_decision, InFlightGuard}; +use directory::functions::registry::RegistryCache; +use directory::functions::skills::{ make_registered_cache, RegisteredWorkersCache, ENGINE_NAMESPACE, }; -use iii_directory::sources::registry::VersionSpec; -use iii_directory::{configuration, functions, manifest, trigger_types}; +use directory::sources::registry::VersionSpec; +use directory::{configuration, functions, manifest, trigger_types}; #[derive(Parser, Debug)] #[command( @@ -51,7 +49,7 @@ use iii_directory::{configuration, functions, manifest, trigger_types}; struct Cli { /// Optional YAML seed used to populate `initial_value` on the first /// `configuration::register`. After first boot the authoritative config - /// lives in the `configuration` worker under id `iii-directory`. + /// lives in the `configuration` worker under id `directory`. #[arg(long)] config: Option, @@ -86,7 +84,7 @@ async fn main() -> Result<()> { metadata: Some(WorkerMetadata { runtime: "rust".to_string(), version: env!("CARGO_PKG_VERSION").to_string(), - name: "iii-directory".to_string(), + name: "directory".to_string(), os: std::env::consts::OS.to_string(), pid: Some(std::process::id()), telemetry: None, @@ -122,11 +120,11 @@ async fn main() -> Result<()> { configuration::register_config(&iii, seed.as_ref()) .await .map_err(anyhow::Error::msg) - .context("registering iii-directory configuration schema")?; + .context("registering directory configuration schema")?; let cfg = configuration::fetch_config(&iii) .await .map_err(anyhow::Error::msg) - .context("loading iii-directory configuration")?; + .context("loading directory configuration")?; tracing::info!( skills_folder = %cfg.resolved_skills_folder().display(), @@ -186,13 +184,13 @@ async fn main() -> Result<()> { let fn_count = if auto_download { 10 } else { 9 }; tracing::info!( - "iii-directory ready: {} directory::* functions + 2 custom trigger types + \ + "directory ready: {} directory::* functions + 2 custom trigger types + \ configuration hot-reload", fn_count ); tokio::signal::ctrl_c().await?; - tracing::info!("iii-directory shutting down"); + tracing::info!("directory shutting down"); iii.shutdown_async().await; Ok(()) } diff --git a/iii-directory/src/manifest.rs b/directory/src/manifest.rs similarity index 100% rename from iii-directory/src/manifest.rs rename to directory/src/manifest.rs diff --git a/iii-directory/src/sources/git.rs b/directory/src/sources/git.rs similarity index 100% rename from iii-directory/src/sources/git.rs rename to directory/src/sources/git.rs diff --git a/iii-directory/src/sources/mod.rs b/directory/src/sources/mod.rs similarity index 98% rename from iii-directory/src/sources/mod.rs rename to directory/src/sources/mod.rs index 3930f978a..28fcc7e7a 100644 --- a/iii-directory/src/sources/mod.rs +++ b/directory/src/sources/mod.rs @@ -13,7 +13,7 @@ use std::path::{Component, Path, PathBuf}; use std::time::Duration; /// User-agent string sent on every outbound HTTP request from this -/// worker. Mirrors the `iii-directory/` convention so the +/// worker. Mirrors the `directory/` convention so the /// registry can correlate traffic to a specific worker release. pub const HTTP_USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); diff --git a/iii-directory/src/sources/registry.rs b/directory/src/sources/registry.rs similarity index 97% rename from iii-directory/src/sources/registry.rs rename to directory/src/sources/registry.rs index 93aaf4435..46b5ea550 100644 --- a/iii-directory/src/sources/registry.rs +++ b/directory/src/sources/registry.rs @@ -437,7 +437,7 @@ mod tests { fn write_response_dedupes_stale_index_when_skill_md_present() { let tmp = tempfile::tempdir().unwrap(); let response = WorkerSkillsResponse { - name: Some("iii-directory".into()), + name: Some("directory".into()), version: None, skills: vec![ SkillEntry { @@ -451,11 +451,11 @@ mod tests { ], prompts: vec![], }; - let result = write_response("iii-directory", response, tmp.path()).unwrap(); - assert!(tmp.path().join("iii-directory/SKILL.md").is_file()); - assert!(!tmp.path().join("iii-directory/index.md").exists()); + let result = write_response("directory", response, tmp.path()).unwrap(); + assert!(tmp.path().join("directory/SKILL.md").is_file()); + assert!(!tmp.path().join("directory/index.md").exists()); assert_eq!( - std::fs::read_to_string(tmp.path().join("iii-directory/SKILL.md")).unwrap(), + std::fs::read_to_string(tmp.path().join("directory/SKILL.md")).unwrap(), "# canonical\n" ); assert_eq!(result.skills_written, vec!["SKILL.md"]); diff --git a/iii-directory/src/trigger_types.rs b/directory/src/trigger_types.rs similarity index 100% rename from iii-directory/src/trigger_types.rs rename to directory/src/trigger_types.rs diff --git a/iii-directory/tests/bdd.rs b/directory/tests/bdd.rs similarity index 100% rename from iii-directory/tests/bdd.rs rename to directory/tests/bdd.rs diff --git a/iii-directory/tests/common/engine.rs b/directory/tests/common/engine.rs similarity index 100% rename from iii-directory/tests/common/engine.rs rename to directory/tests/common/engine.rs diff --git a/iii-directory/tests/common/mod.rs b/directory/tests/common/mod.rs similarity index 100% rename from iii-directory/tests/common/mod.rs rename to directory/tests/common/mod.rs diff --git a/iii-directory/tests/common/workers.rs b/directory/tests/common/workers.rs similarity index 99% rename from iii-directory/tests/common/workers.rs rename to directory/tests/common/workers.rs index 934a5097d..51b9b4544 100644 --- a/iii-directory/tests/common/workers.rs +++ b/directory/tests/common/workers.rs @@ -22,7 +22,7 @@ use iii_sdk::III; use tokio::sync::OnceCell; use wiremock::MockServer; -use iii_directory::{ +use directory::{ config::SkillsConfig, functions, trigger_types::{self, RegisteredTriggerTypes}, diff --git a/iii-directory/tests/common/world.rs b/directory/tests/common/world.rs similarity index 97% rename from iii-directory/tests/common/world.rs rename to directory/tests/common/world.rs index c724b752e..6edd1595d 100644 --- a/iii-directory/tests/common/world.rs +++ b/directory/tests/common/world.rs @@ -17,7 +17,7 @@ use cucumber::World; use iii_sdk::III; use serde_json::Value; -use iii_directory::config::SkillsConfig; +use directory::config::SkillsConfig; #[derive(World)] #[world(init = Self::new)] diff --git a/iii-directory/tests/e2e/.gitignore b/directory/tests/e2e/.gitignore similarity index 100% rename from iii-directory/tests/e2e/.gitignore rename to directory/tests/e2e/.gitignore diff --git a/iii-directory/tests/e2e/README.md b/directory/tests/e2e/README.md similarity index 90% rename from iii-directory/tests/e2e/README.md rename to directory/tests/e2e/README.md index c99b35aba..f2f25bd76 100644 --- a/iii-directory/tests/e2e/README.md +++ b/directory/tests/e2e/README.md @@ -1,6 +1,6 @@ -# iii-directory worker — end-to-end harness +# directory worker — end-to-end harness -Self-asserting smoke harness for the `iii-directory` worker. Builds + installs +Self-asserting smoke harness for the `directory` worker. Builds + installs the worker, starts its own iii engine, downloads **real** worker bundles from the public registry (https://api.workers.iii.dev), and asserts every `directory::*` behavior with one command. Exits 0 on PASS, 1 on any FAIL. @@ -23,12 +23,12 @@ downloads, the prose error contract (`D110` / `D112` / `D210` / `D310` / ```sh ./run-tests.sh # build + install the worker, then run the full suite -./run-tests.sh --no-build # reuse the iii-directory already in ~/.iii/workers +./run-tests.sh --no-build # reuse the directory already in ~/.iii/workers ./run-tests.sh --keep # leave the engine running afterwards (debugging) PORT=49210 ./run-tests.sh # use a non-default engine port ``` -Builds `iii-directory` (debug), copies it to `~/.iii/workers/iii-directory`, +Builds `directory` (debug), copies it to `~/.iii/workers/directory`, substitutes `config.yaml` into `reports/engine-config.yaml` (absolute paths), starts the engine, lays down local-override fixtures under `.iii/skills/`, downloads `shell` / `database` / `coder` / `iii`, and runs every assertion. diff --git a/iii-directory/tests/e2e/config.yaml b/directory/tests/e2e/config.yaml similarity index 84% rename from iii-directory/tests/e2e/config.yaml rename to directory/tests/e2e/config.yaml index 8d9734acd..2f24a498e 100644 --- a/iii-directory/tests/e2e/config.yaml +++ b/directory/tests/e2e/config.yaml @@ -1,13 +1,13 @@ -# iii engine config for the iii-directory e2e harness. +# iii engine config for the directory e2e harness. # # `__E2E_DIR__` is a placeholder for the ABSOLUTE path of this directory -# (iii-directory/tests/e2e). run-tests.sh substitutes it at runtime into +# (directory/tests/e2e). run-tests.sh substitutes it at runtime into # reports/engine-config.yaml. Absolute paths are required because the engine # does not guarantee the worker's cwd, so a relative skills_folder would not # resolve reliably (see src/config.rs::resolve_path). # # Manual two-terminal flow (the automated flow is just `./run-tests.sh`): -# cd iii-directory/tests/e2e +# cd directory/tests/e2e # sed "s|__E2E_DIR__|$(pwd)|g" config.yaml > /tmp/iii-dir-e2e.yaml # --config /tmp/iii-dir-e2e.yaml # terminal 1 (launches the worker from ~/.iii/workers) # ./run-tests.sh --no-build # terminal 2 @@ -15,7 +15,7 @@ # filter_unregistered / auto_download are OFF so the run is self-contained # (both need the iii-worker-manager daemon). workers: - - name: iii-directory + - name: directory config: skills_folder: __E2E_DIR__/skills-home local_skills_folder: __E2E_DIR__/.iii/skills diff --git a/iii-directory/tests/e2e/reports/.gitkeep b/directory/tests/e2e/reports/.gitkeep similarity index 100% rename from iii-directory/tests/e2e/reports/.gitkeep rename to directory/tests/e2e/reports/.gitkeep diff --git a/iii-directory/tests/e2e/run-tests.sh b/directory/tests/e2e/run-tests.sh similarity index 98% rename from iii-directory/tests/e2e/run-tests.sh rename to directory/tests/e2e/run-tests.sh index 929ee9365..9ee18a3b2 100755 --- a/iii-directory/tests/e2e/run-tests.sh +++ b/directory/tests/e2e/run-tests.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash -# End-to-end test for the iii-directory worker against REAL workers on +# End-to-end test for the directory worker against REAL workers on # https://api.workers.iii.dev. Builds + installs the worker, generates an # absolute-path engine config from ./config.yaml, starts its own engine, # downloads real bundles, and ASSERTS every behavior. Exits 0 on all pass, # 1 otherwise. # # ./run-tests.sh # full run (builds + installs the worker first) -# ./run-tests.sh --no-build # reuse the iii-directory already in ~/.iii/workers +# ./run-tests.sh --no-build # reuse the directory already in ~/.iii/workers # ./run-tests.sh --keep # leave the engine running afterwards # PORT=49210 ./run-tests.sh # use a non-default engine port set -uo pipefail @@ -14,7 +14,7 @@ set -uo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"; cd "$ROOT_DIR" HERE="$ROOT_DIR" # assertion body refers to $HERE / $GLOBAL PORT="${PORT:-49134}" -# Worker source is two levels up: iii-directory/tests/e2e -> iii-directory. +# Worker source is two levels up: directory/tests/e2e -> directory. WORKER_SRC="${WORKER_SRC:-$(cd "$ROOT_DIR/../.." && pwd)}" # Prefer iii on PATH, then the conventional install dir, then a local build. III="${III:-$(command -v iii 2>/dev/null \ @@ -50,11 +50,11 @@ iserr() { case "$2" in *Error:*|*'"type":"not_found"'*|*'invocation_failed'*) ok echo "==> setup" command -v jq >/dev/null 2>&1 || { echo "jq is required (brew install jq)"; exit 1; } if [ "$BUILD" = 1 ]; then - echo " build + install iii-directory into $WORKERS_DIR" + echo " build + install directory into $WORKERS_DIR" ( cd "$WORKER_SRC" && cargo build ) >"$REPORTS/build.log" 2>&1 || { echo "build failed:"; tail -20 "$REPORTS/build.log"; exit 1; } - mkdir -p "$WORKERS_DIR"; cp "$WORKER_SRC/target/debug/iii-directory" "$WORKERS_DIR/iii-directory" + mkdir -p "$WORKERS_DIR"; cp "$WORKER_SRC/target/debug/iii-directory" "$WORKERS_DIR/directory" fi -[ -x "$WORKERS_DIR/iii-directory" ] || { echo "no iii-directory in $WORKERS_DIR (run without --no-build)"; exit 1; } +[ -x "$WORKERS_DIR/directory" ] || { echo "no directory in $WORKERS_DIR (run without --no-build)"; exit 1; } # effective engine config: substitute this dir's ABSOLUTE path into config.yaml # (the engine doesn't guarantee the worker cwd, so skills_folder must be absolute). @@ -93,14 +93,14 @@ ENGINE_PID="" teardown() { if [ "$KEEP" = 1 ]; then echo " (--keep) engine left running pid=$ENGINE_PID on :$PORT"; return; fi [ -n "$ENGINE_PID" ] && kill "$ENGINE_PID" 2>/dev/null || true - pkill -f "$WORKERS_DIR/iii-directory" 2>/dev/null || true + pkill -f "$WORKERS_DIR/directory" 2>/dev/null || true } trap teardown EXIT INT TERM echo " start engine: $III --config $ENGINE_CONFIG (port $PORT)" "$III" --config "$ENGINE_CONFIG" >"$ENGINE_LOG" 2>&1 & ENGINE_PID=$! REG=no; for _ in $(seq 1 60); do trig directory::skills::list --json '{}' >/dev/null 2>&1 && { REG=yes; break; }; sleep 0.5; done -[ "$REG" = yes ] || { echo "iii-directory did not register; engine log:"; tail -25 "$ENGINE_LOG"; exit 1; } -echo " iii-directory registered on :$PORT" +[ "$REG" = yes ] || { echo "directory did not register; engine log:"; tail -25 "$ENGINE_LOG"; exit 1; } +echo " directory registered on :$PORT" # ── 0. boot reconcile: engine skill (iii) auto-downloaded on startup ───────── # auto_download:true makes the boot-reconcile task pull the engine's OWN `iii` @@ -136,7 +136,7 @@ trig directory::skills::download worker=coder >/dev/null [ -f "$GLOBAL/iii/SKILL.md" ] && ok "on-disk: skills-home/iii/SKILL.md exists" || no "on-disk: skills-home/iii/SKILL.md exists" [ ! -e "$GLOBAL/iii/skills/SKILL.md" ] && ok "on-disk: NO skills-home/iii/skills/SKILL.md" || no "on-disk: NO skills-home/iii/skills/SKILL.md" # the redundant-prefix bug would show as an IMMEDIATE /skills/ child (depth 2); -# legit deep namespaces like iii-directory/directory/skills/ (depth 3) are fine. +# legit deep namespaces like directory/directory/skills/ (depth 3) are fine. [ -z "$(find "$GLOBAL" -mindepth 2 -maxdepth 2 -type d -name skills 2>/dev/null)" ] && ok "on-disk: no redundant /skills/ prefix dirs" || no "on-disk: no redundant /skills/ prefix dirs" # ── 3. skills reads ────────────────────────────────────────────────────────── diff --git a/iii-directory/tests/features/download_registry.feature b/directory/tests/features/download_registry.feature similarity index 100% rename from iii-directory/tests/features/download_registry.feature rename to directory/tests/features/download_registry.feature diff --git a/iii-directory/tests/features/download_repo.feature b/directory/tests/features/download_repo.feature similarity index 100% rename from iii-directory/tests/features/download_repo.feature rename to directory/tests/features/download_repo.feature diff --git a/iii-directory/tests/features/prompts.feature b/directory/tests/features/prompts.feature similarity index 100% rename from iii-directory/tests/features/prompts.feature rename to directory/tests/features/prompts.feature diff --git a/iii-directory/tests/features/read.feature b/directory/tests/features/read.feature similarity index 100% rename from iii-directory/tests/features/read.feature rename to directory/tests/features/read.feature diff --git a/iii-directory/tests/features/registry_worker_info.feature b/directory/tests/features/registry_worker_info.feature similarity index 100% rename from iii-directory/tests/features/registry_worker_info.feature rename to directory/tests/features/registry_worker_info.feature diff --git a/iii-directory/tests/features/registry_worker_list.feature b/directory/tests/features/registry_worker_list.feature similarity index 100% rename from iii-directory/tests/features/registry_worker_list.feature rename to directory/tests/features/registry_worker_list.feature diff --git a/iii-directory/tests/steps/download_registry.rs b/directory/tests/steps/download_registry.rs similarity index 100% rename from iii-directory/tests/steps/download_registry.rs rename to directory/tests/steps/download_registry.rs diff --git a/iii-directory/tests/steps/download_repo.rs b/directory/tests/steps/download_repo.rs similarity index 100% rename from iii-directory/tests/steps/download_repo.rs rename to directory/tests/steps/download_repo.rs diff --git a/iii-directory/tests/steps/mod.rs b/directory/tests/steps/mod.rs similarity index 100% rename from iii-directory/tests/steps/mod.rs rename to directory/tests/steps/mod.rs diff --git a/iii-directory/tests/steps/prompts.rs b/directory/tests/steps/prompts.rs similarity index 100% rename from iii-directory/tests/steps/prompts.rs rename to directory/tests/steps/prompts.rs diff --git a/iii-directory/tests/steps/read.rs b/directory/tests/steps/read.rs similarity index 99% rename from iii-directory/tests/steps/read.rs rename to directory/tests/steps/read.rs index 5fcf54ea6..a6dcde1ac 100644 --- a/iii-directory/tests/steps/read.rs +++ b/directory/tests/steps/read.rs @@ -1,6 +1,6 @@ //! Step defs for `tests/features/read.feature`. //! -//! Drives the read-side surface of the iii-directory worker +//! Drives the read-side surface of the directory worker //! (`directory::skills::list`, `directory::skills::get`) against //! fixture files written directly into `skills_folder`. The legacy //! `iii://` URI scheme (rendered tree, function-backed sections, diff --git a/iii-directory/tests/steps/registry.rs b/directory/tests/steps/registry.rs similarity index 100% rename from iii-directory/tests/steps/registry.rs rename to directory/tests/steps/registry.rs diff --git a/docs/architecture/skills-and-permissions.md b/docs/architecture/skills-and-permissions.md index e7b0066ad..cbd56e2cb 100644 --- a/docs/architecture/skills-and-permissions.md +++ b/docs/architecture/skills-and-permissions.md @@ -16,7 +16,7 @@ Author per [`DOCUMENTATION_GUIDELINES.md`](../../DOCUMENTATION_GUIDELINES.md). | Case | Rule | |---|---| -| Bootstrap workers (`shell`, `iii-directory`) | `skills/SKILL.md` **required**, non-empty, ≤ 256 KiB | +| Bootstrap workers (`shell`, `directory`) | `skills/SKILL.md` **required**, non-empty, ≤ 256 KiB | | Other workers | Optional; validated only if present | Bootstrap list: `BOOTSTRAP_WORKERS` in diff --git a/docs/architecture/testing-and-ci.md b/docs/architecture/testing-and-ci.md index 95dbc1414..a1af7f8c4 100644 --- a/docs/architecture/testing-and-ci.md +++ b/docs/architecture/testing-and-ci.md @@ -37,7 +37,7 @@ version/tests/README gates downgrade to GitHub notices. 2. `iii.worker.yaml` parses with required fields 3. Manifest version ≥ version on base branch 4. `tests/` exists and is non-empty -5. Bootstrap workers (`shell`, `iii-directory`): `skills/SKILL.md` present, +5. Bootstrap workers (`shell`, `directory`): `skills/SKILL.md` present, non-empty, ≤ 256 KiB ## Language jobs diff --git a/docs/sops/binary-worker.md b/docs/sops/binary-worker.md index afcee2d30..eb3f765d4 100644 --- a/docs/sops/binary-worker.md +++ b/docs/sops/binary-worker.md @@ -517,7 +517,7 @@ Every function's request **and** response must be a concrete type deriving SDK emit the permissive `AnyValue` schema, which ships to the registry as an **"unknown"** request/response schema — the exact failure this rule prevents. The reference shape is -[`iii-directory/src/functions/download.rs`](../../iii-directory/src/functions/download.rs): +[`directory/src/functions/download.rs`](../../directory/src/functions/download.rs): a typed input struct as the closure parameter (`move |req: RepoDownloadInput|`) plus a typed return type. (That file predates the `::` naming convention above; copy its *schema* pattern, not its function ids.) diff --git a/docs/sops/new-worker.md b/docs/sops/new-worker.md index e82e54758..8b50b8b1d 100644 --- a/docs/sops/new-worker.md +++ b/docs/sops/new-worker.md @@ -16,7 +16,7 @@ after §2. - Pattern: `^[a-z0-9][a-z0-9_-]*$` (enforced by `TAG_RE` in [`.github/scripts/parse_release_tag.py`](../../.github/scripts/parse_release_tag.py)). - Do **not** prefix with `iii-` unless the worker itself is named that way - (e.g. `iii-directory`, `iii-lsp`). + (e.g. `directory`, `iii-lsp`). - Git release tags use the folder name: `/vX.Y.Z`. - **Function and trigger IDs** are `::`; multi-word segments use kebab-case, never snake_case (e.g. `context::count-tokens`, @@ -106,7 +106,7 @@ step can fail **silently** (e.g. tag push triggers nothing). | 1 | [`.github/workflows/create-tag.yml`](../../.github/workflows/create-tag.yml) | Add worker to `inputs.worker.options` | | 2 | [`.github/workflows/release.yml`](../../.github/workflows/release.yml) | Add `'/v*'` to `on.push.tags` | | 3 | [`.github/scripts/parse_publish_workers_input.py`](../../.github/scripts/parse_publish_workers_input.py) | Add to `ALLOWED_WORKERS` **only if** the worker ships `skills/` and you want out-of-band skills publishing via [`publish-worker-skills.yml`](../../.github/workflows/publish-worker-skills.yml) | -| 4 | [`.github/scripts/validate_worker.py`](../../.github/scripts/validate_worker.py) | Add to `BOOTSTRAP_WORKERS` **only if** the harness stack requires this worker's skill at boot — makes `skills/SKILL.md` a hard PR gate (currently `shell`, `iii-directory`) | +| 4 | [`.github/scripts/validate_worker.py`](../../.github/scripts/validate_worker.py) | Add to `BOOTSTRAP_WORKERS` **only if** the harness stack requires this worker's skill at boot — makes `skills/SKILL.md` a hard PR gate (currently `shell`, `directory`) | **Worked example:** `session-manager` — added to `create-tag.yml` options and `release.yml` tag patterns. No `BOOTSTRAP_WORKERS` entry (not harness-bootstrapped). @@ -137,7 +137,7 @@ Ship `skills/SKILL.md` when agents should discover **when** to use the worker (intent, boundaries, function catalogue — not JSON schemas). Author per [`DOCUMENTATION_GUIDELINES.md`](../../DOCUMENTATION_GUIDELINES.md). -- **Bootstrap workers** (`shell`, `iii-directory`): `skills/SKILL.md` is +- **Bootstrap workers** (`shell`, `directory`): `skills/SKILL.md` is **required** (≤ 256 KiB) — the harness stack expects these skills at boot. - **On release:** skills are auto-uploaded via `POST /w//skills` when markdown is present; skipped cleanly when absent. diff --git a/harness/Cargo.lock b/harness/Cargo.lock index 7fed35a79..c12dcfa36 100644 --- a/harness/Cargo.lock +++ b/harness/Cargo.lock @@ -502,7 +502,7 @@ dependencies = [ [[package]] name = "harness" -version = "0.1.0" +version = "1.0.0" dependencies = [ "anyhow", "async-trait", diff --git a/harness/iii.worker.yaml b/harness/iii.worker.yaml index d48c721c6..73b2f780b 100644 --- a/harness/iii.worker.yaml +++ b/harness/iii.worker.yaml @@ -10,7 +10,7 @@ dependencies: iii-state: "^0.19.0" iii-queue: "^0.19.0" configuration: "^0.19.0" - iii-directory: "^1.0.0" + directory: "^1.0.0" session-manager: "^1.0.0" context-manager: "^1.0.0" approval-gate: "^1.0.0" diff --git a/harness/prompts/anthropic.txt b/harness/prompts/anthropic.txt index ccb47f351..c591c6d1c 100644 --- a/harness/prompts/anthropic.txt +++ b/harness/prompts/anthropic.txt @@ -144,7 +144,7 @@ confirm the new function ids appear via `engine::functions::list { prefix: " diff --git a/harness/prompts/cli.txt b/harness/prompts/cli.txt index 94ee46bac..29f614fd4 100644 --- a/harness/prompts/cli.txt +++ b/harness/prompts/cli.txt @@ -155,7 +155,7 @@ contract with `--help` before calling. The registry detail is a preview, not the If no `directory::*` function is registered: look in `worker::list` for a stopped directory worker and start it. If it is not installed, install it with -`iii trigger worker::add --json '{"source":{"kind":"registry","name":"iii-directory"}}'`. +`iii trigger worker::add --json '{"source":{"kind":"registry","name":"directory"}}'`. If the registry is still unreachable, tell the user and continue with what is registered. diff --git a/harness/prompts/default.txt b/harness/prompts/default.txt index 5fa8d72b9..62daddfd6 100644 --- a/harness/prompts/default.txt +++ b/harness/prompts/default.txt @@ -129,7 +129,7 @@ Step 4. Check it worked: confirm the new function ids appear with If no `directory::*` function is registered: look in `worker::list` for a stopped directory worker and start it. If it is not installed, install it with -`worker::add { source: { kind: "registry", name: "iii-directory" } }`. If the registry is +`worker::add { source: { kind: "registry", name: "directory" } }`. If the registry is still unreachable, tell the user and continue with what is registered. diff --git a/harness/prompts/gpt.txt b/harness/prompts/gpt.txt index 536623eaa..b33e49e9e 100644 --- a/harness/prompts/gpt.txt +++ b/harness/prompts/gpt.txt @@ -126,7 +126,7 @@ confirm the new function ids appear via `engine::functions::list { prefix: " diff --git a/harness/prompts/kimi.txt b/harness/prompts/kimi.txt index 832bedc43..5d869e8ca 100644 --- a/harness/prompts/kimi.txt +++ b/harness/prompts/kimi.txt @@ -119,7 +119,7 @@ assistant: The payload was a JSON-encoded string. Re-issuing the SAME function w Registry detail is a preview, not the contract — fetch contracts via `engine::functions::info` as always. If no `directory::*` function is registered, check `worker::list` for a stopped directory worker and start it, or install it with - `worker::add { source: { kind: "registry", name: "iii-directory" } }`. If the registry is + `worker::add { source: { kind: "registry", name: "directory" } }`. If the registry is still unreachable, say so and continue with what is registered. 5. When a task creates, edits, moves, or deletes code files, you MUST use the coder worker. Verify it with `engine::functions::list { prefix: "coder::" }`. If it is missing, install diff --git a/harness/src/prompt/tests.rs b/harness/src/prompt/tests.rs index 8a7257696..b4d20260f 100644 --- a/harness/src/prompt/tests.rs +++ b/harness/src/prompt/tests.rs @@ -126,7 +126,7 @@ fn registry_flow() { #[test] fn directory_bootstrap_degrade() { let out = default_prompt(); - assert!(out.contains("name: \"iii-directory\"")); + assert!(out.contains("name: \"directory\"")); assert!(out.contains("continue with what is registered")); } @@ -322,7 +322,7 @@ fn capability_ladder_ordering() { #[test] fn default_variant_matches_legacy_default_body() { - assert_eq!(variants::DEFAULT.len(), 12_005); + assert_eq!(variants::DEFAULT.len(), 12_001); } fn extract_directory_ids(text: &str) -> Vec { diff --git a/shell/README.md b/shell/README.md index b156ba0a1..ee216c5c2 100644 --- a/shell/README.md +++ b/shell/README.md @@ -8,11 +8,11 @@ Run allowlisted Unix commands, background jobs, and structured filesystem operat iii worker add shell ``` -Sandbox-targeted execution and `shell::fs::*` forwarding need the `iii-sandbox` worker; `iii worker add shell` does not pull it in. To surface `shell::*` to LLM agents, pair with `iii-directory`: +Sandbox-targeted execution and `shell::fs::*` forwarding need the `iii-sandbox` worker; `iii worker add shell` does not pull it in. To surface `shell::*` to LLM agents, pair with `directory`: ```sh iii worker add iii-sandbox -iii worker add iii-directory +iii worker add directory ``` ## Skills