Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ restores the original home mode and umask in cleanup. Local runs and preinstalle
Launchable validation retain their original home permissions. Deterministic
permission denials remain owned by `src/lib/state/launch-readiness-lease.test.ts`.

OpenClaw launch evidence reads inline or zstd-compressed SQLite transcript rows.
Inline-only schemas can omit the compression columns.
Compressed payloads and their expanded data must each fit within 4 MiB.
The verifier checks the recorded expanded length and UTF-8 before validating
message order and transcript-prefix digests.

The native Podman row of Hermes GPU startup installs its reviewed host prerequisites before candidate checkout.
It uses the pinned host-dependency action for `conmon`, `fuse-overlayfs`, `golang-github-containers-common`, `iptables`, `nftables`, `slirp4netns`, and `uidmap`.
The container configuration package supplies Podman's standard image policy and seccomp files.
Expand Down
50 changes: 39 additions & 11 deletions test/e2e/live/launch-agent-turn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,18 +560,14 @@ function validPtyResponse(response) {
!/^\/dev\/pts\/\d+$/.test(response.ttyPath || "") ||
![response.dev, response.ino, response.rdev].every(
(value) => typeof value === "string" && /^(0|[1-9]\d{0,24})$/.test(value),
)
) ||
(response.status !== null &&
(!Number.isInteger(response.status) || response.status < 0 || response.status > 255)) ||
(response.signal !== null && !/^SIG[A-Z0-9]{1,24}$/.test(response.signal)) ||
(response.errorCode !== null && !/^[A-Z0-9_]{1,64}$/.test(response.errorCode))
) {
return false;
}
if (
response.status !== null &&
(!Number.isInteger(response.status) || response.status < 0 || response.status > 255)
) {
return false;
}
if (response.signal !== null && !/^SIG[A-Z0-9]{1,24}$/.test(response.signal)) return false;
if (response.errorCode !== null && !/^[A-Z0-9_]{1,64}$/.test(response.errorCode)) return false;
if (
typeof response.stderr !== "string" ||
Buffer.byteLength(response.stderr) > 256 ||
Expand Down Expand Up @@ -704,6 +700,31 @@ function requireEvidence(value, reason, detail = {}) {
value ? undefined : finish(2, reason, detail);
}

function decodeSqliteEventRow(row) {
if (row.eventJson !== null) return row;
const invalid = () => finish(2, "sqlite_session_record_invalid", sqliteEventRowDiagnostic(row));
if (
!(row.eventZstd instanceof Uint8Array) ||
row.eventZstd.byteLength < 1 ||
row.eventZstd.byteLength > 4 * 1024 * 1024 ||
!Number.isSafeInteger(row.eventBytes) ||
row.eventBytes < 1 ||
row.eventBytes > 4 * 1024 * 1024
) {
return invalid();
}
try {
const bytes = require("node:zlib").zstdDecompressSync(row.eventZstd, {
maxOutputLength: row.eventBytes,
});
if (bytes.byteLength !== row.eventBytes) return invalid();
const eventJson = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(bytes);
return { ...row, eventJson };
} catch {
return invalid();
}
}

function validSqliteEventRow(row) {
return (
typeof row.sessionId === "string" &&
Expand Down Expand Up @@ -803,9 +824,15 @@ function readExistingSqliteTranscriptSnapshot(before) {
)
.get();
requireEvidence(table?.name === "transcript_events", "sqlite_session_store_invalid", { check: "transcript_table" });
const columns = new Set(
database.prepare("PRAGMA table_info(transcript_events)").all().map((column) => column.name),
);
const eventZstd = columns.has("event_zstd") ? "event_zstd" : "NULL";
const eventBytes = columns.has("event_utf8_bytes") ? "event_utf8_bytes" : "NULL";
rows = database
.prepare(
"SELECT session_id AS sessionId, seq, event_json AS eventJson " +
"SELECT session_id AS sessionId, seq, event_json AS eventJson, " +
eventZstd + " AS eventZstd, " + eventBytes + " AS eventBytes " +
"FROM transcript_events ORDER BY session_id, seq",
)
.all();
Expand All @@ -823,7 +850,8 @@ function readExistingSqliteTranscriptSnapshot(before) {
"sqlite_session_store_replaced",
);
const sessions = new Map();
for (const row of rows) {
for (const storedRow of rows) {
const row = decodeSqliteEventRow(storedRow);
const valid = validSqliteEventRow(row);
requireEvidence(valid, "sqlite_session_record_invalid", valid ? {} : sqliteEventRowDiagnostic(row));
const events = sessions.get(row.sessionId) ?? [];
Expand Down
Loading
Loading