mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 11:07:10 +00:00
refactor: rename project uatu -> sanderling (#24)
* refactor: rename Go module path uatu -> sanderling
Module path github.com/priyanshujain/uatu -> github.com/priyanshujain/sanderling,
including all imports and the proto go_package option. Generated .pb.go files
rewritten in-place; safe to regenerate with protoc later.
* chore(proto): regenerate driverpb after module path rename
The previous sed-based module rename corrupted the embedded descriptor
byte lengths. buf generate rewrites them cleanly.
* refactor: rename CLI binary uatu -> sanderling
Updates Makefile target + UATU_BIN var, .goreleaser project/build IDs,
.gitignore comment, and all user-facing strings in the CLI help text,
error messages, and tests. Binary is now bin/sanderling.
* refactor(sdk): rename Kotlin package dev.uatu.sdk -> dev.sanderling.sdk
Moves sdk/android/src/{main,test}/kotlin/dev/uatu -> dev/sanderling and
rewrites package declarations, imports, and the Gradle namespace. Class
names (Uatu, UatuRuntime) are renamed in a follow-up commit.
* refactor(sidecar): rename Kotlin package dev.uatu.sidecar -> dev.sanderling.sidecar
Moves sidecar/src/{main,test}/kotlin/dev/uatu -> dev/sanderling and
rewrites package declarations, imports, and the application mainClass.
* refactor: rename Uatu API surface -> Sanderling
- Kotlin: Uatu -> Sanderling, UatuRuntime -> SanderlingRuntime (+ files).
- JS host binding: globalThis.__uatu__ -> __sanderling__ (Go verifier,
spec-api, tests).
- TS interface: UatuRuntime -> SanderlingRuntime; internal tags
__uatuFormula / __uatuActionGenerator -> __sanderling* variants.
- Go trace: UatuVersion field + uatu_version JSON tag renamed.
- Socket naming: uatu-agent / uatu-agent-reader -> sanderling-agent*.
- Sample app, docs, inline-JS test strings updated to match.
* refactor(examples): rename examples/folio/uatu -> examples/folio/sanderling
Renames the example spec directory; updates justfile paths + gitignore
entries accordingly. Package.json name/description and @uatu/spec
dependency are renamed in the npm + docs commits.
* chore(build): rename gradle property + rootProject.name uatu -> sanderling
- Renames the uatu.version gradle property and all its -P references in
Makefile, build.gradle.kts files, and .github/workflows/release.yml.
- settings.gradle.kts rootProject.name = "sanderling".
- Renames .env.local.example header + release-cli workflow job name.
* refactor(proto): rename proto package uatu.driver.v1 -> sanderling.driver.v1
Updates the proto package and java_package, regenerates driver.pb.go +
driver_grpc.pb.go, rewrites Kotlin imports and the gRPC ServiceName
assertion in driver_test.go.
* refactor: rename npm package @uatu/spec -> @sanderling/spec
Renames package name in pkg/spec-api/package.json + lockfile, all
consumer imports (examples/folio spec, testdata, verifier tests), the
esbuild alias in cmd/sanderling/test_run.go, and related doc references.
* docs: rename uatu -> sanderling in README, docs, and URLs
- README + docs/{manual,development}/*: narrative + GitHub + Pages URLs.
- POM + npm package.json repo/homepage/bugs URLs.
- .gitignore + embed_stub + Makefile-comment references updated to
'make sanderling'.
- Minor narrative comments in cmd/sanderling/test_run.go and
internal/inspect/server.go.
* refactor: rename remaining internal uatu strings -> sanderling
- SANDERLING_TEST_PHONE/OTP env vars (cmd + bundler tests).
- sanderling-sidecar runtime tmp dir + extracted JAR filename.
- Inspect web UI: @sanderling/inspect-web package, title, theme
localStorage key, RunList empty-state copy, uatu_version TS field.
- Sample app storage key sanderling.ledger.v1.
- Test data: sanderling_test AVD name + com.example.sanderling_test.
- Release docs tarball name template.
This commit is contained in:
111 files changed
+514
-514
No files matched your search
@@ -4,7 +4,7 @@ import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/priyanshujain/uatu/internal/hierarchy"
|
||||
"github.com/priyanshujain/sanderling/internal/hierarchy"
|
||||
)
|
||||
|
||||
// TestStateAxFindWorks verifies that a Parse+PushSnapshot+extract round trip
|
||||
@@ -24,11 +24,11 @@ func TestStateAxFindWorks(t *testing.T) {
|
||||
|
||||
verifier := newVerifier(t)
|
||||
mustLoad(t, verifier, `
|
||||
globalThis.probe = __uatu__.extract(state => {
|
||||
globalThis.probe = __sanderling__.extract(state => {
|
||||
const element = state.ax.find("id:select_language");
|
||||
return element ? "matched:" + element.text : "miss";
|
||||
});
|
||||
globalThis.count = __uatu__.extract(state => state.ax.findAll("id:select_language").length);
|
||||
globalThis.count = __sanderling__.extract(state => state.ax.findAll("id:select_language").length);
|
||||
`)
|
||||
|
||||
if err := verifier.PushSnapshot(SnapshotInput{Snapshots: Snapshots{}, Tree: tree}); err != nil {
|
||||
|
||||
@@ -80,11 +80,11 @@ type formulaSpec struct {
|
||||
}
|
||||
|
||||
const (
|
||||
tagFormula = "__uatuFormula"
|
||||
tagFormulaSpecIndex = "__uatuFormulaSpec"
|
||||
tagActionGenerator = "__uatuActionGenerator"
|
||||
tagInternalKind = "__uatuKind"
|
||||
tagSelector = "__uatuSelector"
|
||||
tagFormula = "__sanderlingFormula"
|
||||
tagFormulaSpecIndex = "__sanderlingFormulaSpec"
|
||||
tagActionGenerator = "__sanderlingActionGenerator"
|
||||
tagInternalKind = "__sanderlingKind"
|
||||
tagSelector = "__sanderlingSelector"
|
||||
|
||||
internalKindActions = "actions"
|
||||
internalKindWeighted = "weighted"
|
||||
@@ -94,63 +94,63 @@ const (
|
||||
internalKindBuiltinPressKey = "pressKey"
|
||||
)
|
||||
|
||||
// installRuntimeBindings exposes globalThis.__uatu__ to the loaded spec.
|
||||
// installRuntimeBindings exposes globalThis.__sanderling__ to the loaded spec.
|
||||
func (v *Verifier) installRuntimeBindings() error {
|
||||
uatu := v.runtime.NewObject()
|
||||
sanderling := v.runtime.NewObject()
|
||||
|
||||
if err := uatu.Set("extract", v.bindExtract); err != nil {
|
||||
if err := sanderling.Set("extract", v.bindExtract); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("always", v.bindAlways); err != nil {
|
||||
if err := sanderling.Set("always", v.bindAlways); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("now", v.bindNow); err != nil {
|
||||
if err := sanderling.Set("now", v.bindNow); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("next", v.bindNext); err != nil {
|
||||
if err := sanderling.Set("next", v.bindNext); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("eventually", v.bindEventually); err != nil {
|
||||
if err := sanderling.Set("eventually", v.bindEventually); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("actions", v.bindActions); err != nil {
|
||||
if err := sanderling.Set("actions", v.bindActions); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("weighted", v.bindWeighted); err != nil {
|
||||
if err := sanderling.Set("weighted", v.bindWeighted); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("from", v.bindFrom); err != nil {
|
||||
if err := sanderling.Set("from", v.bindFrom); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("tap", v.bindTap); err != nil {
|
||||
if err := sanderling.Set("tap", v.bindTap); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("inputText", v.bindInputText); err != nil {
|
||||
if err := sanderling.Set("inputText", v.bindInputText); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("swipe", v.bindSwipe); err != nil {
|
||||
if err := sanderling.Set("swipe", v.bindSwipe); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("pressKey", v.bindPressKey); err != nil {
|
||||
if err := sanderling.Set("pressKey", v.bindPressKey); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("wait", v.bindWait); err != nil {
|
||||
if err := sanderling.Set("wait", v.bindWait); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("taps", v.builtinGenerator(internalKindBuiltinTaps)); err != nil {
|
||||
if err := sanderling.Set("taps", v.builtinGenerator(internalKindBuiltinTaps)); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("swipes", v.builtinGenerator(internalKindBuiltinSwipes)); err != nil {
|
||||
if err := sanderling.Set("swipes", v.builtinGenerator(internalKindBuiltinSwipes)); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("waitOnce", v.builtinGenerator(internalKindBuiltinWaitOnce)); err != nil {
|
||||
if err := sanderling.Set("waitOnce", v.builtinGenerator(internalKindBuiltinWaitOnce)); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := uatu.Set("pressKeys", v.builtinGenerator(internalKindBuiltinPressKey)); err != nil {
|
||||
if err := sanderling.Set("pressKeys", v.builtinGenerator(internalKindBuiltinPressKey)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return v.runtime.GlobalObject().Set("__uatu__", uatu)
|
||||
return v.runtime.GlobalObject().Set("__sanderling__", sanderling)
|
||||
}
|
||||
|
||||
func (v *Verifier) bindExtract(call goja.FunctionCall) goja.Value {
|
||||
@@ -172,7 +172,7 @@ func (v *Verifier) bindExtract(call goja.FunctionCall) goja.Value {
|
||||
|
||||
// bindAlways accepts either a predicate function (legacy shape) or a formula
|
||||
// handle (new shape). Both produce a formula handle tagged with
|
||||
// __uatuFormulaSpec.
|
||||
// __sanderlingFormulaSpec.
|
||||
func (v *Verifier) bindAlways(call goja.FunctionCall) goja.Value {
|
||||
if len(call.Arguments) != 1 {
|
||||
panic(v.runtime.NewTypeError("always requires exactly one argument"))
|
||||
@@ -258,9 +258,9 @@ func (v *Verifier) formulaHandle(kind specKind, index int) *goja.Object {
|
||||
handle := v.runtime.NewObject()
|
||||
_ = handle.Set(tagFormula, true)
|
||||
_ = handle.Set(tagFormulaSpecIndex, index)
|
||||
// Keep __uatuIndex as an alias so older property shapes that read it keep
|
||||
// Keep __sanderlingIndex as an alias so older property shapes that read it keep
|
||||
// working during backward-compat transitions.
|
||||
_ = handle.Set("__uatuIndex", index)
|
||||
_ = handle.Set("__sanderlingIndex", index)
|
||||
|
||||
_ = handle.Set("implies", v.binaryChain(index, specKindImplies))
|
||||
_ = handle.Set("or", v.binaryChain(index, specKindOr))
|
||||
@@ -326,7 +326,7 @@ func (v *Verifier) eventuallyWithin(selfIndex int) func(call goja.FunctionCall)
|
||||
}
|
||||
}
|
||||
|
||||
// extractSpecIndex reads __uatuFormulaSpec from a JS formula handle.
|
||||
// extractSpecIndex reads __sanderlingFormulaSpec from a JS formula handle.
|
||||
func (v *Verifier) extractSpecIndex(value goja.Value) (int, bool) {
|
||||
if value == nil || goja.IsNull(value) || goja.IsUndefined(value) {
|
||||
return 0, false
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
"github.com/dop251/goja"
|
||||
|
||||
"github.com/priyanshujain/uatu/internal/hierarchy"
|
||||
"github.com/priyanshujain/sanderling/internal/hierarchy"
|
||||
)
|
||||
|
||||
// Snapshots is the per-step extractor output forwarded by the SDK.
|
||||
|
||||
@@ -5,13 +5,13 @@ import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/priyanshujain/uatu/internal/bundler"
|
||||
"github.com/priyanshujain/uatu/internal/hierarchy"
|
||||
"github.com/priyanshujain/uatu/internal/ltl"
|
||||
"github.com/priyanshujain/sanderling/internal/bundler"
|
||||
"github.com/priyanshujain/sanderling/internal/hierarchy"
|
||||
"github.com/priyanshujain/sanderling/internal/ltl"
|
||||
)
|
||||
|
||||
// bundleIntegrationSpec bundles testdata/integration_spec.ts via the real
|
||||
// @uatu/spec API so the integration test exercises the same path the CLI
|
||||
// @sanderling/spec API so the integration test exercises the same path the CLI
|
||||
// uses, with no reference to any specific example app.
|
||||
func bundleIntegrationSpec(t *testing.T) string {
|
||||
t.Helper()
|
||||
@@ -30,8 +30,8 @@ func bundleIntegrationSpec(t *testing.T) string {
|
||||
bundle, err := bundler.Bundle(bundler.Options{
|
||||
EntryFile: specPath,
|
||||
Aliases: map[string]string{
|
||||
"@uatu/spec": apiPath,
|
||||
"@uatu/spec/defaults/properties": defaultsPath,
|
||||
"@sanderling/spec": apiPath,
|
||||
"@sanderling/spec/defaults/properties": defaultsPath,
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@ import {
|
||||
eventually,
|
||||
extract,
|
||||
weighted,
|
||||
} from "@uatu/spec";
|
||||
import { noUncaughtExceptions } from "@uatu/spec/defaults/properties";
|
||||
} from "@sanderling/spec";
|
||||
import { noUncaughtExceptions } from "@sanderling/spec/defaults/properties";
|
||||
|
||||
const route = extract<string>(
|
||||
(state) => (state.snapshots.route as string) ?? "",
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/priyanshujain/uatu/internal/ltl"
|
||||
"github.com/priyanshujain/sanderling/internal/ltl"
|
||||
)
|
||||
|
||||
func newVerifier(t *testing.T, options ...Option) *Verifier {
|
||||
@@ -27,18 +27,18 @@ func mustLoad(t *testing.T, verifier *Verifier, source string) {
|
||||
}
|
||||
|
||||
const helloSpec = `
|
||||
const screen = __uatu__.extract(state => state.snapshots.screen ?? "");
|
||||
const balance = __uatu__.extract(state => state.snapshots["ledger.balance"] ?? 0);
|
||||
const screen = __sanderling__.extract(state => state.snapshots.screen ?? "");
|
||||
const balance = __sanderling__.extract(state => state.snapshots["ledger.balance"] ?? 0);
|
||||
|
||||
globalThis.screen = screen;
|
||||
globalThis.balance = balance;
|
||||
|
||||
globalThis.properties = {
|
||||
balanceNonNegative: __uatu__.always(() => balance.current >= 0),
|
||||
balanceNonNegative: __sanderling__.always(() => balance.current >= 0),
|
||||
};
|
||||
|
||||
globalThis.actions = __uatu__.actions(() => [
|
||||
__uatu__.tap({ on: "id:home_button" }),
|
||||
globalThis.actions = __sanderling__.actions(() => [
|
||||
__sanderling__.tap({ on: "id:home_button" }),
|
||||
]);
|
||||
`
|
||||
|
||||
@@ -135,9 +135,9 @@ func TestNextAction_FromActionsGenerator(t *testing.T) {
|
||||
func TestNextAction_WeightedSelectsByWeight(t *testing.T) {
|
||||
verifier := newVerifier(t, WithRand(rand.New(rand.NewPCG(42, 0))))
|
||||
mustLoad(t, verifier, `
|
||||
const tapHome = __uatu__.actions(() => [__uatu__.tap({ on: "id:home" })]);
|
||||
const tapAway = __uatu__.actions(() => [__uatu__.tap({ on: "id:away" })]);
|
||||
globalThis.actions = __uatu__.weighted(
|
||||
const tapHome = __sanderling__.actions(() => [__sanderling__.tap({ on: "id:home" })]);
|
||||
const tapAway = __sanderling__.actions(() => [__sanderling__.tap({ on: "id:away" })]);
|
||||
globalThis.actions = __sanderling__.weighted(
|
||||
[1, tapHome],
|
||||
[99, tapAway],
|
||||
);
|
||||
@@ -166,7 +166,7 @@ func TestNextAction_WeightedSelectsByWeight(t *testing.T) {
|
||||
func TestNextAction_EmptyGeneratorReturnsErrNoAction(t *testing.T) {
|
||||
verifier := newVerifier(t)
|
||||
mustLoad(t, verifier, `
|
||||
globalThis.actions = __uatu__.actions(() => []);
|
||||
globalThis.actions = __sanderling__.actions(() => []);
|
||||
`)
|
||||
_ = verifier.PushSnapshot(SnapshotInput{Snapshots: Snapshots{}})
|
||||
|
||||
@@ -179,8 +179,8 @@ func TestNextAction_EmptyGeneratorReturnsErrNoAction(t *testing.T) {
|
||||
func TestInputText_RoundTrip(t *testing.T) {
|
||||
verifier := newVerifier(t)
|
||||
mustLoad(t, verifier, `
|
||||
globalThis.actions = __uatu__.actions(() => [
|
||||
__uatu__.inputText({ into: "id:phone", text: "+919876543210" }),
|
||||
globalThis.actions = __sanderling__.actions(() => [
|
||||
__sanderling__.inputText({ into: "id:phone", text: "+919876543210" }),
|
||||
]);
|
||||
`)
|
||||
_ = verifier.PushSnapshot(SnapshotInput{Snapshots: Snapshots{}})
|
||||
@@ -200,7 +200,7 @@ func TestInputText_RoundTrip(t *testing.T) {
|
||||
func TestPushSnapshot_FeedsSnapshotsToExtractorState(t *testing.T) {
|
||||
verifier := newVerifier(t)
|
||||
mustLoad(t, verifier, `
|
||||
globalThis.captured = __uatu__.extract(state => state.snapshots["k"]);
|
||||
globalThis.captured = __sanderling__.extract(state => state.snapshots["k"]);
|
||||
`)
|
||||
if err := verifier.PushSnapshot(SnapshotInput{Snapshots: Snapshots{"k": json.RawMessage(`"hello"`)}}); err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -222,7 +222,7 @@ func TestLoad_PropagatesSyntaxError(t *testing.T) {
|
||||
func TestEvaluateProperties_ThrowingPredicateDoesNotPanic(t *testing.T) {
|
||||
const spec = `
|
||||
globalThis.properties = {
|
||||
broken: __uatu__.always(() => { throw new Error("bad predicate"); }),
|
||||
broken: __sanderling__.always(() => { throw new Error("bad predicate"); }),
|
||||
};
|
||||
`
|
||||
verifier := newVerifier(t)
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
|
||||
"github.com/dop251/goja"
|
||||
|
||||
"github.com/priyanshujain/uatu/internal/hierarchy"
|
||||
"github.com/priyanshujain/uatu/internal/ltl"
|
||||
"github.com/priyanshujain/sanderling/internal/hierarchy"
|
||||
"github.com/priyanshujain/sanderling/internal/ltl"
|
||||
)
|
||||
|
||||
type Verifier struct {
|
||||
|
||||
Reference in new issue
Block a user