You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 940b65f
Browse filesBrowse the repository at this point in the historyBrowse files
feat(uts-to-kotlin): drive the skill from a module directory via a package mapping
Rework the uts-to-kotlin skill to translate a whole UTS module at once
instead of a single spec file:
- Take a UTS module directory (e.g. .../specification/uts/objects) and
validate it sits directly under uts/ with a standard tier structure.
- Resolve the target ably-java package via uts-package-mapping.json (a new
config file alongside the skill): a shared `testRoot` parent plus a
`packages` table mapping each source module to its per-tier output dir
(so objects -> liveobjects is explicit). Offer to create a mapping when
one is missing.
- Let the user pick a tier (unit / integration / proxy) and then translate
all specs or a selected subset, looping each through the existing
per-spec translation steps.
Phase 1 (selection: Steps A-D) is new; Phase 2 (per-spec translation:
Steps 1-7) keeps the existing rules, with Step 1/2 adjusted to consume the
looped spec and the pre-resolved target.
description: "Translate a UTS pseudocode test spec into Kotlin tests in the uts module. Usage: /uts-to-kotlin <path-to-spec-file>"
2
+
description: "Translate the UTS pseudocode test specs in a whole module directory into runnable Kotlin tests in the ably-java uts module. Takes a UTS module directory (e.g. .../specification/uts/objects), validates its structure, resolves the target ably-java module, lets you pick a tier (unit/integration/proxy) and which specs, then derives a Kotlin test per spec. Usage: /uts-to-kotlin <path-to-uts-module-directory>"
3
3
allowed-tools: Bash, Read, Edit, Write
4
4
---
5
5
6
-
Translate the UTS pseudocode test spec at `$ARGUMENTS` into a runnable Kotlin test in the `uts` module.
6
+
Translate the UTS pseudocode test specs under the **module directory**`$ARGUMENTS` into runnable Kotlin
7
+
tests in the ably-java `uts` module.
8
+
9
+
`$ARGUMENTS` is a UTS *module* directory — a directory sitting directly under `.../specification/uts/`,
10
+
e.g. `/Users/sachinsh/ably-specification/specification/uts/objects`. Its name (`objects`, `realtime`,
11
+
`rest`, …) is the **source module**. A module directory holds many spec files, organised into tiers
12
+
(`unit/`, `integration/`, and `integration/proxy/`).
13
+
14
+
The work happens in two phases:
15
+
16
+
-**Phase 1 — Selection (Steps A–D below):** validate the directory, resolve the *target* ably-java
17
+
module via `uts-package-mapping.json`, pick a tier, and pick which spec files to translate.
18
+
-**Phase 2 — Per-spec translation (Steps 1–7):** for each selected spec file, derive a Kotlin test.
|**integration** (direct sandbox) |`<module>/integration/`*(excluding `proxy/` and `helpers/`)*| mapping `integration` (e.g. `integration/standard/liveobjects`) | real sandbox, no faults — see **Proxy integration tests** but drop the `ProxySession`/`connectThroughProxy` wiring |
107
+
|**proxy**|`<module>/integration/proxy/`| mapping `proxy` (e.g. `integration/proxy/liveobjects`) | real sandbox + fault injection — see **Proxy integration tests**|
108
+
109
+
The tier you pick here fixes the target directory/package and which translation flow Phase 2 uses — you do
110
+
**not** re-detect it per spec.
111
+
112
+
## Step D — Choose which specs to translate
113
+
114
+
List the candidate spec files in the chosen tier's source directory (recurse, but **exclude** any
115
+
`helpers/` directory and non-spec docs like `PLAN.md`, `README.md`, or `*_SUMMARY.md`). Substitute the
- Those that **inject faults** (reference `create_proxy_session()`, proxy `rules`, `trigger_action`, `get_log`, or `uts/test/realtime/integration/helpers/proxy.md`) are **proxy** tests under `integration/proxy/<module>/` — follow the **Proxy integration tests** section at the end of this skill instead of the unit-test rules below.
81
-
- Those that exercise only **happy-path interop** against the real sandbox (no fault injection) are **direct sandbox** tests under `integration/standard/<module>/`. They use `SandboxApp` alone (no `ProxySession`), connecting straight to `ProxyManager.sandboxRealtimeHost` / `sandboxRestHost`. *(No example exists yet — model the suite setup/teardown on the proxy section but drop the `ProxySession`/`connectThroughProxy` wiring.)*
156
+
Only the **class name** comes from the spec file: take its file name, strip a `_test` suffix if present,
157
+
convert `snake_case` → `PascalCase`, and append `Test`. Examples: `objects_batch_test.md` →
"_comment": "Maps each UTS spec module (a dir under specification/uts/) to its target test packages. Output dir = testRoot + '/' + tier entry; Kotlin package = that path after 'src/test/kotlin/' with '/' -> '.'. Used by the uts-to-kotlin skill.",
0 commit comments