Skip to content

Add debug mode support to test and spec schemas#132

Open
Copilot wants to merge 3 commits intomainfrom
copilot/fix-131
Open

Add debug mode support to test and spec schemas#132
Copilot wants to merge 3 commits intomainfrom
copilot/fix-131

Conversation

Copy link
Contributor

Copilot AI commented Aug 9, 2025

This PR extends Doc Detective's debug mode functionality by adding debug configuration support at the test and specification levels, completing the debug mode hierarchy.

What's New

Test-Level Debug Control

Tests can now override debug settings from config and spec levels:

{
  "testId": "critical-test",
  "debug": "stepThrough",
  "steps": [
    {
      "checkLink": "https://api.example.com",
      "breakpoint": true
    }
  ]
}

Specification-Level Debug Control

Specifications can override global config debug settings:

{
  "specId": "api-tests",
  "debug": true,
  "tests": [...]
}

Debug Mode Hierarchy

The complete debug configuration hierarchy is now:

  1. Config level - Global default (config.debug)
  2. Spec level - Overrides config (spec.debug)
  3. Test level - Overrides spec/config (test.debug)
  4. Step level - Individual breakpoints (step.breakpoint)

Supported Values

All debug properties support:

  • false - Disable debugging (default)
  • true - Enable debugging with breakpoint support
  • "stepThrough" - Pause at every step waiting for user input

Validation

  • Added comprehensive schema validation for all debug configurations
  • Added 6 new examples demonstrating debug usage patterns
  • All existing tests continue to pass (269 total)
  • Invalid debug values are properly rejected

This provides users with granular control over debugging behavior, allowing them to enable debug mode globally while selectively disabling it for specific specs or tests, or vice versa.

Fixes #131.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Summary by CodeRabbit

  • New Features
    • Added a new optional "debug" setting at both the specification and test levels, allowing users to enable debugging modes: standard debug (true), step-through debugging ("stepThrough"), or disable debugging (false).
    • The "debug" setting provides granular control, overriding higher-level debug configurations.
    • Updated example specifications and tests to demonstrate the new debug options.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Co-authored-by: hawkeyexl <5209367+hawkeyexl@users.noreply.github.com>
Copilot AI changed the title [WIP] Debug mode Add debug mode support to test and spec schemas Aug 9, 2025
Copilot AI requested a review from hawkeyexl August 9, 2025 15:19
@hawkeyexl
Copy link
Contributor

@copilot also add breakpoint support for steps per the PRD.

Co-authored-by: hawkeyexl <5209367+hawkeyexl@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Aug 9, 2025

@copilot also add breakpoint support for steps per the PRD.

Added an example demonstrating step breakpoint support in combination with test-level debug mode. The step schema already includes the breakpoint property that allows individual steps to act as breakpoints when debugging is enabled. Commit d04346a adds the specific example from the PR description showing how to use debug: "stepThrough" at the test level with breakpoint: true on individual steps.

@hawkeyexl hawkeyexl marked this pull request as ready for review August 9, 2025 17:33
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 9, 2025

Walkthrough

A new optional "debug" property has been added to several JSON schemas at both the specification and test levels. This property allows boolean values or the string "stepThrough" to control debugging behavior. Multiple example objects demonstrating the use of the new property have also been added across the schemas.

Changes

Cohort / File(s) Change Summary
Add "debug" property to all relevant schemas
src/schemas/output_schemas/report_v3.schema.json, src/schemas/output_schemas/resolvedTests_v3.schema.json, src/schemas/output_schemas/spec_v3.schema.json, src/schemas/output_schemas/test_v3.schema.json, src/schemas/schemas.json, src/schemas/src_schemas/spec_v3.schema.json, src/schemas/src_schemas/test_v3.schema.json
Added optional "debug" property (boolean or "stepThrough") at specification and test levels; updated descriptions; included multiple example objects demonstrating the new property. No breaking changes.

Sequence Diagram(s)

sequenceDiagram
    participant Config
    participant Spec
    participant Test

    Config->>Spec: Pass debug setting (optional)
    Spec->>Test: Pass debug setting (optional, can override)
    Test->>Test: Use own debug property if present, else inherit from Spec, else Config
    Test-->>User: Pause for input if debug=true or debug="stepThrough"
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Assessment against linked issues

Objective (Issue #) Addressed Explanation
Add "debug" property to schemas (#131)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Possibly related issues

  • Debug mode .github#52: This PR implements the schema-level "debug" property and example objects, which directly addresses the schema update portion of the comprehensive debug mode described in this issue.

Poem

In the warren of code where the schemas reside,
A debug flag now hops in, with options to guide.
StepThrough or pause, or just run with glee,
Each test and spec now hops as free as can be!
🐇✨

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch copilot/fix-131

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@hawkeyexl
Copy link
Contributor

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 9, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@promptless
Copy link

promptless bot commented Aug 9, 2025

📝 Documentation updates detected!

New suggestion: Document debug mode support for tests and specifications

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (10)
src/schemas/schemas.json (10)

36365-36378: Duplicate of earlier spec-level debug schema — apply same default/oneOf/$defs suggestions

Same changes as Lines 24892-24905.


36980-36993: Duplicate of earlier test-level debug schema — apply same default/oneOf/$defs suggestions

Same changes as Lines 25507-25520.


46752-46797: Duplicate examples — consider adding the override scenarios here too

Replicate any new override examples consistently.


46964-47010: Duplicate spec-level examples — consider adding the override scenario here too

Replicate the spec-true/test-false example for consistency.


48621-48634: Duplicate of earlier spec-level debug schema — apply same default/oneOf/$defs suggestions

Same changes as Lines 24892-24905.


49236-49249: Duplicate of earlier test-level debug schema — apply same default/oneOf/$defs suggestions

Same changes as Lines 25507-25520.


59008-59053: Duplicate examples — ensure override and breakpoint-behavior examples are mirrored

Replicate any added override examples consistently.


59220-59266: Duplicate spec-level examples — mirror the override scenario

Maintain consistency across example blocks.


64441-64454: Duplicate of earlier test-level debug schema — apply same default/oneOf/$defs suggestions

Same changes as Lines 25507-25520.


74213-74258: Duplicate examples — mirror any added override and breakpoint-behavior examples

Keep examples consistent across sections.

🧹 Nitpick comments (15)
src/schemas/src_schemas/spec_v3.schema.json (1)

38-49: Clarify precedence and add an explicit default for debug

  • Clarify that spec-level debug can be overridden by test-level debug.
  • Set an explicit default to encode the “false by default” behavior.
     "debug": {
-      "description": "Enable debugging mode for this specification. Overrides the debug setting from config level. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this specification.",
+      "description": "Enable debugging mode for this specification. Overrides the debug setting from config level and can be overridden by the test-level debug setting. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this specification.",
+      "default": false,
       "anyOf": [
         {
           "type": "boolean"
         },
         {
           "type": "string",
           "enum": ["stepThrough"]
         }
       ]
     },
src/schemas/src_schemas/test_v3.schema.json (1)

46-57: Add explicit default and keep precedence wording tight

  • Add a default to encode “false by default”.
  • Wording tweak to mirror the hierarchy: test overrides spec and config.
     "debug": {
-      "description": "Enable debugging mode for this test. Overrides the debug setting from config and spec levels. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this test.",
+      "description": "Enable debugging mode for this test. Overrides the debug setting from spec and config levels. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this test.",
+      "default": false,
       "anyOf": [
         {
           "type": "boolean"
         },
         {
           "type": "string",
           "enum": ["stepThrough"]
         }
       ]
     },

Optional follow-up: To avoid duplication across schemas, consider defining a shared #/components/schemas/debug in a common schema and referencing it here and in spec_v3.schema.json.

src/schemas/output_schemas/test_v3.schema.json (2)

596-609: Optional: use oneOf instead of anyOf for mutually exclusive branches.

Boolean and "stepThrough" are disjoint; oneOf can yield clearer validation errors. If you prefer to keep consistency with existing anyOf usage across schemas, feel free to skip.

-      "anyOf": [
+      "oneOf": [
         {
           "type": "boolean"
         },
         {
           "type": "string",
           "enum": [
             "stepThrough"
           ]
         }
       ]

10367-10413: Examples cover all modes; consider adding a "breakpoint ignored when debug=false" case.

To make override behavior explicit for users, add an example where debug is false but a step has breakpoint: true (no pause should occur).

       "debug": "stepThrough",
       "steps": [
         {
           "checkLink": "https://api.example.com",
           "breakpoint": true
         }
       ]
     },
+    {
+      "testId": "debug-test-ignored-breakpoint",
+      "description": "Even with a step breakpoint, debug=false means no pause",
+      "debug": false,
+      "steps": [
+        {
+          "goTo": "https://www.example.com",
+          "breakpoint": true
+        }
+      ]
+    }
src/schemas/output_schemas/resolvedTests_v3.schema.json (3)

11423-11436: Add an explicit default and consider centralizing the type.

  • Add "default": false to reflect the documented default behavior and help tooling that honors schema defaults.
  • Optional: extract this union type into $defs (e.g., "#/$defs/DebugSetting") and $ref it here and at other occurrences to avoid divergence.

Apply within this hunk:

               "debug": {
                 "description": "Enable debugging mode for this specification. Overrides the debug setting from config level. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this specification.",
                 "anyOf": [
                   {
                     "type": "boolean"
                   },
                   {
                     "type": "string",
                     "enum": [
                       "stepThrough"
                     ]
                   }
-                ]
+                ],
+                "default": false
               },

If you centralize the type, define once:

"$defs": {
  "DebugSetting": {
    "anyOf": [
      { "type": "boolean" },
      { "type": "string", "enum": ["stepThrough"] }
    ],
    "default": false
  }
}

Then replace the inline definition with: { "$ref": "#/$defs/DebugSetting", "description": "..." }.


12038-12051: Mirror default and reuse the shared definition at test level.

  • Add "default": false here as well for consistency with the stated default.
  • If you extract a shared "#/$defs/DebugSetting", $ref it here to eliminate duplication.

Apply within this hunk:

                         "debug": {
                           "description": "Enable debugging mode for this test. Overrides the debug setting from config and spec levels. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this test.",
                           "anyOf": [
                             {
                               "type": "boolean"
                             },
                             {
                               "type": "string",
                               "enum": [
                                 "stepThrough"
                               ]
                             }
-                          ]
+                          ],
+                          "default": false
                         },

22022-22068: Spec-level examples look good; consider adding an override interplay example.

  • Optional: include one spec example where a nested test overrides the spec-level debug (e.g., spec debug: true, one test debug: false) to demonstrate precedence.
  • If your convention is to include $schema in example objects for linting (as used elsewhere in this repo), consider adding it here too.
src/schemas/output_schemas/report_v3.schema.json (3)

614-627: Spec-level debug schema looks correct; consider default and examples for clarity

The anyOf(Boolean | "stepThrough") is right and matches the PR semantics. Two small improvements:

  • Add a default false to document the implicit default.
  • Add examples to aid tooling and docs.

Apply:

   "debug": {
-    "description": "Enable debugging mode for this specification. Overrides the debug setting from config level. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this specification.",
+    "description": "Enable debugging mode for this specification. Overrides the debug setting from config level. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this specification.",
+    "default": false,
     "anyOf": [
       {
         "type": "boolean"
       },
       {
         "type": "string",
         "enum": [
           "stepThrough"
         ]
       }
-    ]
+    ],
+    "examples": [false, true, "stepThrough"]
   },

1229-1242: Test-level debug schema is on point; mirror spec improvements

Same suggestion here to document the implicit default and provide examples for consistency with spec-level.

   "debug": {
-    "description": "Enable debugging mode for this test. Overrides the debug setting from config and spec levels. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this test.",
+    "description": "Enable debugging mode for this test. Overrides the debug setting from config and spec levels. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this test.",
+    "default": false,
     "anyOf": [
       {
         "type": "boolean"
       },
       {
         "type": "string",
         "enum": [
           "stepThrough"
         ]
       }
-    ]
+    ],
+    "examples": [false, true, "stepThrough"]
   },

11212-11226: Spec-level debug examples are solid; add one to show test-level override precedence

To illustrate the hierarchy (spec → test), add an example where a spec sets debug true but a nested test overrides it to false. This will make the precedence explicit.

Add alongside the other spec examples:

{
  "specId": "debug-spec-with-override",
  "description": "Spec debug enabled; nested test overrides to disable",
  "debug": true,
  "tests": [
    {
      "debug": false,
      "steps": [
        { "checkLink": "https://www.google.com" }
      ]
    }
  ]
}

Also applies to: 11228-11245, 11247-11259

src/schemas/output_schemas/spec_v3.schema.json (4)

596-609: Spec-level debug: add an explicit default and tighten the schema

Looks good. Two small tweaks to match the documented default and avoid ambiguity:

  • Add default: false.
  • Optionally switch anyOf → oneOf (no overlap anyway).

Apply:

     "debug": {
       "description": "Enable debugging mode for this specification. Overrides the debug setting from config level. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this specification.",
-      "anyOf": [
+      "default": false,
+      "oneOf": [
         {
           "type": "boolean"
         },
         {
           "type": "string",
           "enum": [
             "stepThrough"
           ]
         }
       ]
     },

1211-1224: Test-level debug: mirror the default and (optionally) oneOf

Same suggestion here to align with the described default and make the validation intent explicit.

       "debug": {
         "description": "Enable debugging mode for this test. Overrides the debug setting from config and spec levels. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this test.",
-        "anyOf": [
+        "default": false,
+        "oneOf": [
           {
             "type": "boolean"
           },
           {
             "type": "string",
             "enum": [
               "stepThrough"
             ]
           }
         ]
       },

10822-11028: Examples (test-level debug): add one example highlighting breakpoint vs stepThrough

The new examples are clear. To illustrate breakpoint behavior when debug=true (contrasted with stepThrough), consider toggling a breakpoint in the basic case.

       {
         "testId": "debug-test-basic",
         "description": "Test with debug mode enabled",
         "debug": true,
         "steps": [
           {
-            "checkLink": "https://www.google.com"
+            "checkLink": "https://www.google.com",
+            "breakpoint": true
           }
         ]
       },

11194-11241: Examples (spec-level debug): show precedence by overriding at the test

Great set. Add one case that demonstrates precedence (spec debug enabled, single test disables it).

     {
       "specId": "debug-spec-basic",
       "description": "Specification with debug mode enabled",
       "debug": true,
       "tests": [
         {
+          "debug": false,
           "steps": [
             {
               "checkLink": "https://www.google.com"
             }
           ]
         }
       ]
     },
src/schemas/schemas.json (1)

35491-35537: Spec-level examples: add a case showing test-level override of spec debug

Consider including a spec with "debug": true that contains a test with "debug": false to illustrate override clearly.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1b8683d and d04346a.

⛔ Files ignored due to path filters (4)
  • dist/schemas/report_v3.schema.json is excluded by !**/dist/**
  • dist/schemas/resolvedTests_v3.schema.json is excluded by !**/dist/**
  • dist/schemas/spec_v3.schema.json is excluded by !**/dist/**
  • dist/schemas/test_v3.schema.json is excluded by !**/dist/**
📒 Files selected for processing (7)
  • src/schemas/output_schemas/report_v3.schema.json (4 hunks)
  • src/schemas/output_schemas/resolvedTests_v3.schema.json (4 hunks)
  • src/schemas/output_schemas/spec_v3.schema.json (4 hunks)
  • src/schemas/output_schemas/test_v3.schema.json (2 hunks)
  • src/schemas/schemas.json (14 hunks)
  • src/schemas/src_schemas/spec_v3.schema.json (2 hunks)
  • src/schemas/src_schemas/test_v3.schema.json (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: hawkeyexl
PR: doc-detective/common#117
File: src/schemas/output_schemas/resolvedTests_v3.schema.json:24-30
Timestamp: 2025-05-29T16:54:47.192Z
Learning: In doc-detective/common schemas, `$schema` properties within object definitions are intentionally added to allow described JSON objects to be self-describing for linting purposes. This enables JSON linters and validators to automatically validate objects against the referenced schema. The version information is embedded in the filename using the pattern `<schema>_v3.schema.json`.
📚 Learning: 2025-05-29T16:54:47.192Z
Learnt from: hawkeyexl
PR: doc-detective/common#117
File: src/schemas/output_schemas/resolvedTests_v3.schema.json:24-30
Timestamp: 2025-05-29T16:54:47.192Z
Learning: In doc-detective/common schemas, `$schema` properties within object definitions are intentionally added to allow described JSON objects to be self-describing for linting purposes. This enables JSON linters and validators to automatically validate objects against the referenced schema. The version information is embedded in the filename using the pattern `<schema>_v3.schema.json`.

Applied to files:

  • src/schemas/src_schemas/spec_v3.schema.json
  • src/schemas/output_schemas/test_v3.schema.json
  • src/schemas/output_schemas/report_v3.schema.json
  • src/schemas/src_schemas/test_v3.schema.json
  • src/schemas/output_schemas/spec_v3.schema.json
  • src/schemas/schemas.json
  • src/schemas/output_schemas/resolvedTests_v3.schema.json
🔇 Additional comments (9)
src/schemas/src_schemas/spec_v3.schema.json (1)

222-269: No changes needed: shorthand string notation is supported
The step_v3.schema.json explicitly allows both string shorthand and object forms for checkLink and goTo (see its own examples at lines 316–326 and 339–345). The examples in spec_v3.schema.json therefore validate correctly—no update is required.

Likely an incorrect or invalid review comment.

src/schemas/src_schemas/test_v3.schema.json (1)

279-324: Step-level breakpoints and shorthand examples are valid
Both the breakpoint property and string shorthand for checkLink/goTo are defined and demonstrated in step_v3.schema.json. No changes needed.

src/schemas/output_schemas/test_v3.schema.json (2)

596-609: Test-level debug property is well-scoped and matches the precedence model.

Accepts boolean or "stepThrough"; leaving default undefined is correct to avoid clobbering config/spec values. Reads cleanly and aligns with step-level breakpoint.


596-609: debug property is consistent across all v3 schemas

I’ve verified that in config_v3.schema.json, spec_v3.schema.json, test_v3.schema.json, report_v3.schema.json, and resolvedTests_v3.schema.json, the debug field is defined as:

"debug": {
  "description": "Enable debugging mode…",
  "anyOf": [
    { "type": "boolean" },
    { "type": "string", "enum": ["stepThrough"] }
  ]
}

All descriptions and allowed values match exactly—no further changes required.

src/schemas/output_schemas/resolvedTests_v3.schema.json (2)

21810-21855: Examples are clear and cover all debug modes.

Good spread across true, "stepThrough", and false; this will help consumers understand expected shapes.


21846-21853: Breakpoint support confirmed
Verified that the breakpoint property is explicitly defined on step objects in all relevant output schemas (e.g. step_v3.schema.json, resolvedTests_v3.schema.json, spec_v3.schema.json, etc.), so the example will validate correctly.

• Optional: since "stepThrough" already pauses every step, you may simplify the demo by using debug: true with a single step breakpoint to highlight both debugging and breakpoints without redundancy.

src/schemas/output_schemas/report_v3.schema.json (2)

11000-11046: Good examples covering test-level debug; coverage looks balanced

Examples demonstrate true, "stepThrough", and false, plus a breakpoint example elsewhere. Looks good.


614-627: Debug property semantics are consistent across v3 schemas
All checked files—spec_v3.schema.json, test_v3.schema.json, resolvedTests_v3.schema.json, and report_v3.schema.json—define the debug property as:
anyOf:
{ "type": "boolean" }
{ "type": "string", "enum": ["stepThrough"] }

No additional values are accepted or used in examples. No further changes needed.

src/schemas/output_schemas/spec_v3.schema.json (1)

596-609: All v3 schemas use the same debug union type and semantics

A full grep across both input (src_schemas) and output (output_schemas) versions of spec_v3.schema.json, test_v3.schema.json, report_v3.schema.json, and resolvedTests_v3.schema.json shows every debug definition uses:

  • an anyOf with
    { "type": "boolean" }
    { "type": "string", "enum": ["stepThrough"] }
  • identical descriptions for pause and step-through behavior

No discrepancies were found.

Comment on lines +24892 to +24905
"debug": {
"description": "Enable debugging mode for this specification. Overrides the debug setting from config level. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this specification.",
"anyOf": [
{
"type": "boolean"
},
{
"type": "string",
"enum": [
"stepThrough"
]
}
]
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Set default=false and prefer oneOf over anyOf; minor wording nit

  • Encode the default in the schema.
  • Use oneOf (types are disjoint) to reflect exclusive alternatives.
  • Minor copy edit for clarity.

Proposed diff:

-                "debug": {
-                  "description": "Enable debugging mode for this specification. Overrides the debug setting from config level. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this specification.",
-                  "anyOf": [
+                "debug": {
+                  "description": "Enable debugging mode for this specification. Overrides the debug setting from the config level. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this specification.",
+                  "default": false,
+                  "oneOf": [
                     {
                       "type": "boolean"
                     },
                     {
                       "type": "string",
                       "enum": [
                         "stepThrough"
                       ]
                     }
-                  ]
+                  ]
                 },

Optional: Factor this definition into $defs and reference it everywhere to avoid duplication:

{
  "$defs": {
    "debugSetting": {
      "description": "Enable debugging mode. `true` pauses on breakpoints; `stepThrough` pauses at every step; `false` disables debugging.",
      "default": false,
      "oneOf": [
        { "type": "boolean" },
        { "type": "string", "const": "stepThrough" }
      ]
    }
  }
}

Then replace the property with:

-                "debug": { ...existing schema... }
+                "debug": { "$ref": "#/$defs/debugSetting" }
🤖 Prompt for AI Agents
In src/schemas/schemas.json around lines 24892 to 24905, the schema should
explicitly set "default": false and replace "anyOf" with "oneOf" to indicate
mutually exclusive types. Refactor the debug setting definition into a reusable
$defs entry with the described structure, then reference this $defs definition
wherever the debug setting is used to avoid duplication and improve clarity.

Comment on lines +25507 to +25520
"debug": {
"description": "Enable debugging mode for this test. Overrides the debug setting from config and spec levels. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this test.",
"anyOf": [
{
"type": "boolean"
},
{
"type": "string",
"enum": [
"stepThrough"
]
}
]
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Mirror spec changes: default=false, oneOf, and wording

  • Add "default": false.
  • Prefer oneOf instead of anyOf.
  • Copy edit: “from the config and spec levels.”
-                          "debug": {
-                            "description": "Enable debugging mode for this test. Overrides the debug setting from config and spec levels. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this test.",
-                            "anyOf": [
+                          "debug": {
+                            "description": "Enable debugging mode for this test. Overrides the debug setting from the config and spec levels. `true` allows pausing on breakpoints, waiting for user input before continuing. `stepThrough` pauses at every step, waiting for user input before continuing. `false` disables all debugging for this test.",
+                            "default": false,
+                            "oneOf": [
                               { "type": "boolean" },
                               { "type": "string", "enum": ["stepThrough"] }
-                            ]
+                            ]
                           },

Optional (if adopting $defs): use

-                          "debug": { ... }
+                          "debug": { "$ref": "#/$defs/debugSetting" }

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/schemas/schemas.json around lines 25507 to 25520, update the schema by
adding "default": false where applicable, replace anyOf with oneOf to improve
validation accuracy, and revise the wording to say “from the config and spec
levels.” Additionally, if using $defs for definitions, consider adopting it for
better schema organization.

Comment on lines +35279 to 35324
{
"testId": "debug-test-basic",
"description": "Test with debug mode enabled",
"debug": true,
"steps": [
{
"checkLink": "https://www.google.com"
}
]
},
{
"testId": "debug-test-step-through",
"description": "Test with step-through debug mode",
"debug": "stepThrough",
"steps": [
{
"goTo": "https://www.google.com"
},
{
"find": {
"selector": "[name='q']"
}
}
]
},
{
"testId": "debug-test-disabled",
"description": "Test with debug mode explicitly disabled",
"debug": false,
"steps": [
{
"checkLink": "https://www.google.com"
}
]
},
{
"testId": "critical-test",
"description": "Test with debug mode and step breakpoints",
"debug": "stepThrough",
"steps": [
{
"checkLink": "https://api.example.com",
"breakpoint": true
}
]
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Examples look good; add explicit override scenarios and verify step breakpoint support

  • Add an example where the spec has "debug": true but a contained test sets "debug": false to demonstrate precedence.
  • Add an example where test "debug": false and a step has "breakpoint": true (should not pause), clarifying behavior.

To confirm the example with "breakpoint": true is valid across all step types, search for the breakpoint property in step schemas:


🏁 Script executed:

#!/bin/bash
# Verify 'breakpoint' is defined in step/action schemas
rg -n --no-heading -A 3 -B 3 '"breakpoint"\s*:\s*\{' src/schemas | sed -n '1,200p'
rg -n --no-heading -A 2 -B 2 '"breakpoint"\s*:\s*true' src/schemas | sed -n '1,200p'

Length of output: 32688


Add explicit override and breakpoint examples

Breakpoint support has been confirmed across all step schemas (see step_v3.schema.json and related test/spec schemas). Please update your examples accordingly:

  • Include a scenario where the spec has "debug": true but an individual test sets "debug": false to demonstrate that the test-level setting takes precedence.
  • Include a scenario where a test sets "debug": false and a step within that test has "breakpoint": true. Clarify that execution will not pause in this case when debug mode is disabled.
🤖 Prompt for AI Agents
In src/schemas/schemas.json between lines 35279 and 35324, update the examples
to explicitly show override and breakpoint behavior for debug settings. Add one
example where the spec-level debug is true but an individual test sets debug to
false, demonstrating the test-level debug setting takes precedence. Also add an
example where a test has debug false but a step within it has breakpoint true,
clarifying that execution does not pause since debug mode is disabled. Ensure
these examples clearly illustrate the intended behavior for debugging and
breakpoints.

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.

Debug mode

3 participants

Comments