Finish Phase 22: the half of Petal that works with the tunnel down

Grammar lite, the false-friend list, the daily invitation and the offline
miscollocations — the four remaining §5–§6 items, all client-side and all
alive on a box that cannot reach the model.

The offline collocations forced a schema change. `type` had been doubling
as the answer to "which engine found this" — `mechanics` meant offline —
and that stops being true the moment an offline rule proposes a
collocation. Migration 0013 adds `source` (llm | local) and every pass now
scopes its DELETE by engine; without it the coach silently wiped every
offline chunk on the page. Existing rows backfill by type, so a pre-0013
collocation row is claimed as the coach's, which it was: the offline list
did not exist yet.

The rule pack is hand-curated rather than mined, and the entries left out
are the point — `married with` is wrong until "married with children",
`arrive to` wants at or in depending on the noun. A pack running on every
keystroke must not correct correct writing.

Claude-Session: https://claude.ai/code/session_016y6gyuHkQXPiEuW8RGQyua
This commit is contained in:
prosolis
2026-07-27 15:05:55 -07:00
parent e9b8595456
commit 1bbc8fc8d3
20 changed files with 1678 additions and 50 deletions
+10 -2
View File
@@ -157,6 +157,10 @@ export interface Suggestion {
explanation: string
type: SuggestionType
status: 'pending' | 'accepted' | 'rejected'
// Which engine proposed it — the offline rule pack or the model. The rail
// deliberately renders both identically; this is here because the wire format
// carries it, not because the writer is ever shown it.
source?: 'llm' | 'local'
created_at: string
}
@@ -174,14 +178,18 @@ export interface GrowthJournal {
}
// A deterministic, rule-based fix detected client-side (see Companion/prose.ts).
// The frontend owns mechanics detection; the backend only persists these as the
// 'mechanics' suggestion family. Spans are exact plaintext offsets.
// The frontend owns offline detection; the backend only persists these. Spans
// are exact plaintext offsets. `type` names the family the finding belongs to:
// 'mechanics' for a fix to this sentence, 'collocation' for the miscollocation
// rules, whose findings are chunks worth keeping and are filed — and planted in
// the garden on accept — exactly like the LLM coach's.
export interface MechanicsFinding {
from: number
to: number
original: string
replacement: string
explanation: string
type: 'mechanics' | 'collocation'
}
// One dictionary's worth of personal words — the ones she's excused from