podojo-cli 1.36.0__tar.gz → 1.37.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/CHANGELOG.md +9 -0
  2. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/PKG-INFO +4 -2
  3. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/README.md +3 -1
  4. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/pyproject.toml +1 -1
  5. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/commands/aiinterviews.py +70 -37
  6. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/tests/test_aiinterviews.py +78 -0
  7. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/uv.lock +1 -1
  8. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/.github/workflows/publish.yml +0 -0
  9. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/.gitignore +0 -0
  10. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/CLAUDE.md +0 -0
  11. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/LICENSE +0 -0
  12. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/__init__.py +0 -0
  13. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/client.py +0 -0
  14. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/commands/__init__.py +0 -0
  15. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/commands/auth.py +0 -0
  16. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/commands/interviews.py +0 -0
  17. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/commands/projects.py +0 -0
  18. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/commands/showreel.py +0 -0
  19. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/commands/synth.py +0 -0
  20. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/commands/transcripts.py +0 -0
  21. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/commands/usertests.py +0 -0
  22. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/commands/videos.py +0 -0
  23. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/config.py +0 -0
  24. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/main.py +0 -0
  25. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/oauth.py +0 -0
  26. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/synth/__init__.py +0 -0
  27. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/synth/driver.py +0 -0
  28. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/synth/session.py +0 -0
  29. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/tables.py +0 -0
  30. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/version_check.py +0 -0
  31. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/video/__init__.py +0 -0
  32. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/src/podojo_cli/video/showreel.py +0 -0
  33. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/tests/conftest.py +0 -0
  34. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/tests/test_auth.py +0 -0
  35. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/tests/test_interviews.py +0 -0
  36. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/tests/test_projects.py +0 -0
  37. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/tests/test_showreel.py +0 -0
  38. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/tests/test_transcripts.py +0 -0
  39. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/tests/test_usertests.py +0 -0
  40. {podojo_cli-1.36.0 → podojo_cli-1.37.0}/tests/test_videos.py +0 -0
@@ -5,6 +5,15 @@ All notable changes to the Podojo CLI will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org).
7
7
 
8
+ ## [1.37.0] - 2026-12-01
9
+
10
+ ### Added
11
+ - AI interview questions can be conditional: set `show_if` on a question to have
12
+ the interviewer ask it only of participants who answered a screening question
13
+ with one of the given options, e.g. `show_if: {question: 0, options: [1, 2]}`.
14
+ At least one question must have no `show_if`. `podojo aiinterviews validate`
15
+ checks the condition and `podojo aiinterviews example` shows it.
16
+
8
17
  ## [1.36.0] - 2026-11-30
9
18
 
10
19
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: podojo-cli
3
- Version: 1.36.0
3
+ Version: 1.37.0
4
4
  Summary: CLI for the Podojo user research platform
5
5
  Project-URL: Homepage, https://github.com/podojo/cli-podojo
6
6
  Project-URL: Source, https://github.com/podojo/cli-podojo
@@ -195,7 +195,9 @@ when an earlier question was answered with specific options. Each closed
195
195
  question can also carry a `subtitle` — optional secondary text shown under the
196
196
  question on the participant's screen. One option per question can set
197
197
  `free_text: true` to act as an "Other" option: participants who pick it type
198
- their own answer, which is recorded with the session. See
198
+ their own answer, which is recorded with the session. An interview question
199
+ can carry a `show_if` as well: the interviewer then asks it only of participants
200
+ who answered a closed question with one of the given options. See
199
201
  `podojo aiinterviews example` for the exact shape.
200
202
 
201
203
  ### Synthetic participants
@@ -163,7 +163,9 @@ when an earlier question was answered with specific options. Each closed
163
163
  question can also carry a `subtitle` — optional secondary text shown under the
164
164
  question on the participant's screen. One option per question can set
165
165
  `free_text: true` to act as an "Other" option: participants who pick it type
166
- their own answer, which is recorded with the session. See
166
+ their own answer, which is recorded with the session. An interview question
167
+ can carry a `show_if` as well: the interviewer then asks it only of participants
168
+ who answered a closed question with one of the given options. See
167
169
  `podojo aiinterviews example` for the exact shape.
168
170
 
169
171
  ### Synthetic participants
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "podojo-cli"
3
- version = "1.36.0"
3
+ version = "1.37.0"
4
4
  description = "CLI for the Podojo user research platform"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -49,6 +49,12 @@ EXAMPLE_YAML = """\
49
49
  # image_file: a path to a local image (uploaded to Podojo storage on
50
50
  # create/update; relative paths resolve against this YAML
51
51
  # file's location)
52
+ # show_if (optional) ask this question only of participants who
53
+ # answered a screening question with one of the given
54
+ # options, e.g. `show_if: {question: 0, options: [1, 2]}` —
55
+ # 0-based indices into screening_questions and that
56
+ # question's options. Everyone else never hears it. At least
57
+ # one question must have no show_if.
52
58
  #
53
59
  # Each screening question (optional closed questions, answered on screen
54
60
  # before the voice interview starts; answers are recorded with the session):
@@ -187,9 +193,46 @@ questions:
187
193
  before entering your details?
188
194
  max_follow_ups: 1
189
195
  image_file: ./screenshots/checkout-page.png
196
+
197
+ # Asked only of participants who shop online at least once a month
198
+ # (screening question 0, options 2 and 3)
199
+ - section: Shopping Habits
200
+ text: >
201
+ You shop online regularly. Which store do you find easiest to check
202
+ out with, and what makes it easy?
203
+ max_follow_ups: 2
204
+ show_if:
205
+ question: 0
206
+ options: [2, 3]
190
207
  """
191
208
 
192
209
 
210
+ def _show_if_errors(label: str, show_if, screening_questions, allowed: int, target: str) -> list[str]:
211
+ """Errors for one show_if. It may point at the first `allowed` screening
212
+ questions; `target` names those in the message."""
213
+ if not isinstance(show_if, dict):
214
+ return [f"{label}: 'show_if' must be a mapping with 'question' and 'options'"]
215
+ errors = []
216
+ ref = show_if.get("question")
217
+ if isinstance(ref, bool) or not isinstance(ref, int) or not 0 <= ref < allowed:
218
+ errors.append(f"{label}: 'show_if.question' must be the 0-based index of {target}")
219
+ ref = None
220
+ ref_options = show_if.get("options")
221
+ if not isinstance(ref_options, list) or len(ref_options) == 0:
222
+ errors.append(f"{label}: 'show_if.options' must list at least one option index")
223
+ elif ref is not None:
224
+ trigger = screening_questions[ref]
225
+ trigger_options = trigger.get("options") if isinstance(trigger, dict) else None
226
+ limit = len(trigger_options) if isinstance(trigger_options, list) else 0
227
+ for index in ref_options:
228
+ if isinstance(index, bool) or not isinstance(index, int) or not 0 <= index < limit:
229
+ errors.append(
230
+ f"{label}: 'show_if.options' index {index} is out of range for "
231
+ f"screening question {ref + 1}"
232
+ )
233
+ return errors
234
+
235
+
193
236
  def validate_ai_interview_data(data: dict) -> list[str]:
194
237
  """Validate AI interview YAML data, return list of error strings."""
195
238
  errors = []
@@ -207,6 +250,9 @@ def validate_ai_interview_data(data: dict) -> list[str]:
207
250
  if follow_up_style is not None and follow_up_style not in ("guide", "participant"):
208
251
  errors.append("'follow_up_style' must be 'guide' or 'participant'")
209
252
 
253
+ screening_questions = data.get("screening_questions")
254
+ closed_questions = screening_questions if isinstance(screening_questions, list) else []
255
+
210
256
  questions = data.get("questions")
211
257
  if questions is not None:
212
258
  if not isinstance(questions, list):
@@ -214,6 +260,11 @@ def validate_ai_interview_data(data: dict) -> list[str]:
214
260
  elif len(questions) == 0:
215
261
  errors.append("'questions' must contain at least one question")
216
262
  else:
263
+ if all(isinstance(q, dict) and q.get("show_if") is not None for q in questions):
264
+ errors.append(
265
+ "At least one question must have no 'show_if', so every participant "
266
+ "is asked something"
267
+ )
217
268
  for i, question in enumerate(questions, 1):
218
269
  if not isinstance(question, dict):
219
270
  errors.append(f"Question {i}: must be a mapping with 'text'")
@@ -230,8 +281,17 @@ def validate_ai_interview_data(data: dict) -> list[str]:
230
281
  errors.append(
231
282
  f"Question {i}: 'max_follow_ups' must be an integer >= 0, got '{max_follow_ups}'"
232
283
  )
284
+ if question.get("show_if") is not None:
285
+ errors.extend(
286
+ _show_if_errors(
287
+ f"Question {i}",
288
+ question["show_if"],
289
+ closed_questions,
290
+ len(closed_questions),
291
+ "a screening question",
292
+ )
293
+ )
233
294
 
234
- screening_questions = data.get("screening_questions")
235
295
  if screening_questions is not None:
236
296
  if not isinstance(screening_questions, list):
237
297
  errors.append("'screening_questions' must be a list")
@@ -256,43 +316,16 @@ def validate_ai_interview_data(data: dict) -> list[str]:
256
316
  if not isinstance(screener, bool):
257
317
  errors.append(f"Screening question {i}: 'screener' must be true or false")
258
318
  screener = False
259
- show_if = question.get("show_if")
260
- if show_if is not None:
261
- if not isinstance(show_if, dict):
262
- errors.append(
263
- f"Screening question {i}: 'show_if' must be a mapping with "
264
- "'question' and 'options'"
319
+ if question.get("show_if") is not None:
320
+ errors.extend(
321
+ _show_if_errors(
322
+ f"Screening question {i}",
323
+ question["show_if"],
324
+ screening_questions,
325
+ i - 1,
326
+ "an earlier screening question",
265
327
  )
266
- else:
267
- ref = show_if.get("question")
268
- if isinstance(ref, bool) or not isinstance(ref, int) or not 0 <= ref < i - 1:
269
- errors.append(
270
- f"Screening question {i}: 'show_if.question' must be the 0-based "
271
- "index of an earlier screening question"
272
- )
273
- ref = None
274
- ref_options = show_if.get("options")
275
- if not isinstance(ref_options, list) or len(ref_options) == 0:
276
- errors.append(
277
- f"Screening question {i}: 'show_if.options' must list at least "
278
- "one option index"
279
- )
280
- elif ref is not None:
281
- trigger = screening_questions[ref]
282
- trigger_options = (
283
- trigger.get("options") if isinstance(trigger, dict) else None
284
- )
285
- limit = len(trigger_options) if isinstance(trigger_options, list) else 0
286
- for index in ref_options:
287
- if (
288
- isinstance(index, bool)
289
- or not isinstance(index, int)
290
- or not 0 <= index < limit
291
- ):
292
- errors.append(
293
- f"Screening question {i}: 'show_if.options' index "
294
- f"{index} is out of range for screening question {ref + 1}"
295
- )
328
+ )
296
329
  options = question.get("options")
297
330
  if not isinstance(options, list) or len(options) < 2:
298
331
  errors.append(f"Screening question {i}: 'options' must list at least 2 options")
@@ -748,6 +748,84 @@ def test_validate_show_if_needs_at_least_one_option(runner, tmp_path):
748
748
  assert "'show_if.options' must list at least" in result.output
749
749
 
750
750
 
751
+ CONDITIONAL_QUESTION_YAML = """\
752
+ interview_id: test-interview-1
753
+ title: Test AI Interview
754
+ screening_questions:
755
+ - text: How often do you shop online?
756
+ options:
757
+ - text: Rarely
758
+ - text: Monthly
759
+ - text: Weekly
760
+ questions:
761
+ - text: Walk me through your last purchase.
762
+ - text: Which store is easiest to check out with?
763
+ show_if:
764
+ question: 0
765
+ options: {options}
766
+ """
767
+
768
+
769
+ def _validate_conditional(runner, tmp_path, yaml_text):
770
+ yaml_file = tmp_path / "interview.yaml"
771
+ yaml_file.write_text(yaml_text)
772
+ return runner.invoke(app, ["aiinterviews", "validate", str(yaml_file)])
773
+
774
+
775
+ def test_validate_accepts_show_if_on_a_question(runner, tmp_path):
776
+ result = _validate_conditional(
777
+ runner, tmp_path, CONDITIONAL_QUESTION_YAML.format(options="[1, 2]")
778
+ )
779
+
780
+ assert result.exit_code == 0
781
+
782
+
783
+ def test_validate_question_show_if_option_out_of_range(runner, tmp_path):
784
+ result = _validate_conditional(
785
+ runner, tmp_path, CONDITIONAL_QUESTION_YAML.format(options="[3]")
786
+ )
787
+
788
+ assert result.exit_code == 1
789
+ assert "Question 2: 'show_if.options' index 3 is out of range" in result.output
790
+
791
+
792
+ def test_validate_question_show_if_needs_an_existing_screening_question(runner, tmp_path):
793
+ result = _validate_conditional(
794
+ runner,
795
+ tmp_path,
796
+ CONDITIONAL_QUESTION_YAML.format(options="[0]").replace("question: 0", "question: 1"),
797
+ )
798
+
799
+ assert result.exit_code == 1
800
+ assert "Question 2: 'show_if.question' must be the 0-based index of a screening" in result.output
801
+
802
+
803
+ def test_validate_question_show_if_without_screening_questions(runner, tmp_path):
804
+ result = _validate_conditional(
805
+ runner,
806
+ tmp_path,
807
+ VALID_AI_INTERVIEW_YAML + " show_if:\n question: 0\n options: [0]\n",
808
+ )
809
+
810
+ assert result.exit_code == 1
811
+ assert "Question 2: 'show_if.question' must be the 0-based index of a screening" in result.output
812
+
813
+
814
+ def test_validate_needs_one_question_without_show_if(runner, tmp_path):
815
+ result = _validate_conditional(
816
+ runner,
817
+ tmp_path,
818
+ CONDITIONAL_QUESTION_YAML.format(options="[1]").replace(
819
+ " - text: Walk me through your last purchase.\n",
820
+ " - text: Walk me through your last purchase.\n"
821
+ " show_if:\n question: 0\n options: [0]\n",
822
+ ),
823
+ )
824
+
825
+ assert result.exit_code == 1
826
+ assert "At least one question must have no 'show_if'" in result.output
827
+
828
+
751
829
  def test_validate_screening_multi_select_must_be_bool(runner, tmp_path):
752
830
  yaml_file = tmp_path / "interview.yaml"
753
831
  yaml_file.write_text(
@@ -438,7 +438,7 @@ wheels = [
438
438
 
439
439
  [[package]]
440
440
  name = "podojo-cli"
441
- version = "1.36.0"
441
+ version = "1.37.0"
442
442
  source = { editable = "." }
443
443
  dependencies = [
444
444
  { name = "httpx" },
File without changes
File without changes
File without changes