Repository navigation
fix(tasks): a question named like a task's expanded question is refused - #59
Merged
Merged
Conversation
In a request with task questions, a decision question named <task>::<part> took the place of the task's own expanded question: the task read its answer and the question's answer was dropped. Every name with :: is now refused there (HTTP 422), as task names already were.
Reviewer's GuideThe PR closes a task-expansion name collision by reserving Sequence diagram for task question name collision validationsequenceDiagram
participant Client
participant reads_request
participant tasks_expand
participant HTTP
Client->>reads_request: submit request
reads_request->>tasks_expand: expand(body)
tasks_expand->>tasks_expand: inspect question names
alt task question present and name contains ::
tasks_expand-->>reads_request: raise ValueError
reads_request-->>HTTP: HTTP 422
HTTP-->>Client: question name may not contain ::
else no task question
tasks_expand-->>reads_request: keep questions unchanged
reads_request-->>Client: answer request
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Owner
|
Thank you, Dariusz! Merged into the basal 2.5 release branch with your commit as you wrote it. The full CPU suite and your tests pass, and every answer to our identity and router request sets is byte-identical to the branch before the merge. The PR will close when 2.5 is published on main. |
rkinas
added a commit
that referenced
this pull request
Nov 2, 2026
… version CONTRIBUTING.md credits the 2.5 pull requests as the release notes' community line lists them (Paweł Kiszczak #52, #62, #64, #66, #68, #71, #73, #75; Marcin Brzeżański #56; Grzegorz Brzezinka #76, #78) and adds Dariusz Koryto (#53, #58, #59, #60 and #55); the README's list names him too. docs/changes/README.md and the changelog.py help use 2.5.1, the next release, as the example.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A task question is expanded into decision questions named
<task>::<part>(tasks.SEP).tasks.expandrefuses::in a task question's name, but not in a decision question's, so a decision question can carry the name of a task's expanded question. Onmain, throughhttp_app:{"state": "Invoice 1240 PLN.", "questions": { "task": {"type": "classify", "labels": {"invoice": "an invoice", "letter": "a letter"}}, "task::labels": {"type": "choice", "instructions": "Which colour?", "criteria": {"red": "Red", "blue": "Blue"}}}}answers 200 with
{"task": {"type": "classify", "label": "red", ...}}: the classification is the colour question's answer, andtask::labelshas no answer at all. Found by Sourcery in its review of #58; it is in the server, not the client (a plain HTTP request does the same).Change
tasks.expand: in a request with task questions, any question name containing::is refused (HTTP 422, throughreads_request), with the message saying why. Requests without task questions are not expanded and keep accepting::in names.tests/test_tasks.py: the colliding request is refused; a::name without task questions is still answered.Validation
question 'task::labels': in a request with task questions, a question's name may not contain '::'.Summary by Sourcery
Prevent task-expanded question name collisions by reserving
::in requests that contain task questions.Bug Fixes:
::whenever a request includes task questions, preventing decision questions from colliding with task-expanded questions and receiving incorrect answers.Documentation:
::naming rule for requests containing task questions and record the fix in the changelog.Tests:
::support when no task questions are present.