Protocol Documentation¶
Table of Contents¶
fathom.proto¶
AssertFactRequest¶
| Field | Type | Label | Description |
|---|---|---|---|
| session_id | string | Required. Working memory is per session; create the session with Evaluate first; an unknown one is NOT_FOUND. An empty session_id is refused with INVALID_ARGUMENT. | |
| template | string | ||
| data_json | string | JSON-encoded slot data, a JSON object; anything else is INVALID_ARGUMENT. |
AssertFactResponse¶
| Field | Type | Label | Description |
|---|---|---|---|
| success | bool |
EvaluateRequest¶
| Field | Type | Label | Description |
|---|---|---|---|
| session_id | string | Optional. Empty: a stateless evaluation against the server's engine. Set: the session's working memory is used, and Evaluate is the call that opens it -- an unknown id is created, bound to ruleset (empty if none is named). A known id is joined; naming a different ruleset than the session was opened with is FAILED_PRECONDITION. A server that mounts an engine refuses sessions with FAILED_PRECONDITION. |
|
| ruleset | string | Ruleset path relative to FATHOM_RULESET_ROOT. | |
| facts | FactInput | repeated |
EvaluateResponse¶
| Field | Type | Label | Description |
|---|---|---|---|
| decision | string | optional | Optional so that "no rule produced a decision" is distinguishable from a rule that decided the empty string. proto3 has no other way to say it: an unset non-optional string arrives as "" at every client. |
| reason | string | optional | |
| rule_trace | string | repeated | |
| module_trace | string | repeated | |
| duration_us | int64 | ||
| metadata | EvaluateResponse.MetadataEntry | repeated | The then.metadata of the rule that wrote the decision. Carried here so a gRPC caller sees the same result shape a REST caller does; control ids and other rule-authored context live in it. |
| attestation_token | string | optional | Ed25519 JWT over this evaluation, present only when the server was built with an attestation service. |
EvaluateResponse.MetadataEntry¶
| Field | Type | Label | Description |
|---|---|---|---|
| key | string | ||
| value | string |
FactChange¶
| Field | Type | Label | Description |
|---|---|---|---|
| change_type | ChangeType | ||
| template | string | ||
| data_json | string | JSON-encoded slot data of the changed fact. |
FactInput¶
| Field | Type | Label | Description |
|---|---|---|---|
| template | string | ||
| data_json | string | JSON-encoded slot data, a JSON object (e.g. {"tool_name": "bash", "agent_id": "a1"}). Anything else is INVALID_ARGUMENT. |
QueryRequest¶
| Field | Type | Label | Description |
|---|---|---|---|
| session_id | string | Required. Working memory is per session; create the session with Evaluate first; an unknown one is NOT_FOUND. An empty session_id is refused with INVALID_ARGUMENT. | |
| template | string | ||
| filter_json | string | Optional JSON-object filter (e.g. {"agent_id": "a1"}). Empty matches every fact of the template; any non-object JSON, null included, is INVALID_ARGUMENT. |
QueryResponse¶
| Field | Type | Label | Description |
|---|---|---|---|
| facts_json | string | repeated | Each entry is a JSON-encoded dict representing one fact. |
ReloadRequest¶
| Field | Type | Label | Description |
|---|---|---|---|
| ruleset_path | string | ||
| ruleset_yaml | string | ||
| signature | bytes |
ReloadResponse¶
| Field | Type | Label | Description |
|---|---|---|---|
| ruleset_hash_before | string | ||
| ruleset_hash_after | string | ||
| attestation_token | string |
RetractRequest¶
| Field | Type | Label | Description |
|---|---|---|---|
| session_id | string | Required. Working memory is per session; create the session with Evaluate first; an unknown one is NOT_FOUND. An empty session_id is refused with INVALID_ARGUMENT. | |
| template | string | ||
| filter_json | string | Optional JSON-object filter. Empty retracts every fact of the template; any non-object JSON, null included, is INVALID_ARGUMENT. |
RetractResponse¶
| Field | Type | Label | Description |
|---|---|---|---|
| retracted_count | int32 |
SubscribeRequest¶
| Field | Type | Label | Description |
|---|---|---|---|
| session_id | string | Required. Working memory is per session; create the session with Evaluate first; an unknown one is NOT_FOUND. An empty session_id is refused with INVALID_ARGUMENT. |
ChangeType¶
| Name | Number | Description |
|---|---|---|
| CHANGE_TYPE_UNSPECIFIED | 0 | |
| CHANGE_TYPE_ASSERT | 1 | |
| CHANGE_TYPE_RETRACT | 2 | |
| ASSERT | 1 | |
| RETRACT | 2 |
FathomService¶
| Method Name | Request Type | Response Type | Description |
|---|---|---|---|
| Evaluate | EvaluateRequest | EvaluateResponse | Evaluate asserted facts against loaded rules and return a decision. |
| AssertFact | AssertFactRequest | AssertFactResponse | Assert one or more facts into working memory. |
| Query | QueryRequest | QueryResponse | Query working memory for facts matching a template and optional filter. |
| Retract | RetractRequest | RetractResponse | Retract facts matching a template and optional filter. |
| SubscribeChanges | SubscribeRequest | FactChange stream | Stream working-memory changes as they occur during evaluation. |
| Reload | ReloadRequest | ReloadResponse | Hot-reload the ruleset from a path or inline YAML. |