Skip to content

Sync pinned Pi packages - #180

Merged
yourconscience merged 1 commit into
mainfrom
feature/pi-package-sync
Sep 15, 2026
Merged

yourconscience merged 1 commit into
mainfrom
feature/pi-package-sync

Conversation

@yourconscience

@yourconscience yourconscience commented Sep 14, 2026

Copy link
Copy Markdown
Owner

What changed

  • new Pi-only packages list on agent targets: sync reconciles ~/.pi/agent/settings.json package declarations; Pi installs missing declared packages at startup
  • *[]string pointer keeps absent (no management) distinct from [] (clear packages)
  • package removals and filtered-entry replacement join the setup confirmation gate; declining suppresses the rewrite
  • null/malformed settings.json return errors instead of panicking
  • package managed/drifted/remove counts in status, sync, and verbose reports

Verification

  • go test ./..., git diff --check
  • gate review by independent read-only reviewer: no blocking findings
  • end-to-end: Pi 0.85.1 + 6 pinned packages installed on a second machine, RPC smoke loads mcp/subagents/feynman/todo commands

Summary by Sourcery

Support declarative synchronization of pinned Pi packages while preserving existing settings and protecting destructive changes with confirmation.

New Features:

  • Add optional pinned package declarations for Pi targets and reconcile them with Pi's agent settings.
  • Report managed, drifted, and removed Pi packages across status, sync, and verbose output.

Bug Fixes:

  • Handle null or malformed Pi settings files with errors instead of panics.

Enhancements:

  • Preserve unrelated Pi settings while replacing non-canonical package entries.
  • Require confirmation for destructive package changes and honor declined synchronization.

Documentation:

  • Document Pi package declarations, startup installation behavior, and troubleshooting guidance.

Tests:

  • Add coverage for package synchronization, settings preservation, filtered-entry replacement, empty declarations, invalid settings, target validation, and confirmation handling.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry @yourconscience, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 15 hours and 3 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c6871cad-5dde-4512-9667-b29997947f0b


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.

@sourcery-ai

sourcery-ai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds opt-in, Pi-only pinned package management by validating an optional package list, reconciling it into Pi’s settings.json without disturbing unrelated settings, gating destructive changes during sync, and surfacing package state in reports and documentation.

Sequence diagram for Pi package synchronization

sequenceDiagram
    participant User
    participant Sync as dotagents_sync
    participant Inspect as inspectAgent
    participant Settings as Pi_settings_json
    participant Pi

    User->>Sync: runSync()
    Sync->>Inspect: augmentPiPackageReport()
    Inspect->>Settings: readPiPackages()
    Settings-->>Inspect: declared packages and exactness
    Inspect-->>Sync: package drift and removal actions
    alt destructive package changes
        Sync->>User: confirmDestructiveSyncActions()
        alt user accepts
            Sync->>Settings: syncPiPackages()
            Settings-->>Sync: rewritten packages list
        else user declines
            Sync-->>User: preserve existing declarations
        end
    else package list already synchronized
        Sync-->>User: report managed packages
    end
    Pi->>Settings: read packages at startup
    Pi-->>Pi: install missing declared packages
Loading

File-Level Changes

Change Details Files
Add Pi-only package declarations with absent-versus-empty semantics and validation.
  • Add an optional pointer-backed YAML packages field to agent targets.
  • Trim and reject empty or duplicate package names.
  • Reject package configuration on non-Pi targets.
cmd/dotagents/main.go
cmd/dotagents/config.go
cmd/dotagents/pi_packages_test.go
README.md
Reconcile declared Pi packages with ~/.pi/agent/settings.json while preserving unrelated settings.
  • Read and validate JSON settings, including explicit errors for null or malformed content.
  • Detect exact package-list matches, drift, removals, and replacement of non-string entries.
  • Write the canonical package list while retaining other settings and creating parent directories as needed.
cmd/dotagents/pi_packages.go
cmd/dotagents/pi_packages_test.go
Integrate Pi package reconciliation into inspection and sync workflows with destructive-action confirmation.
  • Apply package updates during sync only for detected Pi targets with package management enabled.
  • Route package removals and filtered-entry replacement through the setup confirmation gate.
  • Skip package rewrites when the user declines destructive changes.
cmd/dotagents/inspect.go
cmd/dotagents/sync.go
cmd/dotagents/setup_scaffold.go
cmd/dotagents/setup_separation_test.go
Expose package management state and actions across reporting surfaces.
  • Track managed, drifted, update, and removal package entries in agent reports.
  • Include package state in synced determination, sorting, status/drift buckets, verbose output, and sync action counts.
cmd/dotagents/main.go
cmd/dotagents/inspect.go
cmd/dotagents/report.go
Document Pi package pinning, installation behavior, and troubleshooting.
  • Document the packages YAML configuration and settings.json reconciliation.
  • Clarify that Pi must be installed separately and installs declared packages at startup.
  • Add guidance for missing Pi packages.
README.md
docs/troubleshooting.md
skills/dotagents/SKILL.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@yourconscience
yourconscience merged commit 45d1c94 into main Sep 15, 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