Skip to content

Improve automation release readiness#11

Merged
xhwSkhizein merged 8 commits intomainfrom
release-readiness-inline
Apr 14, 2026
Merged

Improve automation release readiness#11
xhwSkhizein merged 8 commits intomainfrom
release-readiness-inline

Conversation

@xhwSkhizein
Copy link
Copy Markdown
Owner

@xhwSkhizein xhwSkhizein commented Apr 14, 2026

Summary

  • align automation manifest schema across CLI, loader, API, and persistence payloads
  • preserve source automation.toml during publish and make manifest provenance explicit
  • split automation inspect into snapshot vs live config views and enforce automation run timeouts
  • restore daemon-backed read fallback profile reporting and update durable docs/contracts
  • add approved design/implementation-plan docs plus coverage for publish, inspect, timeout, and read flows

Validation

  • ./scripts/check.sh
    • 195 passed

Summary by CodeRabbit

Release Notes

  • New Features

    • Added retry backoff configuration for automation runs.
    • Split automation inspect output to display snapshot configuration separately from live service state.
    • Added fallback profile metadata reporting for read operations.
    • Track configuration source (manifest-based or auto-generated) for published automations.
  • Bug Fixes

    • Timeout failures no longer trigger automatic retry attempts.
  • Documentation

    • Clarified automation publish, inspect, and runtime timeout semantics.
    • Added troubleshooting guidance for automation drift and fallback profile behavior.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

Warning

Rate limit exceeded

@xhwSkhizein has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 47 minutes and 30 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 47 minutes and 30 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 72980f4d-6688-491e-bc54-437faaf56ca8

📥 Commits

Reviewing files that changed from the base of the PR and between d154db3 and 342296b.

📒 Files selected for processing (5)
  • AGENTS.md
  • browser-cli-extension/src/debugger.js
  • browser-cli-extension/tests/debugger.test.js
  • docs/superpowers/plans/2026-04-14-browser-cli-extension-attach-race-implementation-plan.md
  • scripts/lint.sh
📝 Walkthrough

Walkthrough

This PR establishes automation publish/inspect/runtime/read contracts through documentation and implementation updates. Changes include new manifest fields (retry_backoff_seconds, stdout_mode), conditional automation.toml loading with manifest_source tracking, split inspect configurations, deadline-based timeout enforcement, and fallback profile metadata in read responses.

Changes

Cohort / File(s) Summary
Documentation & Specifications
AGENTS.md, README.md, docs/superpowers/specs/2026-04-14-browser-cli-release-readiness-design.md, docs/superpowers/plans/2026-04-14-browser-cli-release-readiness-implementation-plan.md
Added comprehensive documentation defining automation publish/inspect/runtime/read contracts, including snapshot manifest immutability semantics, manifest_source tracking, split config inspection, timeout enforcement, and fallback profile reporting.
Error Handling & Data Models
src/browser_cli/error_codes.py, src/browser_cli/errors.py, src/browser_cli/automation/models.py
Introduced AUTOMATION_RUN_TIMEOUT error code, added AutomationRunTimeoutError exception class, and added retry_backoff_seconds field to AutomationRuntime model.
Automation Publishing & Loading
src/browser_cli/automation/publisher.py, src/browser_cli/automation/loader.py
Implemented conditional automation.toml loading during publish (use source manifest if present, else generate defaults), added manifest_source tracking to published artifacts, and added retry_backoff_seconds parsing from manifest.
API & CLI Automation Commands
src/browser_cli/automation/api/server.py, src/browser_cli/commands/automation.py
Updated payload-to-definition conversion to preserve stdout_mode, refactored inspect response to split snapshot_config and live_config with error handling, and added manifest_source to publish responses.
Automation Runtime Execution & Hooks
src/browser_cli/automation/service/runtime.py, src/browser_cli/automation/hooks.py
Implemented multiprocessing-based task execution with deadline tracking and timeout enforcement (raising AutomationRunTimeoutError), added per-stage timeout validation, prevented retry scheduling on timeout, and added timeout_seconds parameter to hook execution.
Daemon Read Path
src/browser_cli/daemon/browser_service.py
Enhanced read_page response to include fallback profile metadata (used_fallback_profile, fallback_profile_dir, fallback_reason, profile_name) when Playwright browser environment indicates fallback usage.
Unit Tests
tests/unit/test_automation_api.py, tests/unit/test_automation_commands.py, tests/unit/test_automation_publish.py, tests/unit/test_automation_service.py, tests/unit/test_task_runtime_automation.py, tests/unit/test_task_runtime_client_read.py
Added test coverage for payload-to-definition conversion, publish manifest_source behavior, inspect split configs with error handling, timeout enforcement with no-retry behavior, manifest field preservation, and fallback metadata propagation.
Integration Tests
tests/integration/test_task_runtime_read.py
Added integration test validating fallback metadata reporting in daemon read-page responses.

Sequence Diagrams

sequenceDiagram
    actor CLI as CLI/publish<br/>command
    participant pub as publisher.py
    participant fs as Filesystem<br/>(task_dir)
    participant snap as Snapshot Dir<br/>versions/N/
    
    CLI->>pub: publish_task_dir(task_dir)
    pub->>fs: Check task_dir/automation.toml exists?
    
    alt automation.toml exists
        fs-->>pub: manifest found
        pub->>pub: load_automation_manifest(task_dir/automation.toml)
        pub->>pub: render_automation_manifest_from_manifest(...)
        pub->>snap: Write manifest to automation.toml
        pub->>snap: Write manifest_source="task_dir"
    else automation.toml absent
        fs-->>pub: manifest not found
        pub->>pub: render_automation_manifest(...) [defaults]
        pub->>snap: Write manifest to automation.toml
        pub->>snap: Write manifest_source="generated_defaults"
    end
    
    pub-->>CLI: PublishedAutomation(manifest_source)
Loading
sequenceDiagram
    participant srv as Runtime
    participant tm as Timeout Mgr<br/>_deadline_for_run
    participant child as Task Child<br/>Process
    participant queue as Queue<br/>IPC
    
    srv->>tm: Compute deadline from<br/>timeout_seconds
    srv->>srv: Stage: before_hooks<br/>with _remaining_timeout
    
    srv->>child: Spawn child process<br/>_run_task_entrypoint_child
    
    par Child Execution
        child->>queue: Send {ok, result} or<br/>{ok, error}
    and Parent Timeout Check
        srv->>tm: Check _remaining_timeout
        tm-->>srv: Time remaining?
        
        alt Timeout exceeded
            srv->>srv: Raise AutomationRunTimeoutError
            srv->>srv: Emit run_timed_out event
        end
    end
    
    srv->>srv: if timeout: skip retry<br/>else: schedule if retries remain
Loading
sequenceDiagram
    actor CLI as CLI/inspect
    participant cmd as commands/<br/>automation.py
    participant snap as Snapshot<br/>loader
    participant svc as Automation<br/>Service
    
    alt With --version N
        CLI->>cmd: inspect --version 5
        cmd->>snap: _load_snapshot_manifest(version=5)
        
        par Load Snapshot
            snap-->>cmd: snapshot_config (or error)
        and Get Live State
            cmd->>svc: Get current automation config
            svc-->>cmd: live_config
        end
        
        cmd-->>CLI: {<br/>snapshot_config,<br/>snapshot_config_error,<br/>live_config,<br/>selected_version,<br/>latest_run<br/>}
    else No version specified
        CLI->>cmd: inspect automation-id
        cmd->>svc: Get current state only
        svc-->>cmd: live_config
        
        cmd-->>CLI: {<br/>snapshot_config: None,<br/>live_config,<br/>selected_version: None,<br/>latest_run<br/>}
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • PR #6: Foundational automation/task cutover that introduced the automation package architecture; this PR refines and tightens contracts across the same core modules (publisher, loader, models, service/runtime, commands, API).
  • PR #7: Modifies the automation CLI/inspect/publish flow including payload shapes and response structures; overlaps with this PR's inspect response refactoring and manifest_source introduction.

Poem

🐰 A manifest evolves with graceful care,
Source and snapshot, split with flair,
Timeouts tick on steady ground,
Fallback profiles now are found,
Contracts clear—no more despair!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Improve automation release readiness' is directly related to the changeset's main objectives: aligning automation manifests, preserving source configurations, splitting inspect views, enforcing timeouts, restoring fallback reporting, and updating documentation—all explicitly stated in the PR objectives.
Description check ✅ Passed The PR description covers all main objectives with clear bullet points and includes validation results, though it lacks a 'Type of Change' section and architectural boundary checkboxes specified in the template.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release-readiness-inline

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@xhwSkhizein xhwSkhizein merged commit 62630b2 into main Apr 14, 2026
6 checks passed
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.

1 participant