Skip to content

[3561 by Claude Opus 5.5] Plugin authoring guide, scaffold command and compatibility rules for official plugins - #3645

Merged
propr-dev[bot] merged 10 commits into
3542-epic-plugin-system-xu8from
3561/claude-opus-5-5-plugin-authoring-guide-sc-20261117-0455-agt
Nov 17, 2026
Merged

propr-dev[bot] merged 10 commits into
3542-epic-plugin-system-xu8from
3561/claude-opus-5-5-plugin-authoring-guide-sc-20261117-0455-agt

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3561

Branch: 3561/claude-opus-5-5-plugin-authoring-guide-sc-20261117-0455-agt
Commits: ✅ Changes committed (ecb0e20)


AI Processing Completed

Execution Details:

Summary:
I've built everything the issue asks for: the scaffold command, the authoring guide, generated docs checked in CI, contract tests and the two CLI commands. The suites for these changes pass (174 tests), as do plugins:check, plugins:docs:check, the CLI and plugins typecheck and lint, and a full Docusaurus build with no broken links or anchors. I did not run the full repository suite.

Scaffold (npm run plugins:new -- <id> [--name] [--category] [--description]), in scripts/new-plugin.mjs:

  • It creates packages/plugins/<id>/ with a manifest, a README template (setup, permissions, settings, smoke-test checklist, documentation links), an icon and an example handler. The handler counts merged pull requests and skips repeated deliveries.
  • It also writes a test in packages/plugins/test/<id>.test.ts that uses the plugin test kit, plus a docs page docs/docs/plugins/<id>.md.
  • It adds the plugin to registry.json after the official plugins and regenerates the plugin docs.

Generated docs (npm run plugins:docs, with --check added to the CI plugins step), in scripts/gen-plugin-docs.mjs:

  • In docs/docs/plugins/authoring.md it fills in the manifest reference (from the zod schema), the event payload table and the SDK reference.
  • It also writes the catalog page, the manifest JSON Schema and the list of plugin pages the sidebar reads.
  • Generation fails if a manifest field has no description in scripts/plugin-manifest-descriptions.mjs, or if an official plugin has no docs page. A new manifest field therefore can't ship undocumented.

Compatibility rules:

  • packages/shared/src/pluginContract.ts describes the manifest fields, event payloads and SDK surface as data. Compile-time checks keep it matched to the TypeScript types.
  • packages/shared/test/pluginContract.test.ts compares it with a committed snapshot and fails on any breaking change.
  • After an additive change, record it with npm run plugins:contract:update. That script refuses breaking changes unless you pass --accept-breaking.
  • PLUGIN_SUPPORTED_MANIFEST_VERSIONS covers the rule that an old manifest version keeps being read.

CLI: propr plugin list and propr plugin show <id>, both read-only with --json, using the plugin REST API. Like the Plugins page, they need an instance administrator.

Docs: the authoring guide covers every topic the issue lists, with a worked example (I ran its code through the type checker and the test kit), compatibility rules and a "Not yet supported" section. The Plugins sidebar now has the overview, the catalog, one page per official plugin and the authoring guide. I also linked the new pages from the plugins overview and added the commands to the CLI reference.

One thing to know: packages/plugins/test/registry.test.ts lists the official plugins in a fixed order, so after scaffolding a real plugin you must add its id to that test. I left the test alone because it deliberately pins catalog order.

I captured the catalog page and three sections of the authoring guide as previews. The manifest reference tables still scroll sideways at desktop width, even after I narrowed them to three columns.

Acceptance criteria

  • AC1: met — scripts/new-plugin.mjs; test/newPlugin.test.mjs scaffolds a plugin, then runs plugins:check, ESLint with the real plugin-folder config (and confirms that config refuses a core import), tsc, the docs drift check and the generated test, all without edits.
  • AC2: met — scripts/gen-plugin-docs.mjs --check runs in the plugins step of .github/workflows/pr-build-check.yml; test/genPluginDocs.test.mjs shows it fails on a stale catalog, reference or sidebar.
  • AC3: met — packages/shared/test/pluginContract.test.ts compares against packages/shared/test/contracts/plugin-contract.snapshot.json; the fixture packages/shared/test/fixtures/plugin-contract/breaking-previous.json shows each kind of breaking change being reported.
  • AC4: met — packages/cli/src/commands/pluginCommands.ts and packages/cli/src/api/plugins.ts; packages/cli/src/commands/pluginCommands.test.ts runs them against a local HTTP server that answers like the plugin API, including 404 and 403 cases and --json.
  • AC5: met — docs/sidebars.ts (Plugins section with overview, catalog, one page per plugin from docs/plugin-pages.json, and the authoring guide); the docs build succeeds.

Review digest

Acceptance criteria (5 of 5 met, as stated by the agent)

  • ✅ AC1 (met): The scaffold produces a plugin that passes `plugins:check`, lint and its generated test without edits. — `scripts/new-plugin.mjs`; `test/newPlugin.test.mjs` scaffolds a plugin, then runs `plugins:check`, ESLint with the real plugin-folder config (and confirms that config refuses a core import), `tsc`, the docs drift check and the generated test, all without edits.
  • ✅ AC2 (met): The generated manifest reference and plugin catalog are checked in CI for drift. — `scripts/gen-plugin-docs.mjs --check` runs in the plugins step of `.github/workflows/pr-build-check.yml`; `test/genPluginDocs.test.mjs` shows it fails on a stale catalog, reference or sidebar.
  • ✅ AC3 (met): Contract tests for event payloads and the SDK surface exist and fail on a breaking change (demonstrated by a test fixture). — `packages/shared/test/pluginContract.test.ts` compares against `packages/shared/test/contracts/plugin-contract.snapshot.json`; the fixture `packages/shared/test/fixtures/plugin-contract/breaking-previous.json` shows each kind of breaking change being reported.
  • ✅ AC4 (met): CLI commands work against the API and are covered by CLI tests. — `packages/cli/src/commands/pluginCommands.ts` and `packages/cli/src/api/plugins.ts`; `packages/cli/src/commands/pluginCommands.test.ts` runs them against a local HTTP server that answers like the plugin API, including 404 and 403 cases and `--json`.
  • ✅ AC5 (met): Docs sidebar has a Plugins section: overview, one page per official plugin, authoring guide. — `docs/sidebars.ts` (Plugins section with overview, catalog, one page per plugin from `docs/plugin-pages.json`, and the authoring guide); the docs build succeeds.

Risk-tiered paths

  • High risk (2 files)
    • .github/workflows/pr-build-check.yml (+18/−0): CI or workflow file
    • package.json (+4/−0): dependency manifest
  • Normal risk (10 files)
    • packages/cli/src/api/plugins.ts (added, +32/−0)
    • packages/cli/src/commands/index.ts (+1/−0)
    • packages/cli/src/commands/pluginCommands.ts (added, +167/−0)
    • packages/cli/src/index.ts (+3/−0)
    • packages/shared/src/index.ts (+1/−0)
    • packages/shared/src/pluginContract.ts (added, +330/−0)
    • scripts/gen-plugin-docs.mjs (added, +313/−0)
    • scripts/new-plugin.mjs (added, +346/−0)
    • scripts/plugin-manifest-descriptions.mjs (added, +121/−0)
    • scripts/update-plugin-contract.mjs (added, +44/−0)
  • Low risk (14 files)
    • docs/docs/features/plugins.md (+20/−0)
    • docs/docs/features/propr-cli.md (+13/−0)
    • docs/docs/plugins/authoring.md (added, +773/−0)
    • docs/docs/plugins/catalog.md (added, +50/−0)
    • docs/plugin-pages.json (added, +10/−0)
    • docs/sidebars.ts (+6/−8)
    • docs/static/schemas/plugin-manifest.v1.schema.json (added, +1,114/−0)
    • packages/cli/src/commands/pluginCommands.test.ts (added, +165/−0)
    • packages/shared/test/contracts/plugin-contract.snapshot.json (added, +897/−0)
    • packages/shared/test/fixtures/plugin-contract/README.md (added, +11/−0)
    • packages/shared/test/fixtures/plugin-contract/breaking-previous.json (added, +28/−0)
    • packages/shared/test/pluginContract.test.ts (added, +108/−0)
    • test/genPluginDocs.test.mjs (added, +95/−0)
    • test/newPlugin.test.mjs (added, +140/−0)

Validation evidence

  • No repository validation commands ran.

Diff size: 26 files changed, +4,810/−8 lines

Detailed Logs:

  • Conversation: 19 messages
  • Session: 790ad2c5-6919-46ad-86ad-fe3d55c75fd2

Log files stored at:

  • conversation: /usr/src/app/logs/executions/issue-3561-2026-11-17T05-21-32-150Z-conversation.json
  • output: /usr/src/app/logs/executions/issue-3561-2026-11-17T05-21-32-150Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: I've built everything the issue asks for: the scaffold command, the authoring guide, generated docs checked in CI, contract tests and the two CLI commands. The suites for these changes pass (174 tests...


This PR was created automatically by ProPR after processing issue #3561.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!


Visual preview

Compatibility rules

Compatibility rules

The compatibility rules section of the authoring guide

Full-size original

Authoring guide

Authoring guide

Top of 'Writing an official plugin' with the npm run plugins:new quick start

Full-size original

Generated manifest reference

Generated manifest reference

The manifest reference section generated from the zod schema

Full-size original

Generated plugin catalog

Generated plugin catalog

docs/plugins/catalog: every official plugin with category and one-line description, generated from the manifests; Plugins sidebar with overview, catalog, one page per plugin and the authoring guide

Full-size original

…uthoring guide, generated docs checked in CI, contract tests and the two CLI commands. The suites for these changes pass (174 tests), as do `plugins:check`, `plugins:docs:check`, the CLI and plugins typecheck and lint, and a full Docusaurus build with no broken links or anchors. I did not run the full repository suite.

Scaffold (`npm run plugins:new -- <id> [--name] [--category] [--description]`), in `scripts/new-plugin.mjs`:
- It creates `packages/plugins/<id>/` with a manifest, a README template (setup, permissions, settings, smoke-test checklist, documentation links), an icon and an example handler. The handler counts merged pull requests and skips repeated deliveries.
- It also writes a test in `packages/plugins/test/<id>.test.ts` that uses the plugin test kit, plus a docs page `docs/docs/plugins/<id>.md`.
- It adds the plugin to `registry.json` after the official plugins and regenerates the plugin docs.

Generated docs (`npm run plugins:docs`, with `--check` added to the CI plugins step), in `scripts/gen-plugin-docs.mjs`:
- In `docs/docs/plugins/authoring.md` it fills in the manifest reference (from the zod schema), the event payload table and the SDK reference.
- It also writes the catalog page, the manifest JSON Schema and the list of plugin pages the sidebar reads.
- Generation fails if a manifest field has no description in `scripts/plugin-manifest-descriptions.mjs`, or if an official plugin has no docs page. A new manifest field therefore can't ship undocumented.

Compatibility rules:
- `packages/shared/src/pluginContract.ts` describes the manifest fields, event payloads and SDK surface as data. Compile-time checks keep it matched to the TypeScript types.
- `packages/shared/test/pluginContract.test.ts` compares it with a committed snapshot and fails on any breaking change.
- After an additive change, record it with `npm run plugins:contract:update`. That script refuses breaking changes unless you pass `--accept-breaking`.
- `PLUGIN_SUPPORTED_MANIFEST_VERSIONS` covers the rule that an old manifest version keeps being read.

CLI: `propr plugin list` and `propr plugin show <id>`, both read-only with `--json`, using the plugin REST API. Like the Plugins page, they need an instance administrator.

Docs: the authoring guide covers every topic the issue lists, with a worked example (I ran its code through the type checker and the test kit), compatibility rules and a "Not yet supported" section. The Plugins sidebar now has the overview, the catalog, one page per official plugin and the authoring guide. I also linked the new pages from the plugins overview and added the commands to the CLI reference.

One thing to know: `packages/plugins/test/registry.test.ts` lists the official plugins in a fixed order, so after scaffolding a real plugin you must add its id to that test. I left the test alone because it deliberately pins catalog order.

I captured the catalog page and three sections of the authoring guide as previews. The manifest reference tables still scroll sideways at desktop width, even after I narrowed them to three columns.

Acceptance criteria
- AC1: met — `scripts/new-plugin.mjs`; `test/newPlugin.test.mjs` scaffolds a plugin, then runs `plugins:check`, ESLint with the real plugin-folder config (and confirms that config refuses a core import), `tsc`, the docs drift check and the generated test, all without edits.
- AC2: met — `scripts/gen-plugin-docs.mjs --check` runs in the plugins step of `.github/workflows/pr-build-check.yml`; `test/genPluginDocs.test.mjs` shows it fails on a stale catalog, reference or sidebar.
- AC3: met — `packages/shared/test/pluginContract.test.ts` compares against `packages/shared/test/contracts/plugin-contract.snapshot.json`; the fixture `packages/shared/test/fixtures/plugin-contract/breaking-previous.json` shows each kind of breaking change being reported.
- AC4: met — `packages/cli/src/commands/pluginCommands.ts` and `packages/cli/src/api/plugins.ts`; `packages/cli/src/commands/pluginCommands.test.ts` runs them against a local HTTP server that answers like the plugin API, including 404 and 403 cases and `--json`.
- AC5: met — `docs/sidebars.ts` (Plugins section with overview, catalog, one page per plugin from `docs/plugin-pages.json`, and the authoring guide); the docs build succeeds.
@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=10
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Nov 17, 2026
@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR delivers the scaffold, generated documentation, CLI commands, and compatibility checks, but needs changes before merge: the compatibility guard misses actual type changes, and valid scaffold names can produce invalid documentation.

✅ Read-only CLI integration — Both commands use the existing GET endpoints, with coverage for JSON output, unknown plugins, and administrator access refusals.

✅ Documentation drift detection — CI checks generated references, catalog, schema, and sidebar entries; tests also cover missing official-plugin pages.

The supplied current-head status is green: 35 passed, 27 neutral/skipped, and no failures or pending checks. This review used static inspection only; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Check actual payload and SDK types

  • Category: requirement

  • Required behavior: AC3 requires contract tests for event payloads and the SDK surface that fail on breaking changes; the guide specifically promises detection of retyped payload fields and changed SDK operations.

  • Evidence: packages/shared/src/pluginContract.ts, compile-time assertions and buildPluginContract; packages/shared/test/pluginContract.test.ts, breaking-change tests.

    1. Change an actual payload field’s type, such as ReviewScoredEventPayload.score from number to string, keeping its name.
    2. The compile-time assertion compares only FieldKey<ReviewScoredEventPayload> against the manually maintained payload keys, so this change does not affect that assertion.
    3. buildPluginContract() still emits the manually written score: 'number'; comparison with the snapshot therefore reports no change.
    4. Similarly, changing a PluginStateStore method’s parameters or return type preserves keyof PluginStateStore and the stored method-name list, so the SDK contract guard cannot detect it.

    static trace: The new tests mutate the contract representation itself, not its underlying TypeScript interfaces. They demonstrate the comparator but do not close this disconnect. Consequently, incompatible interface changes can escape the compatibility checks this PR advertises.

  • Minimum fix: Bind payload type descriptors to actual field types and include SDK parameter/return types in compatibility validation. Add regression coverage demonstrating detection of changes to the source interfaces, rather than only changes to the snapshot representation.

F2: 🔴 Escape scaffolded documentation values

  • Category: correctness

  • Required behavior: The scaffold must generate usable documentation for accepted plugin metadata and leave the generated documentation internally valid.

  • Evidence: scripts/new-plugin.mjs, docsPageFor and scaffoldPlugin.

    1. Run the scaffold with a valid name containing quotes, for example --name 'Acme "Chat"'.
    2. manifestFor safely serializes that name into JSON, but docsPageFor interpolates it directly into double-quoted YAML.
    3. The resulting front matter contains sidebar_label: "Acme "Chat"" and title: "Acme "Chat" plugin", which are invalid YAML.
    4. The scaffold registers this page in the generated sidebar, leaving the documentation build unable to parse it.

    static trace: The manifest permits this name. The docs generator checks page existence and generated content, but never parses the new page’s front matter; existing scaffold tests use names without quotes. The description’s quote replacement also does not provide general YAML escaping for backslashes.

  • Minimum fix: Serialize front-matter string values with a YAML-safe serializer, including name, title, and description. Cover quoted names and backslashes in descriptions with a front-matter parsing regression test.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Explain registry test maintenance

The existing registry tests pin the official-plugin list, so adding a scaffolded plugin requires updating those expectations. Mention that step in the authoring checklist or scaffold completion message. This is optional because the stated scaffold acceptance criterion requires its generated test to pass, not automatic maintenance of every existing catalog assertion.

Score

The implementation is well scoped and has substantial coverage and green checks, but its compatibility guarantee and scaffold output need localized corrections before merge.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 2m 8s
  • Tokens: 115,140 (114,021 in / 1,119 out)
  • Cost: $1.07

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F1 F2 S1

🤖 Review by ProPR

@integry

integry commented Nov 17, 2026

Copy link
Copy Markdown
Owner

/fix

@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit fa77a8e

Addressed 1 AI review comment (IDs: 6939925068)

Addressed findings F1, F2

Summary of Changes

I fixed both findings. The plugin contract test now reads the real TypeScript interfaces, so changing a field or method type in the source fails it. The scaffold now writes front matter that stays valid YAML when a name or description has quotes or backslashes.

F1: contract bound to the real types

  • How it reads the source: a new helper, packages/shared/test/support/pluginContractSource.ts, reads the payload and SDK interfaces with the TypeScript compiler.

  • Payloads: each field's real type is turned into the same short form pluginContract.ts uses (number | null, string[], …), inherited fields included. A new test fails if the hand-written PLUGIN_EVENT_PAYLOAD_FIELDS or PLUGIN_EVENT_ENVELOPE_FIELDS differ from the interfaces.

  • SDK: the contract has a new sdk.types section. It records the declared type of every ctx member, every ctx.state and ctx.propr method (parameters and result), every input envelope field, and the shared types they lead to (PluginPullRequestSummary and the like). comparePluginContract reports a changed or removed entry as breaking and a new one as an addition.

  • Snapshot: npm run plugins:contract:update now builds the snapshot from the source. It refuses to write if the hand-written descriptors disagree with the interfaces. I regenerated the snapshot; the only change is the new sdk.types section.

  • Regression tests: these edit the real source text in memory and then compare with the committed snapshot:

    • score: number → string
    • an inherited task field and an envelope field retyped
    • PluginStateStore.set gets a new parameter type
    • PluginStateStore.delete gets a new result type
    • keys is removed
    • getTask gets a new parameter list
    • PluginPullRequestSummary.draft, a type that getPullRequest returns, is retyped

    The earlier fixture now also includes a changed and a removed SDK type. I updated the compatibility section of the authoring guide to say how the test reads the source.

F2: escaped front matter

  • docsPageFor in scripts/new-plugin.mjs now writes the label, title and description as JSON strings, which YAML reads back exactly.
  • The new test in test/newPlugin.test.mjs scaffolds a plugin named Acme "Chat" \ Ops with a description full of quotes and backslashes. It parses the front matter strictly and checks the values come back unchanged. It also checks that plugins:check and the docs drift check still pass. With the old new-plugin.mjs this test fails with a YAML parse error.
  • I also loaded the output with js-yaml, which the docs site uses to read front matter, and it parsed correctly. The catalog page's front matter is fixed text, so it doesn't have this problem.

What I ran: the contract tests (13 pass, about 9 s, of which reading the sources takes about 2.5 s), the scaffold and docs-generator tests (12 pass), plugins:check, plugins:docs:check, the shared package typecheck, and a typecheck of the new test files. I did not run the full repository suite or a Docusaurus build.

Still unbound or approximate (I didn't change these):

  • Some events have no payload interface in packages/shared: pull_request.opened, head_changed, auto_merge_decision, merged, closed, and epic_queue.started and completed. Their descriptors are still hand-written, because core builds those payloads without a shared type.
  • SDK types are compared as exact text. So a change that is actually safe, like widening a parameter type, is reported as breaking and needs --accept-breaking.
  • A new required field in a type the plugin builds itself (PluginListEventsInput, PluginHttpRequestInit) is reported as an addition, although it would break existing plugins.

No visual preview this time; the only visible change is a few sentences in the guide.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (3 files)
    • packages/shared/src/pluginContract.ts (+26/−3)
    • scripts/new-plugin.mjs (+10/−3)
    • scripts/update-plugin-contract.mjs (+9/−2)
  • Low risk (7 files)
    • docs/docs/plugins/authoring.md (+7/−3)
    • packages/shared/test/contracts/plugin-contract.snapshot.json (+121/−1)
    • packages/shared/test/fixtures/plugin-contract/README.md (+1/−1)
    • packages/shared/test/fixtures/plugin-contract/breaking-previous.json (+6/−1)
    • packages/shared/test/pluginContract.test.ts (+66/−9)
    • packages/shared/test/support/pluginContractSource.ts (added, +207/−0)
    • test/newPlugin.test.mjs (+25/−0)

Validation evidence

  • No repository validation commands ran.

Diff size: 10 files changed, +478/−23 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 10m 16s
  • Tokens: 3,494,325 (3,459,811 in / 34,514 out)
  • Cost: $1.96
  • Subscription usage: Weekly +1%

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6942538245✓

…he real TypeScript interfaces, so changing a field or method type in the source fails it. The scaffold now writes front matter that stays valid YAML when a name or description has quotes or backslashes.

I fixed both findings. The plugin contract test now reads the real TypeScript interfaces, so changing a field or method type in the source fails it. The scaffold now writes front matter that stays valid YAML when a name or description has quotes or backslashes.

**F1: contract bound to the real types**
- **How it reads the source:** a new helper, `packages/shared/test/support/pluginContractSource.ts`, reads the payload and SDK interfaces with the TypeScript compiler.
- **Payloads:** each field's real type is turned into the same short form `pluginContract.ts` uses (`number | null`, `string[]`, …), inherited fields included. A new test fails if the hand-written `PLUGIN_EVENT_PAYLOAD_FIELDS` or `PLUGIN_EVENT_ENVELOPE_FIELDS` differ from the interfaces.
- **SDK:** the contract has a new `sdk.types` section. It records the declared type of every `ctx` member, every `ctx.state` and `ctx.propr` method (parameters and result), every input envelope field, and the shared types they lead to (`PluginPullRequestSummary` and the like). `comparePluginContract` reports a changed or removed entry as breaking and a new one as an addition.
- **Snapshot:** `npm run plugins:contract:update` now builds the snapshot from the source. It refuses to write if the hand-written descriptors disagree with the interfaces. I regenerated the snapshot; the only change is the new `sdk.types` section.
- **Regression tests:** these edit the real source text in memory and then compare with the committed snapshot:
  - `score: number` → `string`
  - an inherited task field and an envelope field retyped
  - `PluginStateStore.set` gets a new parameter type
  - `PluginStateStore.delete` gets a new result type
  - `keys` is removed
  - `getTask` gets a new parameter list
  - `PluginPullRequestSummary.draft`, a type that `getPullRequest` returns, is retyped

  The earlier fixture now also includes a changed and a removed SDK type. I updated the compatibility section of the authoring guide to say how the test reads the source.

**F2: escaped front matter**
- `docsPageFor` in `scripts/new-plugin.mjs` now writes the label, title and description as JSON strings, which YAML reads back exactly.
- The new test in `test/newPlugin.test.mjs` scaffolds a plugin named `Acme "Chat" \ Ops` with a description full of quotes and backslashes. It parses the front matter strictly and checks the values come back unchanged. It also checks that `plugins:check` and the docs drift check still pass. With the old `new-plugin.mjs` this test fails with a YAML parse error.
- I also loaded the output with js-yaml, which the docs site uses to read front matter, and it parsed correctly. The catalog page's front matter is fixed text, so it doesn't have this problem.

**What I ran:** the contract tests (13 pass, about 9 s, of which reading the sources takes about 2.5 s), the scaffold and docs-generator tests (12 pass), `plugins:check`, `plugins:docs:check`, the shared package typecheck, and a typecheck of the new test files. I did not run the full repository suite or a Docusaurus build.

**Still unbound or approximate (I didn't change these):**
- Some events have no payload interface in `packages/shared`: `pull_request.opened`, `head_changed`, `auto_merge_decision`, `merged`, `closed`, and `epic_queue.started` and `completed`. Their descriptors are still hand-written, because core builds those payloads without a shared type.
- SDK types are compared as exact text. So a change that is actually safe, like widening a parameter type, is reported as breaking and needs `--accept-breaking`.
- A new required field in a type the plugin builds itself (`PluginListEventsInput`, `PluginHttpRequestInit`) is reported as an addition, although it would break existing plugins.

No visual preview this time; the only visible change is a few sentences in the guide.

PR: #3645
Comment by: @integry (ID: 6942538245)
Model: Claude Opus 5.5
@propr-dev propr-dev Bot changed the title 🔨 [3561 by Claude Opus 5.5] Plugin authoring guide, scaffold command and compatibility rules for official plugins ⚠️⑥ [3561 by Claude Opus 5.5] Plugin authoring guide, scaffold command and compatibility rules for official plugins Nov 17, 2026
@integry

integry commented Nov 17, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev propr-dev Bot changed the title ⚠️⑥ [3561 by Claude Opus 5.5] Plugin authoring guide, scaffold command and compatibility rules for official plugins 🔨 [3561 by Claude Opus 5.5] Plugin authoring guide, scaffold command and compatibility rules for official plugins Nov 17, 2026
@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR provides the scaffold, generated documentation, compatibility checks, and read-only CLI commands. It needs localized corrections to the compatibility checker before merge.

✅ CLI matches the API — List and detail commands consume the existing response envelopes and test authentication failures, missing plugins, and JSON output.

✅ Documentation drift is checked — CI checks the reference, catalog, schema, and sidebar, with tests covering stale generated files.

✅ Scaffold validation is substantive — Tests exercise generated handlers through lint, typechecking, manifest validation, and the plugin test kit.

The supplied current-head status reports 35 passed checks and no failures or pending checks. This review used static analysis only; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F3: 🔴 Reject newly required SDK input properties

  • Category: correctness

  • Required behavior: The compatibility checker must reject SDK changes that break existing plugin callers; the update command must refuse breaking changes without --accept-breaking.

  • Evidence: packages/shared/src/pluginContract.ts, comparePluginContract SDK types comparison; packages/shared/test/support/pluginContractSource.ts, sdkTypes.

    1. Add a required cursor: number property to PluginListEventsInput, which is accepted by ctx.propr.listEvents.
    2. The source walker records a new PluginListEventsInput.cursor entry. The existing method signature remains (input: PluginListEventsInput) => Promise<RepositoryEvent[]>.
    3. The comparison classifies every new type-map entry as an addition, producing no breaking finding for this change.
    4. plugins:contract:update consequently accepts it without --accept-breaking, although existing plugins calling listEvents({ repository }) no longer typecheck.

    The snapshot equality test initially detects drift, but the normal update command clears that failure while incorrectly accepting the breaking change. static trace: followed source extraction, comparison, and the update script’s breaking-change gate; this mutation was not executed.

  • Minimum fix: Track required additions to SDK objects supplied by plugin callers and reject them as breaking. Add a regression covering a required property added to PluginListEventsInput, alongside an optional-property addition that remains compatible.

F4: 🔴 Detect newly imposed enum restrictions

  • Category: correctness

  • Required behavior: Breaking manifest changes must require a new manifest version; the contract update command must refuse them at the existing version.

  • Evidence: packages/shared/src/pluginContract.ts, compareManifest enum comparisons.

    1. Restrict an existing unrestricted string field, such as name, to a string enum while keeping the manifest version unchanged.
    2. Its recorded type remains string and its requiredness remains unchanged; only the new contract has an enum.
    3. The removal loop examines field.enum ?? [], which is empty. The addition loop also requires field.enum, so neither loop reports the restriction.
    4. The update command accepts the new snapshot without --accept-breaking, although previously valid names outside that enum are now rejected.

    Existing snapshot equality catches drift only until the ordinary update command records it. The same comparison gap applies to unrestricted string-array items becoming enum-restricted. static trace: inspected enumOf, contract construction, both enum loops, and the update gate; no mutation was executed.

  • Minimum fix: Report an unrestricted-to-enum transition as breaking for scalar fields and array items. Test both transitions and retain compatibility for removing an enum restriction.

Suggestions

These are optional follow-ups and are not sent to /fix.

S2: 🟢 Validate scaffold options before writing

scaffoldPlugin validates the ID and category before writing, but validates the complete manifest only during subsequent documentation generation. An empty name or oversized description can therefore leave an invalid plugin registered after the command fails. Prevalidating the manifest would improve recovery from invalid author input; this is optional usability work.

S3: 🟢 Explain the registry test update

The existing registry tests pin the official plugin list, so adding a scaffold requires updating those expectations. Mentioning that step in the generated next-step message and authoring checklist would make the contributor workflow clearer. The explicitly promised scaffold checks remain independently covered.

Score

The implementation is well covered and current checks pass, but two compatibility-classification gaps allow breaking changes through the ordinary snapshot update workflow. Both corrections can remain localized.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 26s
  • Tokens: 123,447 (122,121 in / 1,326 out)
  • Cost: $1.18

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F3 F4 S2 S3

🤖 Review by ProPR

@propr-dev propr-dev Bot changed the title 🔨 [3561 by Claude Opus 5.5] Plugin authoring guide, scaffold command and compatibility rules for official plugins ⚠️⑥ [3561 by Claude Opus 5.5] Plugin authoring guide, scaffold command and compatibility rules for official plugins Nov 17, 2026
@integry

integry commented Nov 17, 2026

Copy link
Copy Markdown
Owner

/ultrafix

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /fix

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev propr-dev Bot changed the title ⚠️⑥ [3561 by Claude Opus 5.5] Plugin authoring guide, scaffold command and compatibility rules for official plugins 🔨 [3561 by Claude Opus 5.5] Plugin authoring guide, scaffold command and compatibility rules for official plugins Nov 17, 2026
@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit b2d95a5

Addressed 1 AI review comment (IDs: 6943989462)

Addressed findings F3, F4

Summary of Changes

I fixed F3 and F4. The contract test passes (15 of 15) and plugins:docs:check passes. I also checked both fixes the other way round: with the new comparison lines switched off, the two new tests fail.

F3: required properties added to SDK inputs

  • What was wrong: the checker counted every new SDK member as an addition. It couldn't tell objects that ProPR hands to plugins from objects that plugins build and pass in.
  • Which objects count as passed in: the source reader in packages/shared/test/support/pluginContractSource.ts now marks a type as passed in when it is reached through a function parameter. A callback's own parameter flips back, so the value ProPR passes to a plugin's callback still counts as handed to the plugin. Today that marks three interfaces: PluginListEventsInput, PluginHttpRequestInit (the init of the function ctx.http() returns) and PluginHttpSignature. They are recorded in a new sdk.suppliedTypes field, and I regenerated the snapshot to include it.
  • The new rule: in packages/shared/src/pluginContract.ts, a new required member of one of those interfaces is now a breaking change. A new optional member, or any new member of an interface plugins only receive, is still an addition.
  • Tests:
    • cursor: number on PluginListEventsInput is breaking.
    • cursor?: number is not.
    • A required field on PluginHttpRequestInit is breaking.
    • A new required field on PluginCreatedIssue, which plugins only receive, is not.
  • The update command: I made the cursor: number change for real and ran npm run plugins:contract:update. It refused with that breaking change and left the snapshot as it was.

F4: unrestricted fields gaining an enum

  • compareManifest now reports a breaking change when a field with no enum gains one, for example "field name now only accepts …". This covers single-value fields and string lists, since a list's allowed item values are stored on the field itself.
  • Removing an enum is still compatible.
  • The tests cover name and the string list connections[]{type=oauth}.scopes, plus the reverse, where removing the enum breaks nothing.

The "Compatibility rules" section of docs/docs/plugins/authoring.md and the module comment in pluginContract.ts now state both rules. The shared sources and both test files typecheck. The root ESLint config doesn't cover packages/shared, so those files had no lint run, and I didn't run the full repository suite. These changes aren't visible in the UI, so I made no previews.

One thing I found and left alone: the checker records optional members under a different name (cursor?), so making a required member of a passed-in object optional shows up as a removal and is flagged as breaking. That change is actually compatible, so the check is too strict there, but it doesn't let a real breaking change through.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • packages/shared/src/pluginContract.ts (+22/−4)
  • Low risk (4 files)
    • docs/docs/plugins/authoring.md (+4/−2)
    • packages/shared/test/contracts/plugin-contract.snapshot.json (+6/−1)
    • packages/shared/test/pluginContract.test.ts (+34/−0)
    • packages/shared/test/support/pluginContractSource.ts (+32/−17)

Validation evidence

  • No repository validation commands ran.

Diff size: 5 files changed, +98/−24 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 12m 36s
  • Tokens: 1,790,572 (1,775,749 in / 14,823 out)
  • Cost: $1.03
  • Subscription usage: Weekly +1%, Fable +1%

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6944339213✓

…`plugins:docs:check` passes. I also checked both fixes the other way round: with the new comparison lines switched off, the two new tests fail.

I fixed F3 and F4. The contract test passes (15 of 15) and `plugins:docs:check` passes. I also checked both fixes the other way round: with the new comparison lines switched off, the two new tests fail.

**F3: required properties added to SDK inputs**
- **What was wrong:** the checker counted every new SDK member as an addition. It couldn't tell objects that ProPR hands to plugins from objects that plugins build and pass in.
- **Which objects count as passed in:** the source reader in `packages/shared/test/support/pluginContractSource.ts` now marks a type as passed in when it is reached through a function parameter. A callback's own parameter flips back, so the value ProPR passes to a plugin's callback still counts as handed to the plugin. Today that marks three interfaces: `PluginListEventsInput`, `PluginHttpRequestInit` (the `init` of the function `ctx.http()` returns) and `PluginHttpSignature`. They are recorded in a new `sdk.suppliedTypes` field, and I regenerated the snapshot to include it.
- **The new rule:** in `packages/shared/src/pluginContract.ts`, a new required member of one of those interfaces is now a breaking change. A new optional member, or any new member of an interface plugins only receive, is still an addition.
- **Tests:**
  - `cursor: number` on `PluginListEventsInput` is breaking.
  - `cursor?: number` is not.
  - A required field on `PluginHttpRequestInit` is breaking.
  - A new required field on `PluginCreatedIssue`, which plugins only receive, is not.
- **The update command:** I made the `cursor: number` change for real and ran `npm run plugins:contract:update`. It refused with that breaking change and left the snapshot as it was.

**F4: unrestricted fields gaining an enum**
- `compareManifest` now reports a breaking change when a field with no enum gains one, for example "field name now only accepts …". This covers single-value fields and string lists, since a list's allowed item values are stored on the field itself.
- Removing an enum is still compatible.
- The tests cover `name` and the string list `connections[]{type=oauth}.scopes`, plus the reverse, where removing the enum breaks nothing.

The "Compatibility rules" section of `docs/docs/plugins/authoring.md` and the module comment in `pluginContract.ts` now state both rules. The shared sources and both test files typecheck. The root ESLint config doesn't cover `packages/shared`, so those files had no lint run, and I didn't run the full repository suite. These changes aren't visible in the UI, so I made no previews.

One thing I found and left alone: the checker records optional members under a different name (`cursor?`), so making a required member of a passed-in object optional shows up as a removal and is flagged as breaking. That change is actually compatible, so the check is too strict there, but it doesn't let a real breaking change through.

PR: #3645
Comment by: @integry (ID: 6944339213)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

🔀 Resolved merge conflicts from 3542-epic-plugin-system-xu8 into 3561/claude-opus-5-5-plugin-authoring-guide-sc-20261117-0455-agt in commit 63398c8

Conflicting Files

  • docs/sidebars.ts

Resolution Summary

I resolved the one conflict, in docs/sidebars.ts, and no conflict markers are left anywhere. The merge also broke two of this PR's CI checks without causing conflicts, so I fixed those as well.

The conflict in docs/sidebars.ts. Both branches changed the list of pages under the Plugins section of the docs sidebar:

  • This PR replaced the hand-written list with ...officialPluginPages. That list is read from docs/plugin-pages.json, which npm run plugins:docs generates from packages/plugins/registry.json. The PR also added plugins/authoring.
  • The epic branch kept the hand-written list and added plugins/cloudflare and plugins/vercel.

How I resolved it: I kept this PR's version and dropped the hand-written list. Cloudflare and Vercel are already in the merged registry.json, so I reran npm run plugins:docs and they now appear in plugin-pages.json. The generated catalog page also now lists 10 plugins, including a new "Deployment" category. I loaded the sidebar to check it: the Plugins section lists the webhooks through notion pages, then cloudflare and vercel, then the authoring guide.

Why: the point of this PR is that the docs come from the registry and CI checks they are current. Re-adding hand-written entries would undo that, and generating the list keeps the epic's two new pages.

Two checks the merge broke without a conflict. The epic added new manifest fields: autoApply on MCP servers, and promptSettings (with setting, on and off) on commands. This PR's tooling treats unknown fields as errors:

  1. plugins:docs:check failed because the generator requires a description for every field. I added the six descriptions to scripts/plugin-manifest-descriptions.mjs, worded from the schema comments in packages/shared/src/plugins.ts. I then regenerated authoring.md, catalog.md, plugin-pages.json and docs/static/schemas/plugin-manifest.v1.schema.json.
  2. The plugin contract test failed with "The plugin interface grew". I recorded the new fields with npm run plugins:contract:update, which updated packages/shared/test/contracts/plugin-contract.snapshot.json. The test only reported fields being added, so nothing that existed before changed.

Checks run after the fixes:

  • plugins:docs:check passes and plugins:check passes (11 plugins).
  • The shared plugin and contract tests pass (39 of 39), as do packages/plugins/test (136 of 136).
  • I did not run a full Docusaurus build or the full repository suite.

🤖 Resolution Details

  • Model: Claude Opus 5.5
  • Time: 9m 58s

View Task Execution


System-triggered merge conflict resolution

…laude-opus-5-5-plugin-authoring-guide-sc-20261117-0455-agt

Automatically resolved merge conflicts after merging target branch into PR branch.
Resolved conflicts in:
- docs/sidebars.ts

PR: #3645
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

🔀 Auto-merged 3542-epic-plugin-system-xu8 into 3561/claude-opus-5-5-plugin-authoring-guide-sc-20261117-0455-agt (clean merge) in commit 63398c8

No conflicts were found — the merge was verified by an AI agent.


🤖 Verification Details

  • Model: Claude Opus 5.5
  • Time: 7m 12s

View Task Execution


System-triggered merge conflict resolution

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate unsigned linux-x64 package

Please investigate and fix this CI failure.

  • Check: Validate unsigned linux-x64 package
  • Result: failure
  • Commit: 63398c82cab2 (63398c82cab2b7338bde77aef4415fb817ebc91e)
  • Details: View CI failure

Failure evidence

.github:9587
Process completed with exit code 1.

@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

ℹ️ Analyzed the follow-up request by @propr-dev[bot]

Analysis Summary

This looks like a one-off flake, not something this PR broke, so I made no code changes. Re-running the job should clear it.

What failed: 1 of 1,439 tests in "Typecheck and test unsigned desktop runtime". The test was unterminated disposable public armor imports into a fresh RPM database through withKey in apps/desktop/scripts/rpm-signing.test.mjs:235. It broke during setup, before checking anything: the helper that makes a throwaway GnuPG test key (rpm-signing.test.mjs:29) got this error back from GnuPG:

gpg: signing failed: Corrupted protection
gpg: key generation failed: Corrupted protection

Why I think it's a flake:

  • This PR doesn't touch that test file or the code it tests.
  • Other tests in the same run made keys with the same helper and passed.
  • This job passed in about 55 other runs of "Desktop Package and Release" today. That includes this branch at 08:25 UTC and its base branch, 3542-epic-plugin-system-xu8, at 09:59 UTC.
  • The runner image was the usual ubuntu-24.04, so it isn't the rpm 6 change that broke these tests on 2026-11-14.

I couldn't reproduce it locally because GnuPG isn't installed in this container. If it fails the same way again, the next step would be a bounded retry around the key generation in that helper.

The whole run now shows as cancelled, so it needs a fresh run, either by re-running that job or with the next push.

No code changes were necessary based on the current state of the branch.


🤖 Analysis Details

  • Model: Claude Opus 5.5 (medium)
  • Time: 6m 54s
  • Tokens: 615,197 (611,388 in / 3,809 out)
  • Cost: $0.48

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6945548116✓

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR delivers the scaffold, generated documentation, CLI commands, and substantial compatibility coverage. It needs a localized correction before merge: the event contract extractor loses type information that can conceal a breaking payload change.

✅ Read-only CLI integration — List and detail commands match the supplied API response envelopes and include tests for authorization failures, unknown plugins, and JSON output.

✅ Documentation drift checks — CI checks the generated reference, catalog, schema, and sidebar; tests exercise stale files and missing plugin pages.

✅ Scaffold validation — Integration tests check generated handlers against the plugin lint configuration, type checker, and test kit.

The supplied current-head status reports 35 passed checks and 12 neutral/skipped checks, with no failures. This review used static analysis only; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F5: 🔴 Preserve undefined in payload contracts

  • Category: correctness

  • Required behavior: AC3 and the documented compatibility guarantee require contract tests to detect breaking event payload type changes.

  • Evidence: packages/shared/test/support/pluginContractSource.ts, descriptor and fieldDescriptors.

    1. Change the required ReviewScoredEventPayload.score declaration from number to number | undefined, leaving its property name and required status unchanged.
    2. fieldDescriptors still records the key as score, because the property has no optional marker.
    3. descriptor explicitly removes Undefined union members, reducing the changed type back to number.
    4. Both the descriptor consistency check and the snapshot comparison therefore see the original contract. The new declaration permits an undefined score despite the documented guarantee that consumers receive a number.

    The compile-time key checks also remain satisfied. The SDK traversal does not independently capture this payload interface: RepositoryEvent.payload is Record<string, unknown>. Existing mutation tests exercise string and null changes, which survive normalization, but not undefined.

    static trace: traced the supplied extractor, source-contract assembly, snapshot, and comparison tests; this scenario was not executed.

  • Minimum fix: Preserve undefined in required-property type descriptors, or explicitly reject required payload properties whose declared types include undefined. Add a source-override regression showing that score: number | undefined fails compatibility validation.

Suggestions

These are optional follow-ups and are not sent to /fix.

S4: 🟢 Validate before scaffold writes

scripts/new-plugin.mjs validates the ID and category before writing, but validates the completed manifest only indirectly through documentation generation afterward. An empty or overlong --name or --description can therefore leave an invalid registered plugin after the command fails. Pre-validating the constructed manifest would improve recovery from invalid arguments; this is optional usability hardening for the local authoring command.

S5: 🟢 Document registry test updates

The supplied packages/plugins/test/registry.test.ts pins the official plugin list. The authoring guide could mention updating those assertions when adding a plugin, since the scaffold changes the registry but does not update them. This would clarify the contribution workflow without expanding the scaffold’s stated acceptance criteria.

Score

The implementation is well scoped and has substantial test coverage and passing current-head checks. One compatibility enforcement gap remains and should be corrected before merge.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 48s
  • Tokens: 125,985 (125,048 in / 937 out)
  • Cost: $1.19

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F5 S4 S5

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 9376d5d

Addressed 1 AI review comment (IDs: 6946390723)

Addressed finding F5

Summary of Changes

I fixed F5. A required payload or envelope field that is changed to also allow undefined now fails the contract check. The contract test passes (16 of 16, one more than before), plugins:docs:check passes and the test file type-checks. I didn't run the full repository suite.

The fix, in packages/shared/test/support/pluginContractSource.ts: when the checker reduced a field's type to a descriptor, it used to drop undefined from every union. Now it keeps it, written after null (for example number | null | undefined). It still drops it for optional properties, because there the compiler adds undefined itself and the ? on the key already records that the field can be missing. Array item types keep undefined the same way.

The committed snapshot and the descriptors in pluginContract.ts didn't need to change. None of the current required fields include undefined, so the snapshot and consistency tests still pass as they are.

Regression test, in packages/shared/test/pluginContract.test.ts. It edits the real source and checks four cases:

  • ReviewScoredEventPayload.score: number | undefined causes a mismatch with PLUGIN_EVENT_PAYLOAD_FIELDS and the breaking change "field score changed type from number to number | undefined".
  • goal: number | null | undefined is also reported as breaking. The existing tests already covered null, but not undefined added on top of it.
  • RepositoryEvent.seq: number | undefined on the event envelope (one of the other places the same code reads) causes an envelope mismatch and is reported as breaking.
  • A new optional rank?: number | undefined is recorded as rank?: number and is not reported as breaking.

With the old descriptor logic put back, the new test fails.

Nothing changed is visible to users, so I made no previews.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk: none
  • Low risk (2 files)
    • packages/shared/test/pluginContract.test.ts (+15/−0)
    • packages/shared/test/support/pluginContractSource.ts (+9/−4)

Validation evidence

  • No repository validation commands ran.

Diff size: 2 files changed, +24/−4 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 5m 5s
  • Tokens: 552,921 (548,369 in / 4,552 out)
  • Cost: $0.46
  • Subscription usage: Weekly +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…anged to also allow `undefined` now fails the contract check. The contract test passes (16 of 16, one more than before), `plugins:docs:check` passes and the test file type-checks. I didn't run the full repository suite.

I fixed F5. A required payload or envelope field that is changed to also allow `undefined` now fails the contract check. The contract test passes (16 of 16, one more than before), `plugins:docs:check` passes and the test file type-checks. I didn't run the full repository suite.

**The fix**, in `packages/shared/test/support/pluginContractSource.ts`: when the checker reduced a field's type to a descriptor, it used to drop `undefined` from every union. Now it keeps it, written after `null` (for example `number | null | undefined`). It still drops it for optional properties, because there the compiler adds `undefined` itself and the `?` on the key already records that the field can be missing. Array item types keep `undefined` the same way.

The committed snapshot and the descriptors in `pluginContract.ts` didn't need to change. None of the current required fields include `undefined`, so the snapshot and consistency tests still pass as they are.

**Regression test**, in `packages/shared/test/pluginContract.test.ts`. It edits the real source and checks four cases:
- `ReviewScoredEventPayload.score: number | undefined` causes a mismatch with `PLUGIN_EVENT_PAYLOAD_FIELDS` and the breaking change "field score changed type from number to number | undefined".
- `goal: number | null | undefined` is also reported as breaking. The existing tests already covered `null`, but not `undefined` added on top of it.
- `RepositoryEvent.seq: number | undefined` on the event envelope (one of the other places the same code reads) causes an envelope mismatch and is reported as breaking.
- A new optional `rank?: number | undefined` is recorded as `rank?: number` and is not reported as breaking.

With the old descriptor logic put back, the new test fails.

Nothing changed is visible to users, so I made no previews.

PR: #3645
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements the scaffold, generated documentation, compatibility checks, and read-only CLI commands with substantial focused coverage. It needs localized corrections before merge.

✅ CLI matches the API — The wrappers use the existing GET routes and response envelopes, with tests covering administrator refusal, missing plugins, and JSON output.

✅ Documentation drift detection — CI checks generated references, catalog, schema, and sidebar entries; tests demonstrate stale-file and missing-page failures.

The supplied current-head status reports 34 passed checks, one pending, and no failures. This review used static analysis only; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F6: 🔴 Escape manifest text in generated MDX

  • Category: correctness

  • Required behavior: The scaffold must produce usable documentation from valid plugin metadata; generated catalog content must remain valid MDX.

  • Evidence: scripts/new-plugin.mjs:docsPageFor and scripts/gen-plugin-docs.mjs:catalogPage

    1. Run the scaffold with a valid name such as --name "Acme <Cloud>", or a valid description containing Supports <widgets>.
    2. Front matter is safely quoted, but the name is inserted verbatim into the page heading and prose. Catalog names and descriptions are also inserted verbatim.
    3. MDX interprets <Cloud> or <widgets> as JSX rather than literal text. The unclosed element makes the generated documentation fail compilation.

    Manifest validation permits these strings. The catalog's cell helper escapes pipes and newlines only, and category lists bypass that helper. The added escaping test parses YAML without compiling the generated MDX, so it does not protect this path. Verification provenance: static trace; proposed regression: compile scaffolded pages and catalog entries containing angle brackets and braces.

  • Minimum fix: Escape metadata for its Markdown/MDX context in generated page bodies, link labels, table cells, and category lists, and add a compilation regression covering valid metadata with MDX-sensitive characters.

F7: 🔴 Snapshot exported SDK signatures

  • Category: requirement

  • Required behavior: AC3 requires contract tests for the SDK surface that fail on breaking changes.

  • Evidence: packages/shared/test/support/pluginContractSource.ts:SDK_ROOTS, sdkTypes, and packages/shared/src/pluginContract.ts:buildPluginContract

    1. An SDK maintainer changes the required arguments or return type of the exported definePluginHandler helper while preserving its export name.
    2. The source walker starts exclusively from context and input interfaces and follows only interfaces and type aliases. It never records that exported function's signature.
    3. The runtime export comparison still sees definePluginHandler, and the generated contract remains unchanged. The compatibility check therefore accepts an SDK change that can break plugin authors' calls.

    The same omission applies to exported error-class constructors and other runtime helpers outside the reachable interface graph. Existing mutation tests exercise context methods and their referenced types, not these exports. Verification provenance: static trace; this is a concrete coverage gap in the requested compatibility guard, not a claim that those signatures changed in this PR.

  • Minimum fix: Record and compare public runtime function signatures and exported class constructors/members, with source-mutation regressions demonstrating detection of incompatible changes.

Suggestions

These are optional follow-ups and are not sent to /fix.

S6: 🟢 Document the registry test update

The scaffold registers a new official plugin, but the existing registry tests pin the complete catalog. Mention the required expectation update in the generated next steps and authoring guide. This is optional because AC1 specifically requires the generated test to pass, rather than every existing registry test.

Score

The implementation is well covered and current checks are encouraging, but valid metadata can break generated documentation and the compatibility guard misses part of the public SDK surface.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 8s
  • Tokens: 126,587 (125,396 in / 1,191 out)
  • Cost: $1.18

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F6 F7 S6

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 8844fa3

Addressed 1 AI review comment (IDs: 6946982020)

Addressed findings F6, F7

Summary of Changes

I fixed F6 and F7. The contract test now passes 18 of 18, up from 16. The scaffold and docs-generator tests pass 14 of 14, plugins:docs:check passes, and the changed files type-check and lint clean. I didn't run the full repository suite.

F6: manifest text in generated MDX

  • There is a new mdxText helper in scripts/gen-plugin-docs.mjs. It puts a manifest's name or description on one line and backslash-escapes every character Markdown or MDX would read as syntax, such as <, { and *. Table pipes are still escaped by cell.
  • The catalog uses it in table cells, link labels and the "By category" list. The scaffolded docs page (scripts/new-plugin.mjs) uses it in the heading and both bold mentions. Front matter still uses the existing YAML quoting.
  • The checked-in plugin docs are unchanged, because no official plugin has any of these characters.
  • New tests in test/newPlugin.test.mjs scaffold a plugin named Acme <Cloud> {beta} with a description containing <widgets>, {templates}, *every*, [team] and &. One test checks the exact escaped text in the page and the catalog. The other compiles both pages with Docusaurus's MDX compiler, and first checks that the unescaped heading does not compile.
  • Decision for you: the MDX compiler is only installed with the docs dependencies. Without them that second test is skipped (with a message), so CI probably skips it in the root suite; the escaped-text test still runs. The alternative is adding @mdx-js/mdx to the root dev dependencies, which changes the root lockfile. I didn't do that.
  • With the escaping switched off, both new tests fail.

F7: exported SDK functions and classes

  • The contract walk in packages/shared/test/support/pluginContractSource.ts now also records what the SDK module exports at runtime:
    • Functions, as definePluginHandler(), parsePluginRetryAfter() and so on, each with its signature.
    • Classes, as PluginSdkError.constructor, .code, .name and extends Error, and the same for PluginDeliveryError.
    • Any shared type those signatures name, such as PluginHandler, PluginWebhookRequest and PluginWebhookResponse.
  • Any change to one of these is reported as breaking. I recorded the new entries with plugins:contract:update; they are all additions, so nothing breaking was accepted.
  • One bug turned up while doing this. definePluginHandler returns its handler to ProPR, not to the plugin. Treated like any other return value, it made PluginContext and the other context types look like things plugins build, which would have wrongly flagged new required members on them as breaking. Return types are now recorded without that marking. The only new plugin-built type is PluginWebhookResponse, which a plugin's webhook responder does return.
  • New tests change a helper's arguments, a function's return type, a type only a helper reaches, an export removed, the error-class constructors (an option made required, parameters reordered), the code property dropped, a member retyped, and extends Error removed. Each is reported as breaking, and both tests fail with the export walk switched off.

Separate finding, not fixed: the scaffolded README.md also puts the name in verbatim. It is ordinary GitHub Markdown rather than MDX, so it doesn't break the docs build, but GitHub would hide a name like <Cloud> as an HTML tag. It is outside F6's scope.

There is no preview: the checked-in docs look the same as before.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (3 files)
    • packages/shared/src/pluginContract.ts (+3/−1)
    • scripts/gen-plugin-docs.mjs (+9/−2)
    • scripts/new-plugin.mjs (+6/−4)
  • Low risk (4 files)
    • packages/shared/test/contracts/plugin-contract.snapshot.json (+32/−2)
    • packages/shared/test/pluginContract.test.ts (+37/−0)
    • packages/shared/test/support/pluginContractSource.ts (+89/−7)
    • test/newPlugin.test.mjs (+44/−2)

Validation evidence

  • No repository validation commands ran.

Diff size: 7 files changed, +220/−18 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 12m 37s
  • Tokens: 3,468,971 (3,442,491 in / 26,480 out)
  • Cost: $1.72
  • Subscription usage: Weekly +1%, Fable +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…p from 16. The scaffold and docs-generator tests pass 14 of 14, `plugins:docs:check` passes, and the changed files type-check and lint clean. I didn't run the full repository suite.

I fixed F6 and F7. The contract test now passes 18 of 18, up from 16. The scaffold and docs-generator tests pass 14 of 14, `plugins:docs:check` passes, and the changed files type-check and lint clean. I didn't run the full repository suite.

**F6: manifest text in generated MDX**
- There is a new `mdxText` helper in `scripts/gen-plugin-docs.mjs`. It puts a manifest's name or description on one line and backslash-escapes every character Markdown or MDX would read as syntax, such as `<`, `{` and `*`. Table pipes are still escaped by `cell`.
- The catalog uses it in table cells, link labels and the "By category" list. The scaffolded docs page (`scripts/new-plugin.mjs`) uses it in the heading and both bold mentions. Front matter still uses the existing YAML quoting.
- The checked-in plugin docs are unchanged, because no official plugin has any of these characters.
- New tests in `test/newPlugin.test.mjs` scaffold a plugin named `Acme <Cloud> {beta}` with a description containing `<widgets>`, `{templates}`, `*every*`, `[team]` and `&`. One test checks the exact escaped text in the page and the catalog. The other compiles both pages with Docusaurus's MDX compiler, and first checks that the unescaped heading does not compile.
- **Decision for you:** the MDX compiler is only installed with the docs dependencies. Without them that second test is skipped (with a message), so CI probably skips it in the root suite; the escaped-text test still runs. The alternative is adding `@mdx-js/mdx` to the root dev dependencies, which changes the root lockfile. I didn't do that.
- With the escaping switched off, both new tests fail.

**F7: exported SDK functions and classes**
- The contract walk in `packages/shared/test/support/pluginContractSource.ts` now also records what the SDK module exports at runtime:
  - Functions, as `definePluginHandler()`, `parsePluginRetryAfter()` and so on, each with its signature.
  - Classes, as `PluginSdkError.constructor`, `.code`, `.name` and `extends Error`, and the same for `PluginDeliveryError`.
  - Any shared type those signatures name, such as `PluginHandler`, `PluginWebhookRequest` and `PluginWebhookResponse`.
- Any change to one of these is reported as breaking. I recorded the new entries with `plugins:contract:update`; they are all additions, so nothing breaking was accepted.
- One bug turned up while doing this. `definePluginHandler` returns its handler to ProPR, not to the plugin. Treated like any other return value, it made `PluginContext` and the other context types look like things plugins build, which would have wrongly flagged new required members on them as breaking. Return types are now recorded without that marking. The only new plugin-built type is `PluginWebhookResponse`, which a plugin's webhook responder does return.
- New tests change a helper's arguments, a function's return type, a type only a helper reaches, an export removed, the error-class constructors (an option made required, parameters reordered), the `code` property dropped, a member retyped, and `extends Error` removed. Each is reported as breaking, and both tests fail with the export walk switched off.

**Separate finding, not fixed:** the scaffolded `README.md` also puts the name in verbatim. It is ordinary GitHub Markdown rather than MDX, so it doesn't break the docs build, but GitHub would hide a name like `<Cloud>` as an HTML tag. It is outside F6's scope.

There is no preview: the checked-in docs look the same as before.

PR: #3645
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR delivers the scaffold, generated documentation, CLI commands, and substantial compatibility coverage. It needs a localized correction before merge: the contract checker rejects additions that the documented policy explicitly permits.

✅ Read-only CLI integration — Both commands use the existing authenticated GET client and match the supplied API response envelopes, with coverage for authorization failures and missing plugins.

✅ Documentation drift checks — Generation checks the catalog, sidebar, manifest schema, and reference blocks, and rejects missing official plugin pages.

This review used static analysis of the supplied diff and context; no commands were run. Current checks show 32 passed, none failed, and two pending.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F8: 🔴 Permit documented additive contract changes

  • Category: correctness

  • Required behavior: The compatibility policy permits adding SDK error codes and event domains, and plugins:contract:update must record compatible additions without requiring --accept-breaking.

  • Evidence: packages/shared/src/pluginContract.ts, comparePluginContract; packages/shared/test/support/pluginContractSource.ts, sdkTypes

    1. A contributor adds an error code to PLUGIN_SDK_ERROR_CODES, preserving every existing code.
    2. buildPluginContract() correctly records the new code as an addition.
    3. sdkTypes() also expands PluginSdkErrorCode into its literal union because its declaration contains typeof. The newly added code changes that stored string.
    4. comparePluginContract() compares every existing sdk.types value using exact string equality and reports the expanded alias as a breaking change.
    5. scripts/update-plugin-contract.mjs therefore refuses the documented additive update unless the contributor uses --accept-breaking.

    The same conflict affects adding a repository event domain through the expanded RepositoryEventDomain alias. Existing list comparisons permit these additions, but the subsequent type-string comparison overrides that result. The additive test edits contract lists directly rather than exercising these source-level additions, so it misses the conflict.

    static trace: verified against the extractor, comparator, committed alias expansions, updater refusal branch, and authoring guide’s compatibility policy.

  • Minimum fix: Recognize compatible additions for the affected union aliases while retaining detection of removals and incompatible changes. Add source-override regressions proving that adding an SDK error code or event domain can be recorded without --accept-breaking.

Suggestions

These are optional follow-ups and are not sent to /fix.

S7: 🟢 Validate metadata before writing

scaffoldPlugin() validates the id and category before writing, but validates the generated manifest only indirectly during documentation generation. An empty or overlong --name or --description can therefore leave files and a registry entry behind after reporting failure. Parsing the candidate manifest before the write loop would improve recovery from invalid arguments. This is optional usability hardening; the documented default scaffold path is covered.

Score

The implementation is well scoped and extensively tested, but its compatibility updater contradicts an explicit supported workflow. Pending checks are not themselves blockers.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 56s
  • Tokens: 129,876 (128,839 in / 1,037 out)
  • Cost: $1.23

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F8 S7

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 10ac2cd

Addressed 1 AI review comment (IDs: 6947756262)

Addressed finding F8

Summary of Changes

I fixed F8. Adding an SDK error code or a repository event domain is now recorded as an addition, so plugins:contract:update takes it without --accept-breaking. Removing one is still a breaking change. The contract test passes 19 of 19, up from 18. The test file and packages/shared type-check, and plugins:docs:check passes. I didn't run the full repository suite.

The fix (packages/shared/src/pluginContract.ts): comparePluginContract used to report any change to the stored text of an SDK type as breaking. It now handles one case differently: an alias the extractor stores as <declared text> = <literal union>, which is what it does when the alias follows a runtime list. Only PluginSdkErrorCode and RepositoryEventDomain take that form today. For these aliases:

  • If the declared text is unchanged, the values are compared as sets. A new value is an addition (sdk: type PluginSdkErrorCode now includes "rate_limited"). A missing value is breaking (… no longer includes "state_limit").
  • Any other change is still breaking with the old message. That includes changing the declared text (for example adding | string) and any type that isn't a literal union.

New test (packages/shared/test/pluginContract.test.ts): it edits the real source files rather than the contract lists. It covers:

  • adding an error code to PLUGIN_SDK_ERROR_CODES and a domain to REPOSITORY_EVENT_DOMAINS: no breaking change, and the expected additions are reported.
  • removing a code and a domain: both breaking.
  • widening the alias to | string: breaking.

Checks I ran:

  • Old comparison line put back: the new test fails.
  • Real updater run: I added rate_limited to pluginSdk.ts and deployment to repositoryEvents.ts, then ran npm run plugins:contract:update without the flag. It exited 0 and recorded all three additions: the error-code list entry and both alias changes. I then restored both sources and the snapshot.

I didn't find the same exact-text comparison problem anywhere else in the code this PR changed. The remaining sdk.types entries are signatures and member types, and changing those is breaking by policy.

Separate from F8 (not changed): any value added to either alias now counts as compatible. That would be wrong if a type plugins supply ever listed one of these aliases exhaustively, such as a { [D in RepositoryEventDomain]: … } they must fill in. Nothing in the SDK does that today.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • packages/shared/src/pluginContract.ts (+30/−1)
  • Low risk (1 file)
    • packages/shared/test/pluginContract.test.ts (+25/−0)

Validation evidence

  • No repository validation commands ran.

Diff size: 2 files changed, +55/−1 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (high)
  • Requested By: @propr-ultrafix
  • Time: 7m 39s
  • Tokens: 1,117,013 (1,106,694 in / 10,319 out)
  • Cost: $0.80

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…domain is now recorded as an addition, so `plugins:contract:update` takes it without `--accept-breaking`. Removing one is still a breaking change. The contract test passes 19 of 19, up from 18. The test file and `packages/shared` type-check, and `plugins:docs:check` passes. I didn't run the full repository suite.

I fixed F8. Adding an SDK error code or a repository event domain is now recorded as an addition, so `plugins:contract:update` takes it without `--accept-breaking`. Removing one is still a breaking change. The contract test passes 19 of 19, up from 18. The test file and `packages/shared` type-check, and `plugins:docs:check` passes. I didn't run the full repository suite.

**The fix** (`packages/shared/src/pluginContract.ts`): `comparePluginContract` used to report any change to the stored text of an SDK type as breaking. It now handles one case differently: an alias the extractor stores as `<declared text> = <literal union>`, which is what it does when the alias follows a runtime list. Only `PluginSdkErrorCode` and `RepositoryEventDomain` take that form today. For these aliases:
- If the declared text is unchanged, the values are compared as sets. A new value is an addition (`sdk: type PluginSdkErrorCode now includes "rate_limited"`). A missing value is breaking (`… no longer includes "state_limit"`).
- Any other change is still breaking with the old message. That includes changing the declared text (for example adding `| string`) and any type that isn't a literal union.

**New test** (`packages/shared/test/pluginContract.test.ts`): it edits the real source files rather than the contract lists. It covers:
- adding an error code to `PLUGIN_SDK_ERROR_CODES` and a domain to `REPOSITORY_EVENT_DOMAINS`: no breaking change, and the expected additions are reported.
- removing a code and a domain: both breaking.
- widening the alias to `| string`: breaking.

**Checks I ran:**
- **Old comparison line put back:** the new test fails.
- **Real updater run:** I added `rate_limited` to `pluginSdk.ts` and `deployment` to `repositoryEvents.ts`, then ran `npm run plugins:contract:update` without the flag. It exited 0 and recorded all three additions: the error-code list entry and both alias changes. I then restored both sources and the snapshot.

I didn't find the same exact-text comparison problem anywhere else in the code this PR changed. The remaining `sdk.types` entries are signatures and member types, and changing those is breaking by policy.

**Separate from F8 (not changed):** any value added to either alias now counts as compatible. That would be wrong if a type plugins supply ever listed one of these aliases exhaustively, such as a `{ [D in RepositoryEventDomain]: … }` they must fill in. Nothing in the SDK does that today.

PR: #3645
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR delivers the scaffold, generated documentation, compatibility checks, and read-only CLI commands with substantial targeted coverage. It needs a localized correction before merge: invalid scaffold metadata can leave the repository modified and failing validation.

✅ Read-only CLI integration — The new commands use the existing GET endpoints and handle installation states, removed plugins, JSON output, and authorization failures.

✅ Documentation drift checks — CI checks the generated reference, catalog, schema, and sidebar; tests cover stale outputs and missing plugin pages.

This review used static analysis only, as requested. The supplied current-head status reports 31 passed checks, three pending, and no failures.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F9: 🔴 Validate scaffold metadata before writing

  • Category: correctness

  • Required behavior: Refusing invalid scaffold input must not register an invalid plugin or leave the repository failing plugins:check.

  • Evidence: scripts/new-plugin.mjs, scaffoldPlugin

    1. Run npm run plugins:new -- acme-chat --name "" in an otherwise valid checkout. The ID and category checks pass, but the manifest schema requires a nonempty name.
    2. manifestFor() accepts the empty name. scaffoldPlugin() writes the plugin files, generated test, documentation page, and modified registry.json before validating the manifest.
    3. generatePluginDocs() subsequently calls checkPlugins(), discovers the invalid name, and causes the scaffold command to exit unsuccessfully.
    4. The invalid plugin remains registered. Repository validation now fails, and rerunning the command with a corrected name is refused because the ID is already registered.

    The same sequence applies to overlong names and empty or overlong descriptions. Existing tests cover malformed IDs and categories, but do not exercise invalid metadata. static trace: verified against the write loop, subsequent documentation validation, and the supplied manifest schema; no commands were executed.

  • Minimum fix: Validate the complete generated manifest before the first filesystem write. Add regression coverage asserting that invalid names and descriptions leave the registry and output paths unchanged.

Suggestions

These are optional follow-ups and are not sent to /fix.

S8: 🟢 Explain the registry test update

The authoring guide’s submission checklist could mention updating the fixed official-plugin expectations in packages/plugins/test/registry.test.ts. Scaffolding adds an official registry entry, so those existing assertions will need updating. This is optional documentation guidance: the acceptance criterion promises the generated test passes, rather than the entire registry suite without edits.

Score

The implementation is comprehensive and well covered, but the scaffold’s invalid-input path leaves persistent broken output and requires correction. Pending checks should also complete before merging.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 53s
  • Tokens: 131,081 (129,966 in / 1,115 out)
  • Cost: $1.23

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F9 S8

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 6edf884

Addressed 1 AI review comment (IDs: 6948395204)

Addressed finding F9

Summary of Changes

I fixed F9: plugins:new now checks the whole generated manifest before it writes anything.

The fix (scripts/new-plugin.mjs, scaffoldPlugin): once the id and category checks pass, the script builds the manifest and runs it through parsePluginManifest, the same check plugins:check uses. If that fails, it stops before writing any file and lists the schema errors. So an empty, blank or overlong --name or --description no longer leaves a half-registered plugin that fails plugins:check and blocks a corrected rerun. I ran npm run plugins:new -- acme-chat --name "" in the checkout. It exits 1 with name: Too small: expected string to have >=1 characters, the working tree is unchanged, and plugins:check still passes.

The new test (test/newPlugin.test.mjs) covers an empty, blank and 81-character name, and an empty, blank and 501-character description. For each one it checks that:

  • the command fails with the "nothing was written" message and the right field error.
  • registry.json is byte-for-byte unchanged.
  • no plugin folder, generated test, docs page, catalog page or plugin-pages.json was written.
  • checkPlugins reports no errors.

It then reruns with valid values and checks that the scaffold and docs regeneration succeed.

Results: test/newPlugin.test.mjs passes 9 of 9. With the new check switched off, the new test fails, so it does catch the bug. ESLint is clean on both files. I didn't run the full repository suite.

I checked the other ways the scaffold can fail and found no other value that passes the early checks but then fails plugins:check for the new plugin. The icon, README, id/folder match and homepage are all fixed values the scaffold writes itself.

Two things I noticed but didn't change, since they're outside F9:

  • Docs regeneration after the write: if the plugin docs can't be regenerated for some other reason, such as a problem that was already in the repository, the scaffold still fails with the plugin files and registry.json already written.
  • Surrounding spaces: a name like " Acme " passes the check, because the schema trims it, but it's written with the spaces into the manifest, README and docs page. This is cosmetic; plugins:check still passes.

I made no visual preview because the change only affects a command-line script and its tests.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • scripts/new-plugin.mjs (+6/−2)
  • Low risk (1 file)
    • test/newPlugin.test.mjs (+28/−0)

Validation evidence

  • No repository validation commands ran.

Diff size: 2 files changed, +34/−2 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (high)
  • Requested By: @propr-ultrafix
  • Time: 4m 36s
  • Tokens: 758,422 (752,716 in / 5,706 out)
  • Cost: $0.55
  • Subscription usage: Fable +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…nifest before it writes anything.

I fixed F9: `plugins:new` now checks the whole generated manifest before it writes anything.

**The fix** (`scripts/new-plugin.mjs`, `scaffoldPlugin`): once the id and category checks pass, the script builds the manifest and runs it through `parsePluginManifest`, the same check `plugins:check` uses. If that fails, it stops before writing any file and lists the schema errors. So an empty, blank or overlong `--name` or `--description` no longer leaves a half-registered plugin that fails `plugins:check` and blocks a corrected rerun. I ran `npm run plugins:new -- acme-chat --name ""` in the checkout. It exits 1 with `name: Too small: expected string to have >=1 characters`, the working tree is unchanged, and `plugins:check` still passes.

**The new test** (`test/newPlugin.test.mjs`) covers an empty, blank and 81-character name, and an empty, blank and 501-character description. For each one it checks that:
- the command fails with the "nothing was written" message and the right field error.
- `registry.json` is byte-for-byte unchanged.
- no plugin folder, generated test, docs page, catalog page or `plugin-pages.json` was written.
- `checkPlugins` reports no errors.

It then reruns with valid values and checks that the scaffold and docs regeneration succeed.

**Results:** `test/newPlugin.test.mjs` passes 9 of 9. With the new check switched off, the new test fails, so it does catch the bug. ESLint is clean on both files. I didn't run the full repository suite.

I checked the other ways the scaffold can fail and found no other value that passes the early checks but then fails `plugins:check` for the new plugin. The icon, README, id/folder match and homepage are all fixed values the scaffold writes itself.

Two things I noticed but didn't change, since they're outside F9:
- **Docs regeneration after the write:** if the plugin docs can't be regenerated for some other reason, such as a problem that was already in the repository, the scaffold still fails with the plugin files and `registry.json` already written.
- **Surrounding spaces:** a name like `" Acme "` passes the check, because the schema trims it, but it's written with the spaces into the manifest, README and docs page. This is cosmetic; `plugins:check` still passes.

I made no visual preview because the change only affects a command-line script and its tests.

PR: #3645
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on 6edf884 are holding the loop back:

  • Validate Changes — not finished
  • Classify changed surfaces — not finished
  • Full Test Suite Shard 4/4 — not finished
  • Full Test Suite Shard 3/4 — not finished
  • Full Test Suite Shard 1/4 — not finished
  • Full Test Suite Shard 2/4 — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR delivers the scaffold, generated documentation, compatibility checks, and read-only CLI commands with substantial focused coverage. It needs a localized correction to the manifest compatibility guard before merge.

✅ CLI integration — The new commands use the existing authenticated API client and correctly consume the list/detail response envelopes, with tests for authorization failures and missing plugins.

✅ Scaffold validation — Invalid manifest metadata is rejected before files are written; tests also cover generated code, registry placement, and YAML/MDX escaping.

✅ Documentation drift checks — CI checks the reference, catalog, schema, and sidebar against generated output.

This review used static analysis only; no commands were run. The supplied current-head status reports 29 passed checks, five pending, and no failures.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F10: 🔴 Preserve manifest bounds in compatibility snapshots

  • Category: correctness

  • Required behavior: The new compatibility guard must reject breaking manifest changes that retain the same manifestVersion; tightening an accepted field’s bounds can invalidate existing manifests.

  • Evidence: packages/shared/src/pluginContract.ts, PluginManifestContractField, buildPluginContract, and compareManifest.

    1. A maintainer tightens the manifest name limit from 80 characters to 40 without changing manifestVersion.
    2. walkPluginManifestSchema() exposes the changed maxLength, but buildPluginContract() retains only type, required, and enum. Both versions therefore produce the identical contract entry for name.
    3. compareManifest() reports no breaking change, and the committed contract snapshot remains current. Regenerating the documentation satisfies the separate docs drift check.
    4. A previously valid manifest with a 41–80-character name is now rejected despite the compatibility guard passing.

    The same omission affects array bounds such as maxItems and numeric bounds. Existing tests cover field presence, types, and enums, but none preserve or compare these constraints. static trace: verified from the supplied schema, snapshot, and comparison implementation; no mutation test was executed.

  • Minimum fix: Record supported string, array, and numeric bounds in the manifest contract and reject tightening them within the same version. Add regression cases showing that tighter bounds fail while relaxed bounds remain compatible.

Suggestions

These are optional follow-ups and are not sent to /fix.

S9: 🟢 Document the registry test update

The unchanged registry tests pin the official plugin list, so scaffolding a plugin requires updating those expectations before the full suite passes. Mention this in the scaffold’s completion message and authoring checklist. This is optional because the stated scaffold acceptance criterion requires its generated test to pass, rather than the entire registry suite without edits.

Score

The implementation is cohesive and well covered, but the compatibility guard currently misses a concrete class of breaking manifest changes. The remaining correction is localized; pending checks alone do not lower the score.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 2s
  • Tokens: 132,111 (131,019 in / 1,092 out)
  • Cost: $1.24

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F10 S9

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 7080e46

Addressed 1 AI review comment (IDs: 6948900580)

Addressed finding F10

Summary of Changes

I fixed F10. If the manifest's limits get tighter without a manifestVersion bump, the contract check now fails, so the case in the finding (name cut from 80 to 40 characters) is caught. Looser limits are still allowed. The contract test passes 22 of 22, up from 19. I didn't run the full repository suite.

The fix (in packages/shared/src/pluginContract.ts):

  • What's recorded: each manifest field in the contract now carries its length, entry-count and value limits in a new bounds entry. That covers min/max length, min/max entries and min/max values, including the exclusive forms.
  • Lists and union fields: limits on each entry of a list are recorded too (outboundHosts[], for example). For fields that accept several shapes, such as subscription filter values, the limit recorded is the loosest one any shape allows.
  • How changes are judged: a new or stricter limit is reported as breaking, e.g. manifest: field name length is now limited to at most 40 instead of at most 80 (a breaking manifest change needs a new manifestVersion). A looser or removed limit is reported as an addition. Moving a numeric limit from "at most 500" to "less than 500" counts as stricter.
  • For tests: buildPluginContract() now takes an optional manifest JSON Schema, so tests can change the real schema and rebuild the contract.

The snapshot: the old snapshot had no limits, so the updater saw all 118 recorded limits as new and refused. I regenerated it once with --accept-breaking and confirmed that apart from the new bounds entries it is identical to before.

Tests (in pluginContract.test.ts):

  • What's recorded: the snapshot holds the expected limits (single fields, list entries, numeric and union cases), and rebuilding from the unchanged schema gives the same result.
  • Tighter limits fail: I edited the real JSON Schema to tighten limits on single fields, list sizes, list entries, a numeric field and the union field, plus one new limit. Each produces the expected breaking message. The same edits are allowed under a new manifest version.
  • Looser limits pass: loosening or removing limits gives no breaking change and is recorded as an addition. One case checks that adding a second, unlimited string shape removes the union's length limit, whichever shape comes first.
  • Fixture: breaking-previous.json now includes tightened length, entry-count and list-entry limits. Its README, the compatibility rules in authoring.md and the header comment in pluginContract.ts now list "adding or tightening a limit" as a breaking change.

Checks I ran:

  • The finding's scenario: I changed name to textSchema(40) in plugins.ts. The contract test failed, and npm run plugins:contract:update refused and left the snapshot alone. Changing it to textSchema(120) was recorded as an addition without the flag. I restored both files afterwards.
  • Breaking the fix on purpose: I tried four versions of the fix with one part broken: no limit comparison, no limits recorded, the earlier version of the union handling, and exclusive limits ignored. The new tests failed each time.
  • Other checks: packages/shared and the test file type-check, plugins:docs:check passes, and the docs-generator and scaffold tests pass 15 of 15.

Found but not fixed (outside F10): regex patterns, format and map-key rules aren't in the contract either, and neither are the cross-field checks in pluginManifestSchema. So making a pattern stricter within the same version, for example ^[a-z][a-z0-9_-]{0,47}$ to {0,31}, still passes the check.

I made no preview, since the only visible change is one sentence in the compatibility rules.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • packages/shared/src/pluginContract.ts (+128/−7)
  • Low risk (5 files)
    • docs/docs/plugins/authoring.md (+2/−1)
    • packages/shared/test/contracts/plugin-contract.snapshot.json (+331/−71)
    • packages/shared/test/fixtures/plugin-contract/README.md (+2/−1)
    • packages/shared/test/fixtures/plugin-contract/breaking-previous.json (+5/−2)
    • packages/shared/test/pluginContract.test.ts (+85/−1)

Validation evidence

  • No repository validation commands ran.

Diff size: 6 files changed, +553/−83 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (xhigh)
  • Requested By: @propr-ultrafix
  • Time: 18m 6s
  • Tokens: 6,095,647 (6,047,335 in / 48,312 out)
  • Cost: $2.88

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

… `manifestVersion` bump, the contract check now fails, so the case in the finding (`name` cut from 80 to 40 characters) is caught. Looser limits are still allowed. The contract test passes 22 of 22, up from 19. I didn't run the full repository suite.

I fixed F10. If the manifest's limits get tighter without a `manifestVersion` bump, the contract check now fails, so the case in the finding (`name` cut from 80 to 40 characters) is caught. Looser limits are still allowed. The contract test passes 22 of 22, up from 19. I didn't run the full repository suite.

**The fix** (in `packages/shared/src/pluginContract.ts`):
- **What's recorded:** each manifest field in the contract now carries its length, entry-count and value limits in a new `bounds` entry. That covers min/max length, min/max entries and min/max values, including the exclusive forms.
- **Lists and union fields:** limits on each entry of a list are recorded too (`outboundHosts[]`, for example). For fields that accept several shapes, such as subscription filter values, the limit recorded is the loosest one any shape allows.
- **How changes are judged:** a new or stricter limit is reported as breaking, e.g. `manifest: field name length is now limited to at most 40 instead of at most 80 (a breaking manifest change needs a new manifestVersion)`. A looser or removed limit is reported as an addition. Moving a numeric limit from "at most 500" to "less than 500" counts as stricter.
- **For tests:** `buildPluginContract()` now takes an optional manifest JSON Schema, so tests can change the real schema and rebuild the contract.

**The snapshot:** the old snapshot had no limits, so the updater saw all 118 recorded limits as new and refused. I regenerated it once with `--accept-breaking` and confirmed that apart from the new `bounds` entries it is identical to before.

**Tests** (in `pluginContract.test.ts`):
- **What's recorded:** the snapshot holds the expected limits (single fields, list entries, numeric and union cases), and rebuilding from the unchanged schema gives the same result.
- **Tighter limits fail:** I edited the real JSON Schema to tighten limits on single fields, list sizes, list entries, a numeric field and the union field, plus one new limit. Each produces the expected breaking message. The same edits are allowed under a new manifest version.
- **Looser limits pass:** loosening or removing limits gives no breaking change and is recorded as an addition. One case checks that adding a second, unlimited string shape removes the union's length limit, whichever shape comes first.
- **Fixture:** `breaking-previous.json` now includes tightened length, entry-count and list-entry limits. Its README, the compatibility rules in `authoring.md` and the header comment in `pluginContract.ts` now list "adding or tightening a limit" as a breaking change.

**Checks I ran:**
- **The finding's scenario:** I changed `name` to `textSchema(40)` in `plugins.ts`. The contract test failed, and `npm run plugins:contract:update` refused and left the snapshot alone. Changing it to `textSchema(120)` was recorded as an addition without the flag. I restored both files afterwards.
- **Breaking the fix on purpose:** I tried four versions of the fix with one part broken: no limit comparison, no limits recorded, the earlier version of the union handling, and exclusive limits ignored. The new tests failed each time.
- **Other checks:** `packages/shared` and the test file type-check, `plugins:docs:check` passes, and the docs-generator and scaffold tests pass 15 of 15.

**Found but not fixed (outside F10):** regex patterns, `format` and map-key rules aren't in the contract either, and neither are the cross-field checks in `pluginManifestSchema`. So making a pattern stricter within the same version, for example `^[a-z][a-z0-9_-]{0,47}$` to `{0,31}`, still passes the check.

I made no preview, since the only visible change is one sentence in the compatibility rules.

PR: #3645
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR delivers the scaffold, generated documentation, CLI commands, and substantial contract-test coverage. It needs a localized correction before merge: the payload contract loses literal types and can silently accept a breaking interface change.

✅ CLI integration — The read-only commands match the supplied API response envelopes and cover authentication failures, missing plugins, and JSON output.

✅ Scaffold validation — Manifest validation occurs before writes, and tests exercise generated handlers, lint configuration, typechecking, and documentation escaping.

This review used static analysis only; no commands were run. Current checks report 30 passed, four pending, and no failures.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F11: 🔴 Preserve literal payload types

  • Category: correctness

  • Required behavior: AC3 and the documented compatibility guarantee require contract tests to reject breaking changes to event payload types.

  • Evidence: packages/shared/test/support/pluginContractSource.ts, baseDescriptor, fieldDescriptors, and buildSourcePluginContract.

    1. Change ReviewScoredEventPayload.source from 'review' | 'ultrafix' to 'assessment' | 'ultrafix', migrating producers to the new value.
    2. The compiler reader passes both old and new string literals through baseDescriptor, which reduces every StringLike type to string. Deduplication therefore produces the same descriptor for both interfaces.
    3. The payload snapshot remains unchanged, and pluginContractSourceMismatches also reports no difference. The SDK walk does not independently capture this payload interface: RepositoryEvent.payload is Record<string, unknown>.
    4. The compatibility check accepts the change even though existing plugins filtering or branching on source === 'review' stop processing those reviews.

    static trace: The supplied source declares the literal union, while the committed snapshot records only "source": "string". The new source-edit tests cover primitive retyping and nullability, but do not protect literal values. Numeric and boolean literals are similarly widened by this helper.

  • Minimum fix: Preserve literal values in the compatibility representation and reject their removal or replacement. Keep simplified documentation descriptors separate if desired, and add a source-edit regression demonstrating that renaming 'review' is rejected.

Suggestions

These are optional follow-ups and are not sent to /fix.

S10: 🟢 Document registry test updates

The authoring guide should mention the existing catalog-order assertions in packages/plugins/test/registry.test.ts. Scaffolding adds a registry entry, so contributors must update those assertions before the package suite passes. This is optional guidance: the stated scaffold acceptance criterion requires its generated test to pass, rather than automatic rewriting of existing catalog tests.

S11: 🟢 Render exclusive numeric limits

scripts/gen-plugin-docs.mjs handles minimum and maximum but omits exclusive bounds. Consequently, the generated reference shows maxLength and maxItems as integers with upper bounds without explaining that zero is rejected. Rendering exclusiveMinimum and exclusiveMaximum would improve the reference; the published JSON Schema already preserves those constraints.

Score

The implementation is well scoped and extensively tested, but a central compatibility guarantee still has a demonstrated blind spot. Correcting the payload representation should be localized.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 15s
  • Tokens: 138,165 (136,726 in / 1,439 out)
  • Cost: $1.33

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F11 S10 S11

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 41f7c1a

Addressed 1 AI review comment (IDs: 6949804097)

Addressed finding F11

Summary of Changes

I fixed F11. Renaming 'review' to 'assessment' in ReviewScoredEventPayload.source now fails the contract check with field source no longer includes "review". The contract test passes 24 of 24, up from 22. I didn't run the full repository suite or a Docusaurus build.

What changed

  • The source reader (packages/shared/test/support/pluginContractSource.ts) now keeps literal values for payload and envelope fields, so the snapshot records source: "review" | "ultrafix" instead of string. Numeric and boolean literals are kept too (1 | 2, true), and true with false together is still written as boolean.
  • The docs descriptors stay simple. It also produces a widened copy (source: string), and the check against the hand-written descriptors uses that. Those descriptors and the generated docs are unchanged.
  • The comparison (compareFields in pluginContract.ts): when only a field's literal values differ, removing or replacing one is a breaking change and adding one is recorded as an addition. This matches how F8 handles error codes and event domains. Any other type change, including widening to string, is still a breaking change. A field that gains a value and also becomes optional is still reported as no longer always present.
  • Same defect elsewhere: the same helper also widened UltrafixEndedEventPayload.outcome, the kind, status and pullRequest fields on all task payloads, and the envelope's domain. All of these now keep their values. The domain field was already protected through the SDK type RepositoryEventDomain; it now also reports changes as an envelope field.

The snapshot needed --accept-breaking. I re-recorded it with npm run plugins:contract:update -- --accept-breaking, which accepted 14 entries. They are those fields going from string to their declared literal values. The interface itself didn't change.

Tests

  • New source-edit tests cover:
    • the rename from the finding, plus adding a value, making the field optional, and widening to string.
    • renaming a value in TASK_EVENT_KINDS, which breaks all five task payloads through an alias and an inherited field.
    • removing 'updated' from TaskEventPullRequestOutcome.
    • numeric and boolean literals.
  • The breaking-change fixture now has a payload value that was later removed.
  • I updated the F8 test, which now also expects the envelope messages for domain.
  • Negative check: with the old widening reader and the HEAD snapshot, exactly the four tests that encode this behaviour fail.
  • Also passing: the docs-generator and scaffold tests (15 of 15), plugins:docs:check, and the type check of packages/shared and the changed test files. ESLint isn't configured for packages/shared.

Docs: the payload rule in the authoring guide's "Compatibility rules" now says a fixed value is never removed or renamed, and that new values are fine. The fixture README and the comments in pluginContract.ts say the same.

I made no previews, since the only user-facing change is a sentence of docs text.

Found but not fixed (outside F11):

  • Payloads with no shared interface are snapshotted only from the hand-written descriptors. That covers pull_request.auto_merge_decision, epic_queue.started and a few others, and the compiler never reads them. In core, opportunity on auto_merge_decision has the literal type AutoMergeOpportunity, so renaming one of its values still isn't caught.
  • A change to literal values inside an array element (("a" | "b")[]) is reported as a type change, so adding a value there would also count as breaking. No current field has this.

Review digest

Risk-tiered paths

  • High risk: none
  • Normal risk (1 file)
    • packages/shared/src/pluginContract.ts (+69/−13)
  • Low risk (6 files)
    • docs/docs/plugins/authoring.md (+4/−2)
    • packages/shared/test/contracts/plugin-contract.snapshot.json (+14/−14)
    • packages/shared/test/fixtures/plugin-contract/README.md (+1/−1)
    • packages/shared/test/fixtures/plugin-contract/breaking-previous.json (+1/−0)
    • packages/shared/test/pluginContract.test.ts (+47/−3)
    • packages/shared/test/support/pluginContractSource.ts (+50/−16)

Validation evidence

  • No repository validation commands ran.

Diff size: 7 files changed, +186/−49 lines


🤖 Implementation Details

  • Model: Claude Opus 5.5 (xhigh)
  • Requested By: @propr-ultrafix
  • Time: 12m 20s
  • Tokens: 4,202,270 (4,161,676 in / 40,594 out)
  • Cost: $2.32
  • Subscription usage: Fable +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…ewScoredEventPayload.source` now fails the contract check with `field source no longer includes "review"`. The contract test passes 24 of 24, up from 22. I didn't run the full repository suite or a Docusaurus build.

I fixed F11. Renaming `'review'` to `'assessment'` in `ReviewScoredEventPayload.source` now fails the contract check with `field source no longer includes "review"`. The contract test passes 24 of 24, up from 22. I didn't run the full repository suite or a Docusaurus build.

**What changed**
- **The source reader** (`packages/shared/test/support/pluginContractSource.ts`) now keeps literal values for payload and envelope fields, so the snapshot records `source: "review" | "ultrafix"` instead of `string`. Numeric and boolean literals are kept too (`1 | 2`, `true`), and `true` with `false` together is still written as `boolean`.
- **The docs descriptors stay simple.** It also produces a widened copy (`source: string`), and the check against the hand-written descriptors uses that. Those descriptors and the generated docs are unchanged.
- **The comparison** (`compareFields` in `pluginContract.ts`): when only a field's literal values differ, removing or replacing one is a breaking change and adding one is recorded as an addition. This matches how F8 handles error codes and event domains. Any other type change, including widening to `string`, is still a breaking change. A field that gains a value and also becomes optional is still reported as no longer always present.
- **Same defect elsewhere:** the same helper also widened `UltrafixEndedEventPayload.outcome`, the `kind`, `status` and `pullRequest` fields on all task payloads, and the envelope's `domain`. All of these now keep their values. The `domain` field was already protected through the SDK type `RepositoryEventDomain`; it now also reports changes as an envelope field.

**The snapshot needed `--accept-breaking`.** I re-recorded it with `npm run plugins:contract:update -- --accept-breaking`, which accepted 14 entries. They are those fields going from `string` to their declared literal values. The interface itself didn't change.

**Tests**
- New source-edit tests cover:
  - the rename from the finding, plus adding a value, making the field optional, and widening to `string`.
  - renaming a value in `TASK_EVENT_KINDS`, which breaks all five task payloads through an alias and an inherited field.
  - removing `'updated'` from `TaskEventPullRequestOutcome`.
  - numeric and boolean literals.
- The breaking-change fixture now has a payload value that was later removed.
- I updated the F8 test, which now also expects the envelope messages for `domain`.
- **Negative check:** with the old widening reader and the HEAD snapshot, exactly the four tests that encode this behaviour fail.
- Also passing: the docs-generator and scaffold tests (15 of 15), `plugins:docs:check`, and the type check of `packages/shared` and the changed test files. ESLint isn't configured for `packages/shared`.

**Docs:** the payload rule in the authoring guide's "Compatibility rules" now says a fixed value is never removed or renamed, and that new values are fine. The fixture README and the comments in `pluginContract.ts` say the same.

I made no previews, since the only user-facing change is a sentence of docs text.

**Found but not fixed (outside F11):**
- Payloads with no shared interface are snapshotted only from the hand-written descriptors. That covers `pull_request.auto_merge_decision`, `epic_queue.started` and a few others, and the compiler never reads them. In core, `opportunity` on `auto_merge_decision` has the literal type `AutoMergeOpportunity`, so renaming one of its values still isn't caught.
- A change to literal values inside an array element (`("a" | "b")[]`) is reported as a type change, so adding a value there would also count as breaking. No current field has this.

PR: #3645
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR is ready to merge within scope. It delivers scaffolding, generated documentation, compatibility checks, and read-only CLI commands with substantial targeted coverage. Review was static; no commands were run. Current-head checks report 35 passed, 12 neutral/skipped, and no failures.

✅ Validated scaffolding — The scaffold validates the complete manifest and checks output collisions before writing; tests cover invalid metadata and generated handler validation.

✅ Consistent CLI integration — The commands use the existing authenticated API client and match the supplied API response envelopes, including removed plugins and administrator refusals.

✅ Documentation drift protection — CI checks generated references, catalog, schema, and sidebar entries; generation also detects missing official-plugin pages.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S12: 🟢 Clarify contract coverage boundaries

buildPluginContract records manifest types, enums, requiredness, and numeric bounds, but excludes regex constraints and custom refinements. The source walker also records interface property types without their readonly modifiers. Documenting these boundaries would help maintainers distinguish automated compatibility checks from changes needing manual review. Extending coverage is optional; the requested breaking-change detection is implemented and demonstrated.

S13: 🟢 Document registry test updates

The scaffold updates registry.json, while the existing registry tests pin the official plugin list. Add a note to the authoring checklist explaining that contributors must update those expectations when adding a plugin. This improves the contribution workflow without changing the scaffold’s stated guarantees, which cover its generated test and validation commands.

Score

The implementation satisfies the supplied acceptance criteria, has strong targeted tests, and has no verified merge blockers. The current checks are green; the remaining suggestions are non-blocking maintenance improvements.

Score: 9/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 3s
  • Tokens: 139,287 (138,274 in / 1,013 out)
  • Cost: $1.33

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S12 S13

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 17, 2026
@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

ℹ️ GitHub auto-merge is turned off for this repository, so ProPR merges this PR itself once it is ready (checks passed or no CI configured, and the review goal met).

To let GitHub merge it the moment required checks pass, enable Settings → General → Pull Requests → Allow auto-merge.

@propr-dev
propr-dev Bot merged commit 34e96b5 into 3542-epic-plugin-system-xu8 Nov 17, 2026
49 checks passed
@propr-dev propr-dev Bot changed the title 🔨 [3561 by Claude Opus 5.5] Plugin authoring guide, scaffold command and compatibility rules for official plugins [3561 by Claude Opus 5.5] Plugin authoring guide, scaffold command and compatibility rules for official plugins Nov 17, 2026
@propr-dev
propr-dev Bot deleted the 3561/claude-opus-5-5-plugin-authoring-guide-sc-20261117-0455-agt branch November 17, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant