Skip to content

Modernize pi-scraper for Pi 0.81#2

Merged
brandonkramer merged 2 commits into
mainfrom
agent/pi-081-modernization
Jul 23, 2026
Merged

Modernize pi-scraper for Pi 0.81#2
brandonkramer merged 2 commits into
mainfrom
agent/pi-081-modernization

Conversation

@brandonkramer

Copy link
Copy Markdown
Owner

Summary

  • upgrade the Pi integration to the current 0.81.1 runtime and native extension/tool types
  • resolve model selection, authentication, cancellation, provider errors, and usage through supported Pi APIs
  • move resource ownership to Pi session lifecycle events and scope project manifests by trusted session cwd
  • migrate repository checks and publishing metadata to Bun, strengthen CI/docs/security checks, and add a durable modernization dossier
  • keep all seven public web tools registered while initially activating only common tools plus the web_tools discovery path
  • replace repeated whole-batch progress recounts with incremental counters

Why

The extension still relied on pre-0.80 model globals, process-level cleanup hooks, trust-insensitive project caching, type-erasing registration casts, and an always-active tool contract. Batch progress also filtered the entire item list three times for every event, making large batches quadratic.

Impact

  • Pi 0.81 model and lifecycle behavior is explicit and type-checked.
  • Untrusted projects fail closed and cannot reuse another cwd's manifest cache.
  • The initial active tool contract drops from 1,489 to 724 estimated tokens (51.4%) with deterministic selection and invocation metrics unchanged at 100%.
  • A local same-process 5,000-transition micro-benchmark dropped progress accounting from 2,378.6 ms to 4.7 ms (about 501x); progress snapshots are also skipped when no update consumer exists.
  • Legacy hosts without dynamic activation still receive the existing seven-tool set.

Validation

  • bun install --frozen-lockfile --ignore-scripts
  • bun run typecheck
  • bun run format:check
  • bun run lint (0 errors; existing warnings remain)
  • focused lifecycle, progress, batch, crawl-adapter, and registration tests: 23/23
  • bun run test:selection: 16/16
  • bun run test:tools: 7/7
  • deterministic contract benchmark: 51.4% reduction, 100% positive/negative/invocation metrics, 0 critical confusions
  • bun audit --prod --audit-level=high: no vulnerabilities
  • actionlint and package dry-run passed
  • independent Cursor 3.12.17 read-only review found no actionable issues

Platform boundary

The broad local Windows suite is not claimed green: its last run retained 20 known failures in unchanged Windows-sensitive path/mode, drive-URL, and SQLite cleanup cases. A broader crawl-runner retry also reproduced the documented Windows EBUSY SQLite cleanup lock, while the changed crawl adapter tests passed. Linux full CI remains the authoritative full-suite gate.

No development server, production build, live provider request, or live browser smoke test was run.

@brandonkramer
brandonkramer marked this pull request as ready for review July 23, 2026 01:03
@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@brandonkramer
brandonkramer merged commit 1c4efd9 into main Jul 23, 2026
4 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