Drop "prototype/carryover" framing now that v1 is shipped

SPEC, DEV docs, and code comments still talked about the codebase as
a rewrite-in-progress against an external prototype. With v1 shipped
the framing reads oddly — it implies code is provisional when it's
the production thing. Recast §18 as "the technical stack," strip
"carryover from the prototype" comments across backend (api.py,
chat.py, providers.py) and frontend (DiffView, PromptBar,
SelectionTooltip, modelStyles), and rework SPEC §1 / §18 to introduce
OHM up front rather than as a follow-on to a prototype reference.

Also:
- RUNBOOK: bump Python prereq to 3.11+ to match the production VM
  (was 3.13).
- Remove IMPLEMENTATION-PROMPT.md — the original implementation brief
  is no longer load-bearing.
- Add deploy/DEPLOY-NEW-SESSION-PROMPT.md as the durable
  deploy-handoff prompt for new sessions.
This commit is contained in:
Ben Stull
2026-05-25 10:32:46 -07:00
parent 7c3b8fc133
commit ee6e3491e7
12 changed files with 411 additions and 155 deletions
+11 -14
View File
@@ -1,12 +1,11 @@
"""SSE-streaming chat layer — §18 carryover, adapted to the §5 schema.
"""SSE-streaming chat layer — §18 stack, applied to the §5 schema.
The prototype kept conversation state in an in-memory `RFCChat`
keyed by a session_id. Here, history is the durable list of
`thread_messages` rows on a `threads` row, scoped to one branch (or
to a sub-thread anchored to a range or paragraph within it). The
streaming response is parsed for `<change>` blocks per §18; each
`<change>` becomes a `changes` row with `state='pending'` per §8.14
the moment it is parsed, regardless of mode.
Conversation history is the durable list of `thread_messages` rows on
a `threads` row, scoped to one branch (or to a sub-thread anchored to
a range or paragraph within it). The streaming response is parsed for
`<change>` blocks per §18; each `<change>` becomes a `changes` row
with `state='pending'` per §8.14 the moment it is parsed, regardless
of mode.
This module exposes two seams:
- `build_history` and `build_system_prompt` — pure functions a caller
@@ -35,9 +34,8 @@ from .providers import BaseProvider
log = logging.getLogger(__name__)
# The §18 system prompt, adapted from the prototype. The prototype's
# version assumed one RFC document loaded as context; here the document
# is the branch's RFC.md at its current tip. The selection-quote shape
# The §18 system prompt. The document loaded as context is the
# branch's RFC.md at its current tip. The selection-quote shape
# (§8.12) is wired by the caller into the user message text — not the
# system prompt — so the model sees it as part of the turn.
SYSTEM_PROMPT = """You are a participant in the Wiggleverse RFC framework — a standardization process for natural-language vocabulary that humans and machines need to share. You are collaborating with a human contributor on the RFC titled "{title}".
@@ -316,9 +314,8 @@ async def stream_assistant_turn(
Provider streaming is synchronous (an `Iterator[str]`) per §18; we
drain it eagerly into chunks and yield them as async strings. This
is sufficient at single-process scale (§4.2) and the streaming
impl is what the prototype shipped — re-wrapping it in a worker
thread for a future deployment shape is a one-liner if it
is sufficient at single-process scale (§4.2); re-wrapping it in a
worker thread for a future deployment shape is a one-liner if it
matters.
"""
full_text_chunks: list[str] = []