Skip to content

Answer the decision with Druks gate controls - #8

Merged
czpython merged 1 commit into
commonzenpython/adopt-druks-model-surfacefrom
commonzenpython/answer-decisions-with-gate-controls
Sep 27, 2026
Merged

czpython merged 1 commit into
commonzenpython/adopt-druks-model-surfacefrom
commonzenpython/answer-decisions-with-gate-controls

Conversation

@czpython

Copy link
Copy Markdown
Owner

Stacked on #7. Merge that first, then retarget this PR to main.

Summary

The decision page drew its own outcome form: an app-owned ui.Form that posted to Panel's record_outcome route, which called RecordDecision.answer(). Druks now draws the controls for a subject's parked gate from the gate itself (czpython/druks#744). Panel asks for the call in-app and shows ui.GateControls(decision).

  • Workflow: RecordDecision parks with {"presentation": "in_app", "label": "Record the decision"}. Druks offers the three DecisionAction values as controls. It shows a note box because the gate declares note. The ask also shows the run's latest artifact, which is the moderator's "Panel synthesis".
  • Page: "The call" shows ui.GateControls(decision) until an outcome is recorded. The controls show nothing while the run is not parked. The page no longer reads the run status.
  • Routes: the record_outcome route and DecisionOutcomeRequest are deleted. The answer reaches the workflow through the Druks gate route (POST /api/gates/{run}/answer), which holds the control to the offered values.

The Dashboard still sends the operator to the decision page: for an in-app ask, it opens the subject's page. The Druks subject page also shows the same controls.

Trade-offs

  • The buttons show the raw values proceed, revise, and pass. The Druks shell has labels only for its own controls.
  • Panel's form wording goes: the "Outcome" label and the "What the record must say about this call." hint. The Druks note box says a note is "sent to the agent as feedback". Here, the note is recorded with the outcome.
  • The note loses Panel's 2,000-character limit and whitespace stripping.

Verification

Ran in a fresh environment with editable installs of Druks main (beed0baa) and this branch:

  • ruff check, ruff format --check, pyright, and druks check-app panel: clean
  • A throwaway check with the Druks pytest plugin (not committed, because this repo has no tests) seeded a run parked on record_decision with the ask Druks builds from Panel's in-app request. It covered these cases:
    • the decision page serves gate_controls for the decision. Its status is empty before the park and parked on record_decision after it.
    • GET /api/gates/{run} returns the label, controls: ["proceed", "revise", "pass"], and reply_fields: ["action", "note"]
    • the gate route refuses maybe with INVALID_GATE_ANSWER
    • an answer of revise with a note sends a payload on the record_decision topic that validates as a RecordDecision reply
    • POST /api/panel/decisions/{id}/outcome no longer exists
  • Not run: a full deliberation against a live durable engine and model provider. The resume itself is the Druks gate path, which Panel's route also used.

The decision page drew its own outcome form and posted it to Panel's
record_outcome route, which answered the RecordDecision gate. Druks now
draws the controls for a subject's parked gate from the gate itself, so
Panel asks for the call in-app and shows ui.GateControls.

- RecordDecision parks with an in_app ask. Druks offers the three
  DecisionAction values as controls and a note box, because the gate
  declares both. The ask shows the run's latest artifact, the moderator's
  synthesis.
- The decision page shows ui.GateControls(decision) in "The call" until
  an outcome is recorded. The page no longer reads the run status.
- The record_outcome route and DecisionOutcomeRequest go. The operator's
  answer reaches the workflow through the Druks gate route.
@czpython
czpython merged commit 75949ea into commonzenpython/adopt-druks-model-surface Sep 27, 2026
@czpython
czpython deleted the commonzenpython/answer-decisions-with-gate-controls branch September 27, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant