Q134: a signal's category comes from its runtime source, so self-checks cannot pass as real traffic

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 5.5 committed 2026-10-08 21:43:21 -04:00
1 parent 3849b96192
commit 403c57785c
11 files changed
+44 -34

No files matched your search

+19 -1
View File
@@ -49,7 +49,10 @@ describe("operations service", () => {
"provider_background_execution",
"social_publish_approval",
]);
expect(state.sloTargets.map((target) => target.signalKey)).toContain("browser_session_boundary");
// Every SLO target is fed by a runtime source; none waits on a signal only a drill would write.
expect(state.sloTargets.map((target) => target.signalKey).sort()).toEqual([
"approval_route_coverage", "migration_validation_success", "provider_request_success", "skill_resolve_success",
]);
expect(connection.db.prepare("select name from sqlite_master where type = 'table' and name like 'chaos_drill%'").all()).toEqual([]);
connection.close();
});
@@ -97,4 +100,19 @@ describe("operations service", () => {
})).rejects.toThrow("Provider background execution is disabled by feature flag.");
connection.close();
});
test("a signal's category comes from its runtime source, so a self-check cannot be filed as real traffic", () => {
const connection = createConnection();
const operations = new OperationsService(connection.db);
let orgId = "";
connection.transaction(() => {
orgId = createOrganization(new OrganizationService(connection.db));
});
operations.recordSignal({ orgId, source: "skill_resolver", success: true, durationMs: null, detail: {} });
expect(connection.db.prepare("select signal_key, source from operational_events where org_id = ?").all(orgId))
.toEqual([{ signal_key: "skill_resolve_success", source: "skill_resolver" }]);
expect(() => operations.recordSignal({ orgId, source: "replay_eval" as "skill_resolver", success: true, durationMs: null, detail: {} }))
.toThrow('"replay_eval" is not a runtime signal source.');
connection.close();
});
});