feat: add per-project native server and SSE command streaming
build / jvm (push) Waiting to run
build / native (macos-15, macos-arm64) (push) Waiting to run
build / native (ubuntu-24.04, linux-x86_64) (push) Waiting to run
build / native (windows-2025, windows-x86_64) (push) Waiting to run
Test / Tests and coverage
Intrepid/AI Engineering/pipeline/head This commit looks good
build / jvm (push) Waiting to run
build / native (macos-15, macos-arm64) (push) Waiting to run
build / native (ubuntu-24.04, linux-x86_64) (push) Waiting to run
build / native (windows-2025, windows-x86_64) (push) Waiting to run
Test / Tests and coverage
Intrepid/AI Engineering/pipeline/head This commit looks good
Keep Spring in a persistent project server with lightweight clients, managed start/stop, bounded SSE subscriptions, cursor recovery and durable mutation outcomes. Preserve SQLite authority and transaction limits, and document reproducible native measurements. Validation: 269 tests, 11 pipeline scenarios, full native/SSE smoke, native package verification and 17 installer tests passed. Implements WRK-000E / DEC-0001 / DEC-0002.
This commit is contained in:
@@ -11,6 +11,10 @@ package = Path(sys.argv[1]).resolve()
|
||||
manifest = json.loads((package / "aie-package.json").read_text())
|
||||
if manifest.get("schemaVersion") != 1 or manifest.get("protocolVersion") != 4:
|
||||
raise SystemExit("Unsupported native package manifest")
|
||||
if manifest.get("localServerProtocol") not in (None, 1):
|
||||
raise SystemExit("Unsupported local server protocol")
|
||||
if manifest.get("localServerEvents") not in (None, "sse"):
|
||||
raise SystemExit("Unsupported local server event transport")
|
||||
expected = manifest["files"]
|
||||
actual = set()
|
||||
for path in package.rglob("*"):
|
||||
@@ -41,4 +45,26 @@ with tempfile.TemporaryDirectory(prefix="aie-package-check-") as temporary:
|
||||
result = subprocess.check_output([str(sqlite), "-readonly", str(database), "PRAGMA quick_check;"], text=True).strip()
|
||||
if result != "ok":
|
||||
raise SystemExit("Packaged SQLite cannot read the native AIE database")
|
||||
if manifest.get("localServerProtocol") == 1:
|
||||
try:
|
||||
subprocess.run([str(aie), "start"], cwd=root, check=True, stdout=subprocess.DEVNULL, timeout=20)
|
||||
status = json.loads(subprocess.check_output([str(aie), "server", "status"], cwd=root, text=True, timeout=10))
|
||||
if status["state"] != "RUNNING" or status["server"]["protocol"] != 1 or status["server"]["build"] != manifest["buildIdentity"]:
|
||||
raise SystemExit("Native server build/protocol mismatch")
|
||||
subprocess.run([str(aie), "work", "create", "Disposable server verification"], cwd=root,
|
||||
check=True, stdout=subprocess.DEVNULL, timeout=20)
|
||||
work = json.loads(subprocess.check_output([str(aie), "work", "show", "WRK-0001", "--format", "json"], cwd=root, text=True, timeout=20))
|
||||
if work["id"] != "WRK-0001":
|
||||
raise SystemExit("Native client/server roundtrip failed")
|
||||
except BaseException:
|
||||
log = root / ".ai-engineering/.local/server/startup.log"
|
||||
if log.is_file():
|
||||
print(log.read_text()[-12000:], file=sys.stderr)
|
||||
raise
|
||||
finally:
|
||||
subprocess.run([str(aie), "stop", "--timeout-seconds", "10"], cwd=root,
|
||||
check=True, stdout=subprocess.DEVNULL, timeout=15)
|
||||
if manifest.get("localServerEvents") == "sse":
|
||||
subprocess.run([sys.executable, str(Path(__file__).with_name("native-sse-smoke.py")),
|
||||
"--binary", str(aie)], check=True, timeout=120)
|
||||
print("Native package verified:", package)
|
||||
|
||||
Reference in New Issue
Block a user