Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Usage, Billing settings and prepaid AI credit; fixes from the UX audit | 1 | import assert from "node:assert/strict"; |
| 2 | import { test } from "node:test"; | |
| 3 | ||
| Merge memory from docs: only docs on how to work here, whole sentences, no near-duplicates, stale doc suggestions cleared | 4 | import { distinctFacts, sameFact } from "./memory-facts.ts"; |
| Usage, Billing settings and prepaid AI credit; fixes from the UX audit | 5 | |
| 6 | test("a fact remembered twice is shown once, the first kept", () => { | |
| 7 | const facts = [ | |
| 8 | { id: "a", text: "Run tests with npm test." }, | |
| 9 | { id: "b", text: "We use pnpm everywhere" }, | |
| 10 | { id: "c", text: "run tests with npm test" }, | |
| 11 | { id: "d", text: "We use pnpm everywhere." }, | |
| 12 | ]; | |
| 13 | assert.deepEqual(distinctFacts(facts).map((fact) => fact.id), ["a", "b"]); | |
| 14 | assert.deepEqual(distinctFacts([]), []); | |
| 15 | }); | |
| Merge memory from docs: only docs on how to work here, whole sentences, no near-duplicates, stale doc suggestions cleared | 16 | |
| 17 | test("near-duplicates collapse: a list that grew, a sentence cut short", () => { | |
| 18 | const facts = [ | |
| 19 | { id: "a", text: "g1t is a Cargo workspace (apps/api, crates/*, services/actions, services/billing); `cargo test` runs its tests." }, | |
| 20 | { id: "b", text: "g1t is a Cargo workspace (apps/api, crates/*, services/actions, services/billing, services/work); `cargo test` runs its tests." }, | |
| 21 | { id: "c", text: "Roles. Viewer, commenter, planner and approver map onto" }, | |
| 22 | { id: "d", text: "Roles. Viewer, commenter, planner and approver map onto the five repository roles." }, | |
| 23 | { id: "e", text: "Use npm to install." }, | |
| 24 | { id: "f", text: "Use pnpm to install." }, | |
| 25 | ]; | |
| 26 | assert.deepEqual(distinctFacts(facts).map((fact) => fact.id), ["a", "c", "e", "f"]); | |
| 27 | assert.ok(!sameFact("Run cargo test in the crate you changed.", "Run npm test in the app you changed.")); | |
| 28 | assert.ok(!sameFact("use pnpm", "use pnpm in the web app and npm in the docs, which predates it")); | |
| 29 | }); |
This file's history is long; its oldest lines are credited to the oldest commit read.