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:
+1
-2
@@ -94,8 +94,7 @@ def make_router(
|
||||
return {"body": payload["body"]}
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
# Auth surface — extends the prototype's pattern but reads role
|
||||
# from our users table per §6.
|
||||
# Auth surface — reads role from our users table per §6.
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
@router.get("/api/auth/me")
|
||||
|
||||
+11
-14
@@ -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] = []
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"""Multi-provider LLM abstraction — §18 carryover from the prototype.
|
||||
"""Multi-provider LLM abstraction — §18 stack.
|
||||
|
||||
Each provider speaks a common interface — `send` and `send_streaming` —
|
||||
so the chat layer in `chat.py` is provider-agnostic. Enabled providers
|
||||
and their API keys are configured via env per the prototype's
|
||||
`ENABLED_MODELS` contract; per §16 / §19.2, per-RFC model availability
|
||||
and credential delegation are deferred until the topic is settled.
|
||||
and their API keys are configured via env via the `ENABLED_MODELS`
|
||||
contract; per §16 / §19.2, per-RFC model availability and credential
|
||||
delegation are deferred until the topic is settled.
|
||||
"""
|
||||
from __future__ import annotations
|
||||
|
||||
@@ -130,7 +130,7 @@ class OpenAIProvider(BaseProvider):
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Variants and factory — preserved from the prototype to keep the contract.
|
||||
# Variants and factory.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
_CLAUDE_VARIANTS: dict[str, tuple[str, str]] = {
|
||||
@@ -149,7 +149,7 @@ _GEMINI_VARIANTS: dict[str, tuple[str, str]] = {
|
||||
|
||||
|
||||
def load_providers(env: dict) -> dict[str, BaseProvider]:
|
||||
"""Instantiate enabled providers from env — same contract as the prototype."""
|
||||
"""Instantiate enabled providers from env."""
|
||||
enabled = [m.strip() for m in env.get("ENABLED_MODELS", "claude").split(",") if m.strip()]
|
||||
providers: dict[str, BaseProvider] = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user