ADR-253: Add ReviewComment/ReviewThread dataclasses, extend PipelineContext, add parse_json_list_output - #5
Merged
jodavis merged 6 commits intoJun 3, 2026
Conversation
…ontext, add parse_json_list_output - Add ReviewComment and ReviewThread dataclasses - Add PipelineContext fields: review_threads, first_push_done, base_branch - Remove pr_url from PipelineContext (moves to sidecar; ADR-254 fixes step references) - save(): first_push_done as lowercase true/false; review_threads as camelCase JSON unconditionally; review_notes unconditionally - load(): deserialise all new fields; review_threads camelCase→snake_case - Add parse_json_list_output(): fenced blocks first, then bare lines, returns [] on failure - main(): compute base_branch via git before pipeline run, guarded against recomputation on resume - Add test_dev_team.py with 34 unit tests covering all round-trips and edge cases - Update validate-tests.cmd/.sh to invoke pytest Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
%~dp0 / SCRIPT_DIR resolves to scripts/ (repo root), but test_dev_team.py lives in plugins/dev-team/scripts/. Point both the PYTHONPATH and the pytest target at the correct plugin subdirectory. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jodavis-claude
commented
Jun 3, 2026
jodavis-claude
left a comment
Collaborator
Author
There was a problem hiding this comment.
ADR-253 Review
Overall the implementation is clean and matches the spec. One correctness gap in the load() exception handler, noted below.
Exit criteria verified:
- ✅
ReviewCommentandReviewThreaddataclasses with correct fields - ✅
review_threadsserialises/deserialises via<!-- section:Review Threads -->as camelCase JSON - ✅
first_push_doneserialises to/from frontmatter as lowercasetrue/false - ✅
pr_urlremoved fromPipelineContext;pr_detailswas already absent (no action needed) - ✅
base_branchpopulated inmain()with guard (if not ctx.base_branch:), correct tie-break (main wins), andctx.save()called immediately after - ✅
parse_json_list_output()tries fenced blocks first, then bare lines, returns[]on failure - ✅ Tests cover round-trips, camelCase serialisation, and
parse_json_list_outputedge cases - ✅ Validate scripts correctly moved to
scripts/(whererun_validate_scriptalready looks)
If the Review Threads section contained valid JSON that was not a list (null, string, dict — e.g. from file corruption), json.loads would succeed but `for t in threads_data` would raise TypeError, crashing load() on pipeline resume. Added TypeError to the except tuple and a test covering null, dict, and string cases.
jodavis
marked this pull request as ready for review
June 3, 2026 07:02
jodavis-claude
commented
Jun 3, 2026
jodavis-claude
left a comment
Collaborator
Author
There was a problem hiding this comment.
Sign-off Review — ADR-253
Sign-off result: Approved
Prior review thread
- [P1 — Correctness] Missing
TypeErrorinreview_threadsexception handler — Resolved. The developer addedTypeErrorto theexcepttuple on line 294 and added three test cases coveringnull,dict, andstringJSON values. All three cases now produce[]as expected. Thread is resolved on GitHub.
Files scanned (modified since first review)
plugins/dev-team/scripts/dev_team.py— single-line fix, correctplugins/dev-team/scripts/test_dev_team.py— one new test added, all 35 tests passscripts/validate-tests.cmd,scripts/validate-tests.sh— path fix is correct; local copies underplugins/dev-team/scripts/correctly removed to avoid duplication_spec_DevTeamPortability.md— minor wording update only, no logic impact
No new issues found
All exit criteria are met:
ReviewComment/ReviewThreaddataclasses present with correct fieldsreview_threadsserialises as camelCase JSON under<!-- section:Review Threads -->(unconditionally, even when empty)first_push_doneserialises as lowercasetrue/falsein frontmatterpr_urlandpr_detailsabsent fromPipelineContextbase_branchcomputed inmain()with guard and saved beforeDevTeamPipeline.run()parse_json_list_output()exists, fenced-block-first, returns[]on failure- 35/35 unit tests pass
jodavis
requested changes
Jun 3, 2026
jodavis
approved these changes
Jun 3, 2026
jodavis
deleted the
dev/claude/ADR-253-add-reviewcomment-reviewthread-datacl
branch
June 3, 2026 18:46
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.
Work item: ADR-253
Add the pure data-model and serialization layer that the subsequent pipeline-step changes in ADR-254 depend on:
ReviewComment/ReviewThreaddataclasses,PipelineContextfield changes (review_threads,first_push_done,base_branch; removal ofpr_url),base_branchcomputation inmain(), and theparse_json_list_output()helper.Changes
plugins/dev-team/scripts/dev_team.py— AddedReviewCommentandReviewThreaddataclasses; addedreview_threads,first_push_done,base_branchfields toPipelineContext; removedpr_url; updatedsave()/load()for all new/removed fields; addedparse_json_list_output(); addedbase_branchcomputation block with guard inmain()plugins/dev-team/scripts/test_dev_team.py— New file; 34 unit tests covering all exit criteria (dataclass fields, serialization round-trips, camelCase JSON wire format,parse_json_list_output()edge cases)plugins/dev-team/scripts/validate-tests.cmd— Updated from no-op stub to invoke pytest withPYTHONPATHpointing at the scripts directoryplugins/dev-team/scripts/validate-tests.sh— Same update for Linux/macOSDesign decisions
review_threadssection is written unconditionally even when the list is empty ([]), to avoid stale values on resume — same rationale applied toreview_notesbase_branch"prefer main on tie" is implemented by initialisingbest_candidate = "main"and only updating on strictcount < best_count, somainwins ties without extra logicpr_detailsremoval was a no-op — confirmed absent from the current file (never ported from AdaptiveRemote or removed in ADR-265)pr_urlintentionally leaves brokenctx.pr_urlreferences inReviewStep,SignoffStep, andFixPrStep; ADR-254 fixes those step classesparse_json_list_output()tries fenced code blocks first (from the end), then bare lines — the reverse ofparse_json_output(), per spec intent