Skip to content

research_workflow_items: validate package.json manifest shape in ids (#6856) - #7007

Merged
dezren39 merged 1 commit into
mainfrom
queue/11083-6856-manifest-shape
Nov 8, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/11083-6856-manifest-shape

Conversation

@developing-today

@developing-today developing-today Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #6856 (task 11083).

list_ids in scripts/research_workflow_items.py read the package's package.json manifest shape-trusted: json.loads(...).get("segments", []) projected with [s["id"] for s in segments]. A wrong-shape or non-JSON manifest surfaced as a bare Attribute/Key/Type/JSONDecode error naming no file or field.

Change

  • New manifest_segments() helper validates the manifest before use: top level must be a JSON object; segments (when present) must be a list of objects each with a string id; a non-JSON manifest fails the same way. Every violation goes through the tool's fail() diagnostic naming package.json and the field/expectation.
  • Well-formed manifests — including a missing package.json and a manifest without segments — behave exactly as before.

Tests

  • New test_ids_validates_the_package_manifest_shape in scripts/tests/test_research_workflow_items.py: controls (well-formed segments listed; {} → no segments) plus eight wrong shapes (list/string top level, segments as string/object, segment as string, segment missing id, non-string id, non-JSON) asserting the single-line error contract names package.json.
  • Laptop: python3 -m unittest scripts.tests.test_research_workflow_items — 17 tests OK; scripts.tests.test_research_workflow — 59 tests OK.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@developing-today
developing-today Bot requested review from a team and dezren39 as code owners November 8, 2026 00:51
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2ab7a9ae-ec65-4fee-95e7-a48b7d397a5e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant