Some checks failed
Build and Test / build (debug, clang) (push) Has been cancelled
Build and Test / build (debug, gcc) (push) Has been cancelled
Build and Test / build (release, clang) (push) Has been cancelled
Build and Test / build (release, gcc) (push) Has been cancelled
Build and Test / docker (push) Has been cancelled
- src/learn/trace.cpp: a small trace format (exec, connect, write, ptrace, module with +offsets and process aliases) compiled to telemetry records with pids above any pid_max and node ids that name the trace and copy. - --replay --inject FILE [--inject-copies N]: copies are spread evenly over the ranked history (a first pass reads the time range), scored but never learned from, and checked against alert budgets of 1, 3 and 10 per day: is the copy's best window above the (budget x days)-th best real window? Ties count against. Injection leaves real windows and their ranking unchanged. - config/traces/standard.trace: the six plan traces (browser to curl|sh, systemd user persistence, memfd loader, ptrace injection, download then exec, python from a PDF viewer). - docs/evaluation/stage3-rarity-preregistration.md: method and pass thresholds, written before any run on host data. Tests: test_trace (standard traces, error messages with line numbers, records); test_replay R8 (every copy found, real ranking unchanged, a novel chain caught at 10/day and a bare shell not). fuzz_trace_dsl. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
1.1 KiB
C++
32 lines
1.1 KiB
C++
// Trace DSL over arbitrary text: never crashes; whatever compiles
|
|
// materializes into records whose node ids parse back to their trace.
|
|
|
|
#include "strawberry/learn/trace.hpp"
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
using namespace strawberry;
|
|
using namespace strawberry::learn;
|
|
|
|
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
|
std::vector<Trace> traces;
|
|
std::string error;
|
|
if (!compile_traces(std::string_view(reinterpret_cast<const char*>(data), size), traces, error)) {
|
|
if (error.empty() || !traces.empty()) __builtin_trap();
|
|
return 0;
|
|
}
|
|
for (const auto& t : traces) {
|
|
for (const auto& r : materialize_trace(t, 1'000'000'000, 3)) {
|
|
if (r.type != store::RecordType::process_exec) continue;
|
|
ProcessExecRecord e;
|
|
std::string name;
|
|
uint32_t instance = 0;
|
|
if (!decode_process_exec(r.payload, e) || !parse_trace_node(e.process_node_id, name, instance) ||
|
|
name != t.name || instance != 3) {
|
|
__builtin_trap();
|
|
}
|
|
}
|
|
}
|
|
return 0;
|
|
}
|