Automation
AI
Test Automation
Beyond Selectors: The Starlight Protocol and the Era of Sovereign Automation

Beyond Selectors: The Starlight Protocol and the Era of Sovereign Automation

December 30, 2025 4 min read
"The ground is chaotic. Navigation requires a higher frame of reference."
β€” Inspired by the dung beetle, which navigates using the Milky Way

The Problem with Traditional Automation

Every test engineer has experienced the 3 AM page: "Build Failed - Element Not Found."

Traditional browser automation is fragile by design. We bind our tests to the implementation details of the UIβ€”CSS selectors, XPaths, and dynamic IDs that change with every sprint. When a developer renames a button, our tests break. When a modal appears unexpectedly, our scripts crash.

The industry's solution? Add more wait statements. More try-catch blocks. More conditional logic.

The Fundamental Problem
This is treating symptoms, not the disease. The fundamental problem is that we're looking at the ground when we should be looking at the stars.

Introducing Constellation-Based Automation

What if your automation could handle unexpected obstacles the way a human doesβ€”not by predicting every possible state, but by *adapting* to whatever the environment throws at it?

This is the core philosophy behind Constellation-Based Automation (CBA) and its communication protocol, Starlight.

Instead of writing scripts that handle every edge case, CBA introduces a Sovereign Constellation of autonomous agents that:

  • Monitor the environment for obstacles (popups, modals, network jitter)
  • Clear the path before your intent even knows there was a problem
  • Learn from experience to handle similar situations faster next time
Clean Intent
Your test script stays clean and focused on the business goal. The *environment's chaos* becomes someone else's problem.

The Architecture: A New Paradigm

Code
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      INTENT LAYER                           β”‚
β”‚         "Login" β€’ "Submit Form" β€’ "Initiate Mission"        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚ JSON-RPC
                          β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        CBA HUB                              β”‚
β”‚              Orchestrator β€’ Semantic Resolver               β”‚
β”‚                   Predictive Memory                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚             β”‚             β”‚
            β–Ό             β–Ό             β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚   PULSE   β”‚  β”‚  JANITOR  β”‚  β”‚  VISION   β”‚
    β”‚ Stability β”‚  β”‚ Heuristic β”‚  β”‚  AI-Based β”‚
    β”‚  Monitor  β”‚  β”‚  Healing  β”‚  β”‚ Detection β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚              β”‚              β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                        β”‚
                        β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚     BROWSER      β”‚
              β”‚   (Playwright)   β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

The Sentinels

1
Pulse Sentinel β€” The Guardian of Time
Monitors network requests and DOM mutations. Vetoes execution until the environment is stable. Eliminates the need for setTimeout or waitForSelector.
2
Janitor Sentinel β€” The Heuristic Healer
Detects known obstacle patterns (modals, cookie banners). Clears them automatically using proven selectors. Learns which actions work and remembers for next time.
3
Vision Sentinel β€” The AI Eye
Uses local AI models (Ollama/Moondream) to *see* obstacles. Works without selectorsβ€”pure visual detection. Handles encrypted or obfuscated UIs.

The Starlight Protocol

Communication between the Hub and Sentinels uses JSON-RPC 2.0 with a set of standardized signals:

SignalPurpose
`starlight.intent`"I want to click the Login button"
`starlight.pre_check`"Everyone check the path before I proceed"
`starlight.clear`"Path is clear, proceed"
`starlight.wait`"Hold on, environment is unstable"
`starlight.hijack`"I need to take over and fix something"
`starlight.resume`"Problem fixed, continue the mission"
Consensus-Based Execution
The Hub never executes an action until all relevant Sentinels have cleared the path.

Predictive Intelligence: The Galaxy Mesh

CBA doesn't just reactβ€”it learns.

1
Self-Healing Selectors
When a selector fails, the Hub checks its historical memory. If it has seen this goal before with a different selector that worked, it substitutes automatically.
Code
// First run: User clicks "Submit" β†’ selector fails
// Hub learns: "Submit" goal worked with "#submit-btn" in the past
// Second run: Auto-substitutes and succeeds
2
Aura-Based Throttling
The Hub tracks *when* entropy events occur during missions. If the first 5 seconds of a particular page are historically unstable, it proactively slows down before problems occur.
3
Sentinel Memory
Sentinels remember which remediation actions worked. If the Janitor cleared a modal with .modal .close-btn, it remembers this for next timeβ€”skipping the exploration phase entirely.

The ROI Dashboard: Proving Value

Every mission generates a "Hero Story" report that quantifies the business value:

Event TypeValue Saved
Sentinel Intervention5 minutes (manual triage avoided)
Self-Healing Event2-3 minutes (debugging avoided)
Aura Stabilization30 seconds (flake prevention)
From Cost Center to Value Generator
This transforms testing from a cost center to a *measurable value generator*.

Real-World Impact

In traditional automation, a single unexpected modal can:

  • Crash the test β†’ 30 seconds wasted
  • Trigger manual investigation β†’ 5-10 minutes
  • Require code changes β†’ 30-60 minutes
  • Wait for PR review β†’ hours to days

In CBA, the same modal:

  • Detected by Janitor Sentinel β†’ 0.1 seconds
  • Cleared automatically β†’ 0.5 seconds
  • Test continues successfully
  • Event logged for dashboard
Zero Human Minutes
Total impact: 0 human minutes required.

Time-Travel Triage: Debugging the Future

When something does go wrong, CBA doesn't leave you guessing. The Time-Travel Triage feature records every handshake, every decision, every DOM state.

Open `triage.html`, load your mission trace, and *rewind* to see exactly what the browser looked like when the failure occurred. No more "works on my machine" debates.

Getting Started

Code
# Clone and setup
git clone https://github.com/starlight-protocol/starlight
cd cba
npm install
pip install -r requirements.txt
npx playwright install chromium

# Run the constellation
run_cba.bat  # Windows

Or build your own Sentinel in minutes:

Code
from sdk.starlight_sdk import SentinelBase
import asyncio

class MySentinel(SentinelBase):
    def __init__(self):
        super().__init__(layer_name="MySentinel", priority=10)
        self.capabilities = ["custom-healing"]

    async def on_pre_check(self, params, msg_id):
        # Your healing logic here
        await self.send_clear()

if __name__ == "__main__":
    asyncio.run(MySentinel().start())

The SDK handles:

  • βœ… WebSocket connection management
  • βœ… Auto-reconnect on failure
  • βœ… Persistent memory (JSON-based)
  • βœ… Graceful shutdown (Ctrl+C saves state)
  • βœ… Configuration loading

The Technology Stack

ComponentTechnology
HubNode.js + Playwright
SentinelsPython + AsyncIO
ProtocolJSON-RPC 2.0 over WebSocket
AI VisionOllama + Moondream (local SLM)
DeploymentDocker Compose
Privacy First
All AI processing happens locallyβ€”no cloud dependencies, no data leakage.

The Future: Sovereign Security

Phase 9 is on the horizon, bringing enterprise-grade features:

  • Shadow DOM Penetration: Handle modern web components with encapsulated styles
  • PII Sentinel: Detect and redact sensitive data before screenshots
  • Traffic Sovereign: Network-level chaos engineering and request mocking

Why "Starlight"?

The dung beetle doesn't navigate by watching the ground. It looks up at the Milky Wayβ€”a fixed reference point that transcends the chaos below.

The Analogy
Traditional automation is like watching the ground: every rock, every leaf, every obstacle requires explicit handling. CBA is like looking at the stars: we navigate by intent, and the constellation handles the terrain.

Conclusion: A Paradigm Shift

CBA isn't just a frameworkβ€”it's a philosophical shift in how we think about automation.

Old ParadigmNew Paradigm
Handle every edge caseAdapt to any edge case
Fragile selectorsSemantic goals
Hard-coded waitsTemporal intelligence
Invisible failuresQuantified ROI
Hope it worksKnow it will work

The goal is constant. The path is sovereign. The mission will succeed.

"The stars are aligned."
✨

Built with ❀️ by Dhiraj Das
Explore the protocol on GitHub

Dhiraj Das

About the Author

Dhiraj Das | Senior Automation Consultant | 10+ years building test automation that actually works. He transforms flaky, slow regression suites into reliable CI pipelinesβ€”designing self-healing frameworks that don't just run tests, but understand them.

Creator of many open-source tools solving what traditional automation can't: waitless (flaky tests), sb-stealth-wrapper (bot detection), selenium-teleport (state persistence), selenium-chatbot-test (AI chatbot testing), lumos-shadowdom (Shadow DOM), and visual-guard (visual regression).

Share this article:

Get In Touch

Interested in collaborating or have a question about my projects? Feel free to reach out. I'm always open to discussing new ideas and opportunities.