🕵️ FGA 08: Bring Me the Usual Suspects 🐶
Turning graph selection into a durable, idempotent manual hypothesis without pretending that the note is evidence.

Hercule Perrot had finally been given a graph that behaved. The nodes had names, the relationships had direction and the view stayed inside its warrant.
The board could answer the question from FGA 07: what was Hercule looking at? It could not answer the next one: what was he allowed to ask it to do?
He selected a company. It turned blue. A side panel appeared with a button that looked innocent enough to be dangerous.
“Excellent,” he said.
He touched the button with one paw.
“If I press this, am I investigating the record—or teaching the graph to invent a fact?”
FGA 07 taught FGA what to show. FGA 08 asks what a player may ask it to do.
Our dog raised one ear. The suspect was SUBMIT ON CLICK.
How can a graph selection become a controlled investigation request without becoming a new piece of evidence?
Part I — The Button With a Warrant
The graph had finally learned to point
The old board had been a respectable witness. It could show a bounded neighbourhood, preserve record identities and explain why a relationship was visible. It could even let Hercule move through the room without quietly opening a door marked protected truth.
But selection is not investigation.
Selection is a presentation event. It says that the player wants context about a record. It does not say that the player wants a new relationship, a provider call, a paid answer or a verdict. A selected node is not a convicted node; a highlighted edge is not a completed theory.
FGA 04 gave the case a shared language. FGA 05 gave it a place to live. FGA 06 gave it a renderer. FGA 07 taught it restraint. FGA 08 asks what happens after a player points at a record and wants to do something about it.
The first useful action would be deliberately modest: let Hercule record a typed manual hypothesis between two records already present in the safe graph. No hidden neighbour search. No provider call. No credits. No secret answer arriving through the back door.
The button would have a warrant. It would not have a badge.
A selection becomes a subject, not a command
The frontend keeps the selected graph identity separate from the command that may follow it. When Hercule chooses “Use as From” or “Use as To”, the client copies the selected record’s stable ID into that field and clears the other field if it would create a duplicate.
The selection bridge does not call the API, spend a credit or create history. Hercule still chooses the second record, chooses the relationship type and presses the action button. That extra click is not ceremony; it is the boundary between looking and asking.
The form also has a dropdown path for players who prefer the list to the graph. Both paths end with the same record identifiers. The renderer can remain replaceable. The case file receives the same subjects either way.
The first suspect was the automatic click
The obvious design was to submit a hypothesis as soon as Hercule clicked a node. It would feel fast. It would also make every inspection look like an instruction.
That design went into the interrogation room and did not come back.
| Temptation | What it would quietly mean | Decision |
|---|---|---|
| Submit on node click | Looking at a record is an investigative command | Rejected |
| Add a free-text note | The server must interpret an unbounded claim | Rejected |
| Create a source relationship | Player intent would masquerade as evidence | Rejected |
| Open a typed, explicit form | The player owns the theory; the server owns the boundary | Kept |
The action had to be visible in the workspace, available only where the case allowed it and explicit enough that a screen reader, a keyboard user and a tired detective could understand what would happen next.
Part II — The Case File Takes a Statement
Six questions enter the room
Hercule opened a fresh case file. The page had six questions to answer: who was involved, why the player was asking, what it cost, what might come back, where the request stood and which evidence it produced.
That was the right shape, but it was still a design until the game could accept one request and prove what it did. FGA 08 built the smallest executable version: a typed relationship hypothesis, a zero-credit cost, a durable command receipt and an empty evidence list.
The request belongs to a round—the server-owned investigation attempt introduced in FGA 01—which binds the player, case and lifecycle. The ledger uses that boundary to keep one investigation’s notes away from another’s.
The model maps those questions to explicit fields:
| Case-file question | What FGA 08 records |
|---|---|
| Who is involved? | source_record_id and target_record_id |
| Why is the player asking? | action and a typed relationship_type |
| What does it cost? | charged_credits |
| What can come back? | revealed_record_ids |
| Where is the request? | status and created_at |
| Can this exact request be found again? | command_id, round_id, idempotency_key and request_hash |
The command is a case note with a spine:
@dataclass(frozen=True, slots=True)
class InvestigationCommand:
command_id: str
round_id: str
idempotency_key: str
request_hash: str
action: str
source_record_id: str
target_record_id: str
relationship_type: str
status: str
charged_credits: int
revealed_record_ids: tuple[str, ...]
created_at: str
The names are intentionally less glamorous than “insight” or “discovery”. A command is something the system can identify, validate, store and replay. It is not allowed to borrow the prestige of evidence merely because it arrived through an API.
Three kinds of relationship, one honest notebook
The player does not type whatever suspicion happens to be fashionable that afternoon. The service accepts the three relationship types that this slice of the case can explain:
ALLOWED_RELATIONSHIPS = frozenset({
"POSSIBLE_IDENTITY",
"POSSIBLE_CONTROL",
"POSSIBLE_FLOW",
})
These are hypotheses, not source relationships. “Possible control” is a working theory between two records. It is not an assertion that the source system reported control, and it is certainly not an assertion that either record is guilty.
The HTTP request carries the same bounded shape:
class HypothesisRequest(ApiModel):
idempotency_key: str = Field(
pattern=r"^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$"
)
source_record_id: str = Field(min_length=1, max_length=128)
target_record_id: str = Field(min_length=1, max_length=128)
relationship_type: str = Field(min_length=1, max_length=64)
The key has a shape because retries need an identity. The subjects have limits because an investigation request is not a place to smuggle a novel into a database column. The relationship type is typed because the game should not pretend that every sentence has the same meaning.
What the receipt says
The response reports the command, not a conclusion. A successful first request has the following semantic shape:
The example uses the Academy T02 fixture—T02 is the internal short code for the case used by this iteration. T2-O-BAKERY is the published organisation record “Blue Bowl Bakery”; T2-P-CYPHER is the published person record “Cypher Corgi”. They are stable handles for two records already in the graph, not hidden verdicts.
In the response, source_record_id and target_record_id are simply the two endpoints of the player’s typed hypothesis. They do not mean “source evidence” and “target evidence”.
For the first request, replayed: false means that the response records the command rather than returning a stored retry.
{
"action": "MANUAL_HYPOTHESIS",
"source_record_id": "T2-O-BAKERY",
"target_record_id": "T2-P-CYPHER",
"relationship_type": "POSSIBLE_CONTROL",
"status": "RECORDED",
"charged_credits": 0,
"revealed_record_ids": [],
"replayed": false
}
The empty list is not an omission. It is the point. The player has written down a theory; the evidence inventory has not changed.
Part III — The Server Keeps the Warrant
Validation belongs at the desk
The browser can present a careful form. It can disable the button when the two subjects are equal. It can display a reassuring message. None of that is an authorisation decision.
The round boundary is not a browser convenience. Its workspace is the player-safe graph and controls that round is allowed to inspect.
The service repeats the important checks on the server. The implementation starts with request identity, then subjects, then relationship type, then the round and case boundary:
if not IDEMPOTENCY_KEY_PATTERN.fullmatch(idempotency_key):
raise InvalidRequestError(
code="INVALID_IDEMPOTENCY_KEY",
title="Invalid request identity",
detail="Use 1 to 128 letters, digits, dots, underscores, colons or hyphens.",
recovery="Generate a fresh key and retry the unchanged request.",
)
if source_record_id == target_record_id:
raise InvalidRequestError(
code="INVALID_HYPOTHESIS_SUBJECTS",
title="Invalid hypothesis subjects",
detail="A hypothesis needs two different records.",
recovery="Choose two different records from the published graph.",
)
if relationship_type not in ALLOWED_RELATIONSHIPS:
raise InvalidRequestError(
code="INVALID_HYPOTHESIS_TYPE",
title="Invalid hypothesis type",
detail="Choose a supported hypothesis relationship type.",
recovery="Use one of the typed hypothesis options.",
)
The active round is required. The action is enabled only for the Academy T02 case in this iteration. The subjects must belong to the published T02 graph. A request that passes through a friendly browser but fails one of those checks never becomes a command.
This is the same architectural instinct that ran through the previous articles: the UI explains the boundary, but the domain enforces it.
The case decides whether the action exists
Workspace projection tells the frontend whether the action is available. It does not turn availability into trust. For an active T02 round, the workspace exposes CREATE_HYPOTHESIS. For another case, the action is absent or unavailable.
That matters because a button is not a capability by itself. The action is a contract between the workspace, the API and the command service. If one layer says “available” while another silently accepts every case, the game has three detectives and no chain of custody.
The rejection table stayed small and concrete:
| Request | Result |
|---|---|
| Unknown record | SUBJECT_NOT_AVAILABLE |
| Same source and target | INVALID_HYPOTHESIS_SUBJECTS |
| Unsupported relationship | INVALID_HYPOTHESIS_TYPE |
| Inactive round | ROUND_NOT_ACTIVE |
| Case other than T02 | ACTION_NOT_AVAILABLE |
| Malformed idempotency key | Validation failure before command creation |
The service does not create a partially valid note and hope a later step will tidy it up. A request either satisfies the case boundary or remains outside the ledger.
A hypothesis changes the notebook, not the graph
The decisive check is deliberately boring. Before posting the hypothesis, the test captures the workspace graph. After posting it, the graph must be byte-for-byte the same.
before = client.get(
f"/api/v1/rounds/{round_id}/workspace"
).json()["graph"]
response = client.post(
f"/api/v1/rounds/{round_id}/investigations/hypotheses",
json=_payload(),
)
assert response.status_code == 200
assert response.json()["charged_credits"] == 0
assert response.json()["revealed_record_ids"] == []
assert client.get(
f"/api/v1/rounds/{round_id}/workspace"
).json()["graph"] == before
The command can be listed in history. It cannot edit the published projection. It cannot reveal a record. It cannot charge a credit. It cannot turn its own relationship type into a source fact.
Hercule underlined the rule twice: a player theory may sit beside the evidence; it must never wear the evidence’s coat.
Part IV — The Key That Stops Double Jeopardy
The connection went dark
The first real-world suspect was not a criminal. It was a network connection.
Hercule pressed “Record hypothesis”. The server accepted the command. The response vanished between the office and the desk. The browser had no idea whether to show failure or success.
Retrying with a new command would be dangerous in a paid investigation. Even here, where the cost is zero, it would produce duplicate history and make the case look more certain merely because the wire had coughed.
The client therefore keeps the same idempotency key across an ambiguous retry. It changes the key only when the player changes the request.
The payload earns a fingerprint
The service hashes the semantic request, not the timestamp and not the generated command identifier:
request = {
"action": "MANUAL_HYPOTHESIS",
"source_record_id": source_record_id,
"target_record_id": target_record_id,
"relationship_type": relationship_type,
}
request_hash = sha256(
json.dumps(
request,
sort_keys=True,
separators=(",", ":"),
).encode("utf-8")
).hexdigest()
The repository uses the pair of round and idempotency key as the lookup identity. If the key returns the same request hash, the repository returns the stored command and the API marks the response as replayed. If the key returns a different hash, the request is not a retry. It is an attempt to reuse an identity for another theory, and the service rejects it with IDEMPOTENCY_KEY_REUSED.
That difference is the whole case. Same question, same receipt. Different question, new key.
SQLite remembers after the lights go out
The in-memory adapter makes the behaviour cheap to test. The durable application mode uses the SQLite adapter introduced in FGA 01; here it makes the identity constraint part of the database schema:
CREATE TABLE IF NOT EXISTS investigation_commands (
command_id TEXT PRIMARY KEY,
round_id TEXT NOT NULL,
idempotency_key TEXT NOT NULL,
request_hash TEXT NOT NULL,
action TEXT NOT NULL,
source_record_id TEXT NOT NULL,
target_record_id TEXT NOT NULL,
relationship_type TEXT NOT NULL,
status TEXT NOT NULL,
charged_credits INTEGER NOT NULL,
revealed_record_ids_json TEXT NOT NULL,
created_at TEXT NOT NULL,
UNIQUE (round_id, idempotency_key)
);
The repository opens a transaction before looking for an existing command. It commits the first accepted command, returns the stored command for an exact replay and rolls back on a conflicting request. The unique constraint remains the final bouncer when two arrivals reach the door together.
The race test sends eight concurrent accepts with the same key. One result creates the row. The other seven receive the same command identity. The history still contains one entry.
In the snippet, item is the same already-validated request passed to every worker. The test is checking the one-write rule, not constructing eight different theories.
with ThreadPoolExecutor(max_workers=8) as pool:
results = list(
pool.map(lambda _: repository.accept(item), range(8))
)
assert sum(created for _, created in results) == 1
assert {command.command_id for command, _ in results} == {"cmd-race"}
assert repository.list_for_round("round-1") == (item,)
The ledger does not count retries as enthusiasm.
Part V — The Selection Joins the Case
The graph gives the form its first witness
The graph remains a graph. It does not become a form disguised as a canvas.
When Hercule selects a node, the action panel reports the selected record and offers two explicit shortcuts: use it as From, or use it as To. A second record still has to be chosen, and the target list excludes the source. The old dropdown path remains available for players who are working from the case history rather than the picture.
The final submission calls the same API regardless of how the subjects were selected. The rest of the form state is omitted below; the important boundary is the API call followed by history de-duplication on command ID:
const result = await submitManualHypothesis(workspace.round.id, {
idempotency_key: idempotencyKey,
source_record_id: sourceId,
target_record_id: targetId,
relationship_type: relationshipType,
});
setHistory((current) =>
current.some((item) => item.command_id === result.command_id)
? current
: [...current, result]
);
The local history update also checks the command identity. A replay should not add a second visual row just because the response arrived through a retry path.
Feedback is part of the evidence handling
The player needs to know which room they are in. On success, the panel says that the hypothesis was recorded and that no credits were charged or evidence revealed. On an exact replay, it says that the same hypothesis was already recorded. On a failed request, it says to retry without changing the request.
That wording is not marketing copy. It is the user-facing interpretation of the command contract. If the panel says “new evidence found” while the API returns an empty evidence list, the game has created a false witness before any analytical feature exists.
The history is intentionally plain: source record, target record, relationship type and status. It is a command history, not an evaluator’s answer key and not a new graph layer pretending to be immutable truth.
Refresh must not erase the notebook
The browser asks for history when the round changes. The service asks the round repository to confirm that the round exists. The durable SQLite adapter can be closed and reopened; the command remains.
The restart test does exactly that: create a round, record a hypothesis, close the first application, start a second application with the same SQLite file, replay the same request and read the history. The command identifier remains stable and the replay flag becomes true.
The detective can leave the room without losing the note. He still cannot take the evidence with him.
Part VI — The Notebook Is Not Evidence
Three ledgers, not one
By this point the case contains three different kinds of state:
| State | Owner | Meaning |
|---|---|---|
| Graph projection | Published case data | The player-safe records and relationships available to the round |
| Command history | Application persistence | What the player explicitly asked the game to record |
| Evidence inventory | Reveal and provider workflow | Facts the server has authorised and exposed to the player |
FGA 08 writes only to the middle ledger. The graph projection remains unchanged. The evidence inventory remains unchanged. The command history answers one narrow question: what hypotheses did this player record in this round?
That separation is what keeps a manual hypothesis useful. Hercule can use it as a working relationship while following a trail, but the game can still distinguish a source relationship from a player-created theory when later articles introduce identity resolution, graph analytics and paid investigation.
Zero credits is a real result
It would be easy to treat zero as a placeholder and forget to test it. That would be a mistake. Cost is part of the command contract, even when the first command is free.
The response records charged_credits: 0. It does not omit the field, return null or infer the value from a UI label. The same discipline applies to revealed_record_ids: an empty list says that the operation revealed nothing.
When FGA 09 and later iterations introduce analytical or provider-backed actions, they will need a different request and a different settlement path. The manual note is not allowed to borrow that future machinery early.
The command is replayable; the theory is still provisional
An idempotent command answers whether the same instruction was accepted once. It does not answer whether the theory is correct.
That distinction is important enough to keep in the prose and in the interface. A replayed POSSIBLE_CONTROL hypothesis is still a possibility. The server has confirmed the existence of the note, not the truth of the relationship.
Hercule wrote the sentence in the margin: “The receipt is authoritative about the write. It is silent about the world.”
Part VII — The Read-Only Room at Databricks
The source publication is a witness, not a command store
The live boundary check uses the Databricks profile fga to qualify the active player-safe T02 publication. It does not write manual hypotheses into the analytical snapshot. The command history belongs to the application persistence boundary; Databricks supplies the safe graph projection consumed by the case.
A publication is the approved case version the game is allowed to read; a snapshot is the immutable version bound to that investigation. FGA 04 and FGA 05 established that distinction before Databricks entered this room.
The qualifier asks a small set of read-only questions:
| Check | Question |
|---|---|
| Active publication | Which case version and snapshot should this round read? |
| Records | How many rows, distinct record IDs and snapshots are visible? |
| Relationships | How many rows, distinct relationship IDs and snapshots are visible? |
| Boundary | Are all relationship endpoints present, and are protected columns absent? |
The qualification result is explicitly marked read-only:
{
"status": "pass",
"read_only": true,
"profile": "fga",
"case_id": "ACADEMY_T02",
"record_summary": [20, 20, 1],
"relationship_summary": [21, 21, 1],
"dangling_endpoint_count": 0,
"forbidden_columns": []
}
Those numbers describe the source publication. They do not describe how many hypotheses Hercule has written down. Mixing the two would make the report look more complete and make the architecture less honest.
Read each three-number summary as total rows, distinct IDs and snapshots: twenty records, twenty distinct IDs and one snapshot; twenty-one relationships, twenty-one distinct IDs and one snapshot.
One publication, one snapshot, no hidden answer
The live qualification found one active T02 publication, twenty distinct records, twenty-one distinct relationships and one snapshot for each view. Relationship endpoints were complete. The player-safe columns contained no names that would smuggle an evaluator answer, guilt label or hidden truth into the visible projection.
The warehouse was stopped after the check. The qualification was a boundary check, not a per-click analytical dependency.
That last sentence matters. A manual hypothesis does not call Databricks to discover whether it is right. It records that Hercule wants to investigate a relationship. The future provider or analytical workflow must earn its own request contract when it arrives.
Part VIII — The Interrogation
The free-text note was a charming liar
An open text box would have made the first version look flexible. It would also have left the server to guess whether “same guy”, “owns the shell” and “money trail?” were three relationship types, three notes or one very confused confession.
Typed relationship families give the player a vocabulary and give the service something it can validate. The labels are not a replacement for explanation; they are a refusal to pretend that unbounded prose is a stable command contract.
The graph mutation wore a false moustache
Another suspect proposed that recording a hypothesis should add a dashed edge to the graph immediately. That may be a useful presentation feature later, but it was not allowed to change the published graph in this slice.
The command history can say that Hercule wrote a working relationship. The graph can later decide how to display that player-owned mark, with a visual distinction from source relationships. For now the implementation proves the harder boundary first: the note is durable without contaminating the source projection.
The provider call was hiding under the floorboards
The next rooms lead to analytical providers, credits and resulting evidence. FGA 08 stops before that door.
No Zingg. No GraphFrames. No Genie retrieval. No provider dispatch. No paid quote. No evaluator. No verdict. The absence is not unfinished prose; it is the scope of the iteration. The first command has to be safe before the game can afford to make it powerful.
The concurrency test brought a second detective
The final suspect was timing. Two identical requests can arrive together even when one player presses one button once. The SQLite transaction, unique key and request hash make the race observable and safe.
The test suite does not settle for a happy-path response. It checks exact replay, changed-payload conflict, eight concurrent submissions, application restart, unknown records, same subjects, unsupported types, inactive rounds and unavailable cases. The notebook earns its reliability by surviving the boring cases.
Part IX — The Case Stays Open
What the evidence supports
The first manual-hypothesis workflow is now a complete, bounded investigation path: a graph selection can fill a subject; an explicit command can be submitted; the server validates the round, case and subjects; the ledger can replay the same request without duplicating it; and the player-safe graph remains untouched.
The qualification work covers the behaviour that matters to this case:
- A valid active T02 round accepts a typed hypothesis between two different published records.
- Exact retries return the existing command; changed payloads under the same key are rejected.
- A concurrent retry settles once, and the SQLite history survives an application restart.
- The command records zero credits and no revealed records; the Databricks source check remains read-only.
The work is scoped to the FGA 08 contract and its Academy T02 workload. It is not a universal claim about every investigation provider, case size or future analytical path.
The notebook can now remember a theory without rewriting the evidence.
What it does not prove
It does not prove that a hypothesis is true, that a selected record is guilty, that a manual relationship belongs in the source graph, or that a retry has become a second investigation.
It does not add entity resolution, Zingg, GraphFrames, Genie retrieval, paid credits, provider dispatch, player authentication, an evaluator or a verdict workflow. Those suspects belong to later cases. FGA 08 proves the boundary that lets them arrive without borrowing the notebook’s authority.
The command has an identity. The evidence still needs a warrant.
The Arrest
Hercule returned to the board. The selected company was still where he had left it. The graph had not grown a mysterious edge. No credit counter had moved. No secret relationship had slipped through the frame.
On the desk, however, one new line had appeared:
{
"action": "MANUAL_HYPOTHESIS",
"status": "RECORDED",
"relationship_type": "POSSIBLE_CONTROL",
"charged_credits": 0,
"revealed_record_ids": []
}
The note had a command identity. The round had a history. A retry could find the same answer without creating a second case file.
Hercule put down his pencil.
“At last,” he said. “A suspect can enter the notebook without being promoted to evidence.”
The dog in the corner gave one approving bark. It was the first witness all evening who had not overclaimed.
Case Closed?
Hercule shut the case file. The graph still showed the published evidence, the ledger remembered the question and the answer key remained behind its locked door.
FGA 08 had not taught the game to know the truth. It had taught the game to remember who asked the question without changing what the evidence said.
Our dog put one paw on the command history. The next suspect was already waiting in the filing room.
Next in the Series
🕵️ FGA 09: Zingg Me a River 🐶
FGA 09 will put the word “same” on trial. Noisy records may resemble one another; similarity is not identity, identity is not guilt, and a player-safe candidate still needs a clear explanation.
The manual hypothesis can now sit in the ledger. The next case asks how records earn the right to look like one thing.
Source Code
Browse the source code for FGA 08 on GitHub ↗

A theory goes in the ledger. Evidence still needs a warrant.
