Build spec · v1 · for red-pen
Pre-compute — Fides pre-thinks every ticket
Move Fides's thinking from on-open (live, a wait) to on-arrival (background, instant) — so a support agent opens a ticket with her work already there. Smart instant trigger, not polling. Read-only — nothing fires.
Draft for your annotation · the first production-engine slice · no building yet
01
The loop
A ticket lands, a ping fires, she pre-thinks it, the result is saved. Opening it is instant.
Salesforce ticket arrives→
instant ping (webhook)→
verify + debounce→
Fides pre-thinks (the brain)→
save the result
On open: the screen reads the saved result → instant (falls back to live only if there's no fresh result). · Safety net: a slow background sweep catches any ping that gets missed — so a miss is "a few minutes late," never "lost."
02
What's already there vs. what's new
Mostly wiring — the hard parts (the thinking, the worker, the Salesforce connection) exist.
Already exists
- The brain's thinking (it reads a ticket → her read + proposed actions)
- A background-worker setup (a scheduled job)
- The Salesforce connection (we already read from it)
New (this slice)
- The small "catch the ping → pre-think → save" path
- The saved-result cache (keyed by ticket + a content hash)
- The screen reading the cache first (instant), live as fallback
- One tiny config on the Salesforce side (a runbook — §04)
03
The gates — what we'll prove
Tested on our side with a simulated ping; the trust spine (read-only, nothing fires) holds.
G1Auth
A forged/unsigned ping is rejected; only a genuine Salesforce ping triggers a pre-think.
G2Pre-think + save
A valid ping runs the brain and saves the result, keyed by ticket + content hash.
G3Debounce
Many rapid pings for one ticket → exactly one pre-think.
G4Instant on open
A pre-cached ticket opens with no live call; no-cache still works live (no regression).
G5Freshness
A changed ticket re-thinks; a stale result is never served.
G6Safety net
A ticket the ping missed gets pre-thought on the next background sweep.
G7Read-only
Pre-compute fires nothing — the dry-run guarantee holds.
G8Honest failure
A thinking error → an honest fallback, never a fabricated saved result.
04
The one Salesforce step (admin, not code)
~3 steps, delivered when we ship: in Salesforce, a Flow on ticket create/update → Send HTTP request to our worker's URL, with a shared-secret header. I build + test everything on our side first; this flip is the last mile, done by whoever has Salesforce admin. I won't touch your live org myself.
05
Open decisions — your red-pen
1 · What to pre-compute
Just her read, or the full proposal (read + receipts + draft)? My rec: the full thing — it's one pass, and the whole point is "her work is already there."
2 · Freshness
Trust the saved result whenever the ticket hasn't changed, or also expire it after some time? My rec: hash-match is enough; add a max-age later if we need it.
3 · "Deeper thinking" (now that she has background time)
Run extra real checks (is the site up? is this invoice real?) in the first slice, or as a fast-follow? My rec: fast-follow — prove the instant loop first, then make her pre-think deeper.