quill/oracle Public Public: anyone can read this; nobody can change it.
workbenchthis machine
Files 03f1664f22cdaf6fba424941edb6890e6b00b5a4
| 1 | # the oracle |
| 2 | |
| 3 | Ask it anything. It answers with conviction, never twice differently, and |
| 4 | keeps score of how often it was right. |
| 5 | |
| 6 | The conceit is the mechanism: a verdict is **derived from the question**, not |
| 7 | drawn from chance. `sha256(normalized question)` picks the stance, the |
| 8 | confidence (52–98 — it never admits to a coin flip) and the omen it claims to |
| 9 | have read. So asking twice gets the same answer, "Will it rain?" and |
| 10 | ` WILL IT RAIN!!! ` are one question, and the ledger can be scored: |
| 11 | every verdict can be marked **right** or **wrong** afterwards, and the front |
| 12 | page reports what the oracle actually achieved against what it claimed — |
| 13 | `Right 61%, claimed 84%. It talks a better game than it plays.` |
| 14 | |
| 15 | That last line is the only real thing here. The stances are theatre; the |
| 16 | calibration is arithmetic over what you told it. |
| 17 | |
| 18 | ## Using it |
| 19 | |
| 20 | Ask on the front page; you land on the verdict's own page, which is a |
| 21 | permalink you can come back to when you know how it turned out. `/ledger` |
| 22 | holds everything, filtered by all / unjudged / right / wrong. |
| 23 | |
| 24 | ## Running it |
| 25 | |
| 26 | sh |
| 27 | PORT=8080 FORGE_APP_DATA=./data bun run src/server.ts # run it here |
| 28 | bun test # the check every pull runs |
| 29 | FORGE_APP_DATA=./data bun run src/tty.ts # the terminal interface |
| 30 | |
| 31 | |
| 32 | It also has a terminal — the exact command is in `FORGE_APP_SSH` when the app |
| 33 | runs, and the footer prints it. `j`/`k` move, `a` asks, `r`/`w` score the |
| 34 | verdict under the cursor, `u` takes a score back, `q` leaves. Same ledger as |
| 35 | the web page. |
| 36 | |
| 37 | ## Shape |
| 38 | |
| 39 | | file | what it holds | |
| 40 | | --------------- | ---------------------------------------------------------- | |
| 41 | | `src/oracle.ts` | the mind: normalize, derive a verdict, score the record | |
| 42 | | `src/db.ts` | the ledger: one row per question, asking again is not new | |
| 43 | | `src/pages.ts` | every page, server-rendered, script-free | |
| 44 | | `src/server.ts` | the door: security floor, body caps, the table of paths | |
| 45 | | `src/tty.ts` | the same ledger in a terminal | |
| 46 | |
| 47 | Everything it keeps lives under `FORGE_APP_DATA`, which is what makes |
| 48 | production data and preview data two different things: a preview starts as a |
| 49 | copy of production's verdicts and never writes back. |
| 50 | |
| 51 | No dependencies. No JavaScript on the page. |