@@ -304,6 +304,85 @@ policy. Changing source refresh frequency does not change the worker tick.
304304Provider credentials, filesystem roots and public endpoints remain operator
305305configuration.
306306
307+ ## Private RFC chat and reviewed edits
308+
309+ The RFC workbench includes a collapsible right-hand Zcode Agent panel, with a
310+ full-screen panel on phones. Sections, roadmap nodes, tasks and criteria provide
311+ discussion entries using stable identifiers and original source line ranges.
312+ The same panel moves into the source editor; unsaved manual edits are included
313+ in its context and in the complete candidate reviewed before saving. Page refresh,
314+ task updates and language changes preserve the conversation and editor input.
315+ Conversations are private to the authenticated user, repository and RFC, survive
316+ sign-out and restart, and can be deleted by their owner. Readers may discuss;
317+ editing uses the existing contributor/maintainer rules.
318+
319+ Enable the isolated GLM adapter on a host with a logged-in Zcode CLI:
320+
321+ ``` json
322+ {"chat" :{"enabled" :true ,"backend" :" zcode" ,"model" :" GLM-5.3-Flash" ,"reasoning" :" low" ,"cli" :" /path/to/zcode" ,"timeout_seconds" :180 }}
323+ ```
324+
325+ ` serve ` runs two independent chat workers, separate from source reconciliation
326+ and translation. Each conversation runs one round at a time. A round makes at
327+ most four model calls within 180 seconds; model I/O never holds a database
328+ transaction. With ` serve --no-worker ` , use ` chat-worker --watch ` in a separate
329+ process, or ` chat-worker --once ` for a single cycle. Worker claims, execution
330+ leases, cancellation and authorization checks fence late or revoked results.
331+ The UI polls normalized job status once a second and displays the final reply
332+ only after validation. Recent context is bounded to 20 messages and a character
333+ budget; a truncation notice is included when history is shortened. Platform
334+ credentials and unrestricted repository tools are never given to the model.
335+
336+ The edit flow is ** chat → proposal → source and plan diff → confirm once** .
337+ The service validates raw-text replacement anchors, stable task IDs, dependencies,
338+ current permissions and source/editor versions. A proposal cannot invent merged
339+ implementation, passing evidence, acceptance or waivers. Diff text, conversation
340+ history and source Markdown are not passed through page translation. Answers use
341+ the send-time language; source edits preserve its language unless translation is
342+ explicitly requested. A changed editor or RFC requires a new proposal/review.
343+
344+ Confirmation saves the exact complete candidate, including manual edits, and
345+ creates a durable ` rfcs.update_source ` operation for an existing source. Drafts
346+ without a source remain unpublished. Task/acceptance metadata stays in the
347+ workspace; only source title/body is written upstream. The source indicator
348+ separates saved, waiting to synchronize, synchronized and source conflict.
349+ Pending or failed writeback protects the saved body from background refresh,
350+ while linked PR observations can still update. Execution rechecks permission and
351+ source version, then reads back the write; uncertain results are reconciled before
352+ retry. Provider APIs do not supply an atomic compare-and-swap guarantee. Known
353+ conflicts preserve the candidate and require a fresh review.
354+
355+ All transports use the same actions under ` /api/v1/actions/ ` : ` chat.create ` ,
356+ ` chat.list ` , ` chat.get ` , ` chat.send ` , ` chat.events ` , ` chat.cancel ` , ` chat.retry ` ,
357+ ` chat.delete ` , and ` chat.proposals.preview/apply/reject ` . Sending returns a job ID
358+ immediately. Messages and events are paginated; every read rechecks thread
359+ ownership and current RFC/source access. Audit records contain operation identity
360+ and status, never private transcript or raw model events.
361+
362+ ``` python
363+ from infermatrix_copilot.sdk.v1 import RFCClient
364+
365+ client = RFCClient.from_env()
366+ thread = client.chat_create(" RFC_ID" )[" thread" ]
367+ queued = client.chat_send(thread[" id" ], " Explain the remaining work" ,
368+ idempotency_key = " discuss-once" , language = " en" )
369+ print (client.chat_events(thread[" id" ]))
370+ # After a validated proposal exists, review it before explicit confirmation:
371+ # preview = client.chat_preview("PROPOSAL_ID")
372+ # client.chat_apply("PROPOSAL_ID", candidate_digest=preview["candidate_digest"],
373+ # reason=preview["proposal"]["reason"])
374+ ```
375+
376+ CLI and Copilot MCP use ` request chat.send --data FILE ` and
377+ ` rfc_request("chat.send", payload) ` with the host's configured user credential.
378+ They do not bypass review, authorize model tools independently, or choose another
379+ workspace when the configured remote is unavailable.
380+
381+ Before deployment, back up the installed program, operator configuration and
382+ SQLite with its backup API. Before rollback, stop all workers and inspect in-flight
383+ source operations; preserve the new chat tables and candidate bodies. Never
384+ restore an older database blindly after an upstream write.
385+
307386## SDK, MCP and remote workspaces
308387
309388``` python
0 commit comments