Skip to content

[3405 by Claude Opus 5.5] Fix demo mode for the 0.9.0 instance access model: demo.propr.dev (ProPR 0.9.0, PROPR_DEMO_MODE=true, read-only) hides whole product areas from the demo visitor. Check current upstream main first. - #3406

Merged
integry merged 8 commits into
mainfrom
3405/claude-opus-5-5-fix-demo-mode-for-the-0-9-20261031-1710-qul
Nov 1, 2026

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Addresses #3405

Branch: 3405/claude-opus-5-5-fix-demo-mode-for-the-0-9-20261031-1710-qul
Commits: ✅ Changes committed (99f0224)


AI Processing Incomplete

Execution Details:

Warning

This implementation may be incomplete. The agent stopped producing output and the stall watchdog ended the run before it could confirm that all requested work was complete. Partial changes were preserved instead of discarded.

Work completed before interruption:
I've fixed #3405. In demo mode the visitor now sees Access, every Settings section with its inner navigation, Goals and Inbox, all read-only, and every write is still refused with 405 DEMO_MODE_READ_ONLY. I checked current upstream main first: it is the commit this branch starts from, so nothing there already fixed it.

I ran the real API and UI in demo mode against a seeded database with fictional data, before and after the change. That run found two problems my unit tests had missed, and both are now fixed:

  • Goals failed with HTTP 500 once they became visible. The in-memory Redis replacement used in demo mode returned the wrong kind of answer when a goal's live agent output was read. This was already broken on HEAD for task live details; it just never showed because demo Goals was empty. It now returns an empty "no live output" answer.
  • Agent Extensions showed "A current durable instance administrator is required." Extension profiles hold sealed per-installation secrets, so the demo still can't read them. The endpoint now gives the same "read-only demo does not expose this" message as the other closed views, and the UI displays it.

What changed

  1. Demo identity. It gets all four instance permissions, so the UI unlocks every area. They only allow GET/HEAD, and only while demo mode is on. Its role stays member, so admin-role-only screens backed by the live host (instance storage) stay closed.
  2. Which admin reads the demo can make. Reads served from the curated database are allowed: settings, repos, agents, keywords/labels, summarization, members, role audit, MCP settings and logs. Everything else answers 403 with DEMO_MODE_LIVE_DATA_UNAVAILABLE: Agent Tank settings/status/history/detect, runtime packages, agent images and versions, login sessions, visual preview credentials, preview storage, follow-up handoffs, OpenCode models and extension profiles. This is an allowlist (packages/api/demoViewerRoutes.ts), so a new admin route stays closed to the demo until someone adds it.
  3. Members list. Environment admin usernames (PROPR_ADMIN_USERS) are blanked in demo mode, since they come from the host rather than the demo database.
  4. Goals. The demo visitor reads every goal in the demo's repositories: list, detail, inputs, needs-attention list, wait, attachments and goal-backed task reads. Goal previews return empty instead of calling GitHub. Pause, delete and the other goal actions keep owner-only lookup, so they would fail even without the write barrier.
  5. Inbox. The demo shows the Inbox of whichever user holds the most notifications in the curated data, filtered to the demo repositories, with host health events left out. Nothing is written.
  6. Access page. It shows a read-only notice and its controls are disabled in demo mode.
  7. CHANGELOG. Added an [Unreleased] Fixed bullet.

Tests

  • New API tests:
    • demoViewerAuthorization.test.ts: allowed reads return 200, closed reads return 403, every write returns 405, writes are still refused if they get past the write barrier, nothing unlocks with demo mode off, and the extensions refusal.
    • demoGoalVisibility.test.ts: uses the real demo Redis replacement; it fails without the 500 fix.
    • demoInbox.test.ts
  • New UI test demoViewer.test.tsx: Settings categories, the Access entry and the read-only Access page for the demo user. It fails with the old empty permission set.
  • I updated two existing tests that asserted the old empty demo permissions.
  • Results: the affected API suites, 40 related UI test files (453 tests), npm run lint --workspaces --if-present -- --max-warnings 0, root lint, and root plus workspace typechecks all pass. After the last two fixes I re-ran the API typecheck and lint, the UI typecheck and the touched suites, not the full lint and typecheck set again.

Previews: before and after for Settings, Access, Goals and Inbox, plus the Agent Extensions section and a goal detail page after the fix.

Behaviour to be aware of

  • In Settings, the Visual preview uploads, extension profiles and runtime packages panels show the red "This view reads live installation state, which the read-only demo does not expose" text rather than data. That's intentional, but it is visible.
  • The Settings footer still says "Changes save automatically" in demo mode.

Nothing was merged, tagged, published or deployed.

Remaining work:
The agent stopped before validating every requirement. Review the partial diff against the original request and complete any unaddressed implementation, tests, or documentation before merging.

Detailed Logs:

  • Conversation: 34 messages
  • Session: 283dbaa0-d748-4a7d-b452-3fa0f4adc28e

Log files stored at:

  • conversation: /usr/src/app/logs/executions/issue-3405-2026-10-31T17-48-27-137Z-conversation.json
  • output: /usr/src/app/logs/executions/issue-3405-2026-10-31T17-48-27-137Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: I've fixed #3405. In demo mode the visitor now sees Access, every Settings section with its inner navigation, Goals and Inbox, all read-only, and every write is still refused with `405 DEMO_MODE_READ_...


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


💡 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

Demo Access — after

Demo Access — after

Access page shows members and role audit read-only, with a demo notice and disabled controls

Connect sign-in required. Original retained until 2027-01-29T17:48:31.585Z.

View the full-resolution original in ProPR Connect

Demo Access — before

Demo Access — before

Access page refused with 'Administrator access required'

Connect sign-in required. Original retained until 2027-01-29T17:48:32.805Z.

View the full-resolution original in ProPR Connect

Demo goal detail — after

Demo goal detail — after

Goal detail opens read-only (corrections disabled) without server errors

Connect sign-in required. Original retained until 2027-01-29T17:48:33.990Z.

View the full-resolution original in ProPR Connect

Demo Goals — after

Demo Goals — after

Every goal of the demo repositories is listed for the demo visitor

Connect sign-in required. Original retained until 2027-01-29T17:48:35.473Z.

View the full-resolution original in ProPR Connect

Demo Goals — before

Demo Goals — before

Goals page empty although the demo database contains goals

Connect sign-in required. Original retained until 2027-01-29T17:48:36.662Z.

View the full-resolution original in ProPR Connect

Demo Inbox — after

Demo Inbox — after

Representative Inbox from the curated data, limited to demo repositories, without host health events

Connect sign-in required. Original retained until 2027-01-29T17:48:38.153Z.

View the full-resolution original in ProPR Connect

Demo Inbox — before

Demo Inbox — before

Inbox empty for the synthetic demo user

Connect sign-in required. Original retained until 2027-01-29T17:48:39.215Z.

View the full-resolution original in ProPR Connect

Demo Settings — after

Demo Settings — after

Demo visitor sees the full Settings inner navigation with the read-only notice; Coding Agents and Access appear in the sidebar

Connect sign-in required. Original retained until 2027-01-29T17:48:40.388Z.

View the full-resolution original in ProPR Connect

…tings section with its inner navigation, Goals and Inbox, all read-only, and every write is still refused with `405 DEMO_MODE_READ_ONLY`. I checked current upstream main first: it is the commit this branch starts from, so nothing there already fixed it.

I ran the real API and UI in demo mode against a seeded database with fictional data, before and after the change. That run found two problems my unit tests had missed, and both are now fixed:
- Goals failed with HTTP 500 once they became visible. The in-memory Redis replacement used in demo mode returned the wrong kind of answer when a goal's live agent output was read. This was already broken on HEAD for task live details; it just never showed because demo Goals was empty. It now returns an empty "no live output" answer.
- Agent Extensions showed "A current durable instance administrator is required." Extension profiles hold sealed per-installation secrets, so the demo still can't read them. The endpoint now gives the same "read-only demo does not expose this" message as the other closed views, and the UI displays it.

What changed
1. Demo identity. It gets all four instance permissions, so the UI unlocks every area. They only allow `GET`/`HEAD`, and only while demo mode is on. Its role stays `member`, so admin-role-only screens backed by the live host (instance storage) stay closed.
2. Which admin reads the demo can make. Reads served from the curated database are allowed: settings, repos, agents, keywords/labels, summarization, members, role audit, MCP settings and logs. Everything else answers 403 with `DEMO_MODE_LIVE_DATA_UNAVAILABLE`: Agent Tank settings/status/history/detect, runtime packages, agent images and versions, login sessions, visual preview credentials, preview storage, follow-up handoffs, OpenCode models and extension profiles. This is an allowlist (`packages/api/demoViewerRoutes.ts`), so a new admin route stays closed to the demo until someone adds it.
3. Members list. Environment admin usernames (`PROPR_ADMIN_USERS`) are blanked in demo mode, since they come from the host rather than the demo database.
4. Goals. The demo visitor reads every goal in the demo's repositories: list, detail, inputs, needs-attention list, wait, attachments and goal-backed task reads. Goal previews return empty instead of calling GitHub. Pause, delete and the other goal actions keep owner-only lookup, so they would fail even without the write barrier.
5. Inbox. The demo shows the Inbox of whichever user holds the most notifications in the curated data, filtered to the demo repositories, with host health events left out. Nothing is written.
6. Access page. It shows a read-only notice and its controls are disabled in demo mode.
7. CHANGELOG. Added an [Unreleased] Fixed bullet.

Tests
- New API tests:
  - `demoViewerAuthorization.test.ts`: allowed reads return 200, closed reads return 403, every write returns 405, writes are still refused if they get past the write barrier, nothing unlocks with demo mode off, and the extensions refusal.
  - `demoGoalVisibility.test.ts`: uses the real demo Redis replacement; it fails without the 500 fix.
  - `demoInbox.test.ts`
- New UI test `demoViewer.test.tsx`: Settings categories, the Access entry and the read-only Access page for the demo user. It fails with the old empty permission set.
- I updated two existing tests that asserted the old empty demo permissions.
- Results: the affected API suites, 40 related UI test files (453 tests), `npm run lint --workspaces --if-present -- --max-warnings 0`, root lint, and root plus workspace typechecks all pass. After the last two fixes I re-ran the API typecheck and lint, the UI typecheck and the touched suites, not the full lint and typecheck set again.

Previews: before and after for Settings, Access, Goals and Inbox, plus the Agent Extensions section and a goal detail page after the fix.

Behaviour to be aware of
- In Settings, the Visual preview uploads, extension profiles and runtime packages panels show the red "This view reads live installation state, which the read-only demo does not expose" text rather than data. That's intentional, but it is visible.
- The Settings footer still says "Changes save automatically" in demo mode.

Nothing was merged, tagged, published or deployed.
@propr-dev

propr-dev Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: CodeQL

Please investigate and fix this CI failure.

Failure evidence

packages/api/test/demoViewerAuthorization.test.ts:48-52 — Missing rate limiting
This route handler performs authorization, but is not rate-limited.

packages/api/test/demoViewerAuthorization.test.ts:163 — Missing rate limiting
This route handler performs authorization, but is not rate-limited.

@propr-dev

propr-dev Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 00bcd2e

Processed 2 comments:

  • Comment 1 by @github-advanced-security[bot] (ID: 4432695534✓)
  • Comment 2 by @github-advanced-security[bot] (ID: 4432695541✓)

Summary of Changes

I fixed both CodeQL "Missing rate limiting" alerts (#221 and #222). Each throwaway Express app in packages/api/test/demoViewerAuthorization.test.ts now runs a rate limiter before any middleware that sets up the demo user's permissions.

  • What changed: a new rateLimitedApp() helper builds each test app with createRequestRateLimiter({ identifier: 'demo-viewer-test-fixture', limit: 1000, windowMs: 60_000 }) added first. This is the same pattern demoMode.test.ts and followupHandoffRoutes.test.ts already use.
  • Where it applies: all three test apps use it. That covers the two flagged ones (createDemoApp and the extension-profiles app) and the demo-mode-off app, which builds the same kind of server and wasn't flagged.
  • Effect on the tests: none. Every app gets its own limiter, and 1000 requests per minute is well above the number of routes any one test calls, so the limiter never triggers.

The suite passes (7/7), and ESLint with zero warnings allowed is clean when run from packages/api. Only the test file changed and nothing changes visually, so there are no previews.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @github-advanced-security[bot]
  • Time: 2m 48s
  • Tokens: 417,571 (414,670 in / 2,901 out)
  • Cost: $0.34

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 IDs: 4432695534✓, 4432695541✓

…#222). Each throwaway Express app in `packages/api/test/demoViewerAuthorization.test.ts` now runs a rate limiter before any middleware that sets up the demo user's permissions.

I fixed both CodeQL "Missing rate limiting" alerts (#221 and #222). Each throwaway Express app in `packages/api/test/demoViewerAuthorization.test.ts` now runs a rate limiter before any middleware that sets up the demo user's permissions.

- **What changed:** a new `rateLimitedApp()` helper builds each test app with `createRequestRateLimiter({ identifier: 'demo-viewer-test-fixture', limit: 1000, windowMs: 60_000 })` added first. This is the same pattern `demoMode.test.ts` and `followupHandoffRoutes.test.ts` already use.
- **Where it applies:** all three test apps use it. That covers the two flagged ones (`createDemoApp` and the extension-profiles app) and the demo-mode-off app, which builds the same kind of server and wasn't flagged.
- **Effect on the tests:** none. Every app gets its own limiter, and 1000 requests per minute is well above the number of routes any one test calls, so the limiter never triggers.

The suite passes (7/7), and ESLint with zero warnings allowed is clean when run from `packages/api`. Only the test file changed and nothing changes visually, so there are no previews.

PR: #3406
Comment by: @github-advanced-security[bot] (ID: 4432695534)
Comment by: @github-advanced-security[bot] (ID: 4432695541)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 7489058

Summary of Changes

I changed how the rate limiter is set up in packages/api/test/demoViewerAuthorization.test.ts so CodeQL can see it. The CodeQL scan hasn't been re-run yet, so the change isn't confirmed by CI.

What happened: the failure is from commit 99f0224. The next commit, 00bcd2e, was meant to fix both "Missing rate limiting" alerts (#221, #222). But the CodeQL run on that commit was cancelled before it finished, so nothing ever checked that fix.

Why I changed it again: 00bcd2e added the limiter inside a helper, rateLimitedApp(), which created the app and handed it back. CodeQL might not follow that hand-off, and then it would still see the demo-identity setup as not rate-limited. Other test files that CodeQL doesn't flag do it differently: they add the limiter with app.use in the same function that sets up the routes.

The fix: each of the three test apps (the demo app, the demo-mode-off app and the extension-profiles app) now does:

const app = express();
app.use(fixtureRateLimiter());

before any step that sets the demo user's permissions. fixtureRateLimiter() creates a new createRequestRateLimiter limiter, set to 1000 requests a minute, so the tests never hit it.

Checks: all 7 tests pass and ESLint reports no warnings. CodeQL can't run here, so the next CI run is what will show the alerts cleared. I made no previews because nothing changes visually.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-dev[bot]
  • Time: 3m 11s
  • Tokens: 571,106 (567,099 in / 4,007 out)
  • Cost: $0.36

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: 6547062183✓

…est/demoViewerAuthorization.test.ts` so CodeQL can see it. The CodeQL scan hasn't been re-run yet, so the change isn't confirmed by CI.

I changed how the rate limiter is set up in `packages/api/test/demoViewerAuthorization.test.ts` so CodeQL can see it. The CodeQL scan hasn't been re-run yet, so the change isn't confirmed by CI.

**What happened:** the failure is from commit `99f0224`. The next commit, `00bcd2e`, was meant to fix both "Missing rate limiting" alerts (#221, #222). But the CodeQL run on that commit was cancelled before it finished, so nothing ever checked that fix.

**Why I changed it again:** `00bcd2e` added the limiter inside a helper, `rateLimitedApp()`, which created the app and handed it back. CodeQL might not follow that hand-off, and then it would still see the demo-identity setup as not rate-limited. Other test files that CodeQL doesn't flag do it differently: they add the limiter with `app.use` in the same function that sets up the routes.

**The fix:** each of the three test apps (the demo app, the demo-mode-off app and the extension-profiles app) now does:
```ts
const app = express();
app.use(fixtureRateLimiter());
```
before any step that sets the demo user's permissions. `fixtureRateLimiter()` creates a new `createRequestRateLimiter` limiter, set to 1000 requests a minute, so the tests never hit it.

**Checks:** all 7 tests pass and ESLint reports no warnings. CodeQL can't run here, so the next CI run is what will show the alerts cleared. I made no previews because nothing changes visually.

PR: #3406
Comment by: @propr-dev[bot] (ID: 6547062183)
Model: Claude Opus 5.5
@integry

integry commented Oct 31, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev

propr-dev Bot commented Oct 31, 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 Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR restores demo navigation and broadens read access while preserving owner scope for writes. It needs a localized Inbox correction before merge.

✅ Layered write protection — Demo permissions authorize only GET/HEAD, while the existing global middleware rejects mutations before routing.

✅ Bounded goal visibility — Expanded goal reads are constrained to demo repositories; mutation handlers retain ownership checks.

✅ Explicit management boundary — Management routes outside the allowlist reject demo viewers, including newly registered routes.

The supplied checks report 19 passed and no failures or pending checks. This review used static analysis only; no commands were run. The linked objective is truncated, so assessment is limited to its visible requirements and the supplied code.

Merge blockers

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

F1: 🔴 Select an eligible Inbox recipient

  • Required behavior: Demo mode must expose a representative Inbox containing available demo-repository notifications instead of leaving Inbox empty because of identity scoping.

  • Evidence: packages/api/services/demoInbox.ts, representativeRecipient and listNotifications

    1. The database contains recipient A with two inbox-enabled system_failure receipts and recipient B with one unread notification targeting a configured demo repository.
    2. representativeRecipient() counts all inbox-enabled receipts without joining events or applying repository/kind visibility, so it selects A.
    3. listNotifications() retrieves A’s notifications and removes both system events. It returns an empty list with no next cursor. getUnreadNotificationCount() also reports zero.
    4. B’s eligible notification is never considered, leaving the demo Inbox permanently empty despite available content.

    static trace: The selection query, downstream visibility filter, and supplied NotificationService.listNotifications implementation establish this sequence. Repository filtering protects disclosure but cannot correct the recipient selected before filtering. The added test gives the highest-volume recipient visible notifications, so it does not exercise this case.

  • Minimum fix: Select the representative recipient using notifications eligible for the default demo Inbox, applying repository, kind, inbox-enabled, and dismissal filters before ranking recipients. Use the same selection rule for listing and unread counts, and add a regression covering an ineligible highest-volume recipient.

Suggestions

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

S1: 🟢 Exercise real management handlers

The authorization matrix substitutes terminal handlers, and the Settings tests stub most sections. These verify routing and navigation well but cannot establish that allowed handlers return usable demo data or that blocked live-data requests render helpful explanations. An integration test using real handlers and Settings sections would strengthen confidence; no additional handler failure is established by the supplied context.

S2: 🟢 Avoid empty intermediate Inbox pages

listNotifications() filters after the ordinary service applies its page limit. Consequently, a page can contain no visible notifications while retaining a next cursor and having eligible notifications later. Consider filling pages with eligible entries or verifying that the Inbox consumer handles this explicitly. The consumer’s pagination behavior is not supplied, so this is a follow-up rather than a demonstrated additional blocker.

Score

The permission boundaries and targeted tests are strong, and current checks pass. The representative-recipient selection can still reproduce the empty Inbox problem and needs correction.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 34s
  • Tokens: 59,592 (58,707 in / 885 out)
  • Cost: $0.52

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 S1 S2

🤖 Review by ProPR

@integry

integry commented Oct 31, 2026

Copy link
Copy Markdown
Owner

/fix

@propr-dev

propr-dev Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit d5a1bb2

Addressed 1 AI review comment (IDs: 6549611453)

Addressed finding F1

Summary of Changes

I fixed F1. The demo Inbox now picks its representative recipient by counting only notifications the default demo Inbox can actually show. Before, it counted every inbox receipt, so a recipient with mostly host-health or other-repository notifications could win and leave the Inbox empty.

The change (packages/api/services/demoInbox.ts)

  • A new shared filter, eligibleReceipts(repositories), keeps only receipts that:
    • have the inbox enabled,
    • aren't dismissed,
    • aren't system_failure (host health) events,
    • target one of the configured demo repositories. This is checked in SQL with json_extract, which works because the notification store is SQLite, as the notification schema migration and existing queries assume.
  • representativeRecipient ranks recipients on that filter, so someone with no visible notifications can no longer be picked.
  • listNotifications and getUnreadNotificationCount both use the same recipient, and the unread count reuses the same filter, so the list and the badge always agree.
  • If no demo repositories are configured, both return an empty Inbox without querying.

Regressions (packages/api/test/demoInbox.test.ts)

  • Ineligible top recipient: "noisy" has the most receipts, but every one is unshowable: two system_failure, one from another repository, one dismissed and one with the inbox turned off. "reviewer" has a single visible one. The test checks that "reviewer" is chosen and that both the list's unread count and the separate unread count are 1.
  • No demo repositories: returns an empty Inbox and never calls the notification service.
  • The shared table setup moved into a helper, and the existing empty-database test now also creates the events table, since the query joins it.

Verification

  • Against the previous demoInbox.ts, both new tests fail. With the fix, all 5 Inbox tests pass.
  • demoViewerAuthorization.test.ts and notificationRoutes.test.ts (the latter run with --experimental-test-module-mocks) also pass.
  • eslint --max-warnings 0 passes on both files, and tsc reports no errors in them.

Separate observation, not changed: listNotifications still filters the chosen recipient's page after fetching it. A page can therefore come back short, or even empty with a next cursor, if that recipient also has hidden notifications. This was already noted in a code comment and was out of scope here. Choosing an eligible recipient makes it less likely but doesn't remove it.

There's no visible UI change in this fix, so I didn't capture previews.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 4m 16s
  • Tokens: 877,219 (869,809 in / 7,410 out)
  • Cost: $0.55

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: 6549647812✓

…ipient by counting only notifications the default demo Inbox can actually show. Before, it counted every inbox receipt, so a recipient with mostly host-health or other-repository notifications could win and leave the Inbox empty.

I fixed F1. The demo Inbox now picks its representative recipient by counting only notifications the default demo Inbox can actually show. Before, it counted every inbox receipt, so a recipient with mostly host-health or other-repository notifications could win and leave the Inbox empty.

**The change** (`packages/api/services/demoInbox.ts`)
- A new shared filter, `eligibleReceipts(repositories)`, keeps only receipts that:
  - have the inbox enabled,
  - aren't dismissed,
  - aren't `system_failure` (host health) events,
  - target one of the configured demo repositories. This is checked in SQL with `json_extract`, which works because the notification store is SQLite, as the notification schema migration and existing queries assume.
- `representativeRecipient` ranks recipients on that filter, so someone with no visible notifications can no longer be picked.
- `listNotifications` and `getUnreadNotificationCount` both use the same recipient, and the unread count reuses the same filter, so the list and the badge always agree.
- If no demo repositories are configured, both return an empty Inbox without querying.

**Regressions** (`packages/api/test/demoInbox.test.ts`)
- **Ineligible top recipient:** "noisy" has the most receipts, but every one is unshowable: two `system_failure`, one from another repository, one dismissed and one with the inbox turned off. "reviewer" has a single visible one. The test checks that "reviewer" is chosen and that both the list's unread count and the separate unread count are 1.
- **No demo repositories:** returns an empty Inbox and never calls the notification service.
- The shared table setup moved into a helper, and the existing empty-database test now also creates the events table, since the query joins it.

**Verification**
- Against the previous `demoInbox.ts`, both new tests fail. With the fix, all 5 Inbox tests pass.
- `demoViewerAuthorization.test.ts` and `notificationRoutes.test.ts` (the latter run with `--experimental-test-module-mocks`) also pass.
- `eslint --max-warnings 0` passes on both files, and `tsc` reports no errors in them.

**Separate observation, not changed:** `listNotifications` still filters the chosen recipient's page after fetching it. A page can therefore come back short, or even empty with a next cursor, if that recipient also has hidden notifications. This was already noted in a code comment and was out of scope here. Choosing an eligible recipient makes it less likely but doesn't remove it.

There's no visible UI change in this fix, so I didn't capture previews.

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

propr-dev Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

🔀 Resolved merge conflicts from main into 3405/claude-opus-5-5-fix-demo-mode-for-the-0-9-20261031-1710-qul in commit 4652922

Conflicting Files

  • CHANGELOG.md

Resolution Summary

I resolved the one merge conflict, which was in CHANGELOG.md. A search of the whole repository found no other conflict markers. The other files from main (package.json, package-lock.json, docs/dependency-audit-exceptions.md, test/minimatchAdvisory.test.mjs) merged on their own and I didn't touch them.

What the conflict was about: Both branches added a new entry at the top of the ## [Unreleased] section of CHANGELOG.md:

  • This PR added a ### Fixed entry, "Demo mode shows the whole product again". It describes the read-only demo viewer permissions, writes being refused with 405 DEMO_MODE_READ_ONLY, the 403 DEMO_MODE_LIVE_DATA_UNAVAILABLE answer for live installation data, and the Goals and Inbox behaviour in demo mode.
  • main added a ### Security entry for the minimatch denial-of-service advisory (GHSA-g3hv-75wg-m249), fixed with scoped npm overrides.

How I resolved it: I kept both entries, word for word: ### Fixed (this PR) first, then ### Security (from main), separated by a blank line, with all conflict markers removed.

Why: The two entries cover unrelated changes, so neither replaces the other and both need to appear in the release notes. The order follows the Keep a Changelog format the file says it uses, which lists Fixed before Security. I re-read the section afterwards to confirm the Markdown is well formed.


🤖 Resolution Details

  • Model: Claude Opus 5.5
  • Time: 2m 30s

View Task Execution


System-triggered merge conflict resolution

…-mode-for-the-0-9-20261031-1710-qul

Automatically resolved merge conflicts after merging target branch into PR branch.
Resolved conflicts in:
- CHANGELOG.md

PR: #3406
Model: Claude Opus 5.5
@integry

integry commented Oct 31, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev

propr-dev Bot commented Oct 31, 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 Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR restores demo navigation and broadens read access while preserving write restrictions. It needs a localized correction to Inbox pagination before merge.

✅ Layered write protection — Demo permissions authorize only GET/HEAD, while the existing middleware continues rejecting mutations with 405 DEMO_MODE_READ_ONLY.

✅ Scoped goal visibility — Goal reads expand to demo repositories; mutation handlers retain owner checks.

✅ Explicit management boundary — Unlisted management routes reject demo viewers before reaching their handlers.

This review is based on static analysis only; no commands were run. The supplied objective is truncated, so unseen acceptance criteria were not assessed. Current checks report no failures and five pending checks.

Merge blockers

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

F2: 🔴 Filter Inbox notifications before pagination

  • Required behavior: The demo Inbox must expose the representative recipient’s eligible notifications rather than return an empty initial page when eligible notifications exist.

  • Evidence: packages/api/services/demoInbox.ts:listNotifications

    1. The representative recipient has eligible notifications in a demo repository, but their newest 20 receipts are system-health events or events for other repositories.
    2. A demo request with limit: 20 selects this recipient because representativeRecipient correctly counts eligible receipts.
    3. service.listNotifications(recipient, options) applies its limit to all that recipient’s inbox receipts, including the excluded events.
    4. The new adapter filters those 20 results afterward, returning notifications: [] despite eligible older notifications being available. The initial Inbox response therefore reproduces the empty-content symptom this PR intends to fix.

    The returned cursor permits another request, but does not populate the requested page. Recipient ranking and the separately filtered unread count do not prevent this sequence. The added tests use a service stub that ignores pagination, so they do not exercise it.

    static trace: The changed adapter filters after the supplied NotificationService.listNotifications implementation orders and limits its query. No runtime reproduction was executed.

  • Minimum fix: Apply demo repository and event-kind restrictions before pagination, or advance through underlying pages until the visible page is filled or exhausted, preserving a cursor that neither skips nor duplicates eligible notifications. Cover an entirely excluded first underlying page in a regression test.

Suggestions

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

S3: 🟢 Exercise real management readers

The management authorization tests replace every handler with a terminal stub. A follow-up integration test using actual allowlisted readers would strengthen confidence that demo responses come from curated data and do not access live installation state. This is optional coverage improvement; the supplied code does not establish another concrete boundary violation.

Score

The authorization changes are well scoped and have useful regression coverage, but post-pagination Inbox filtering leaves a core symptom reachable. Five checks remain pending, with no reported current failures.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 40s
  • Tokens: 60,905 (59,866 in / 1,039 out)
  • Cost: $0.54

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 F2 S3

🤖 Review by ProPR

@integry

integry commented Oct 31, 2026

Copy link
Copy Markdown
Owner

/fix

@propr-dev

propr-dev Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 5a5e3b7

Addressed 1 AI review comment (IDs: 6549913682)

Addressed finding F2

Summary of Changes

I fixed F2: the demo Inbox now applies its repository and event-kind filters before paging, so the first page is no longer empty when eligible notifications exist further back. The focused test file passes (6/6).

The fix (packages/api/services/demoInbox.ts)

  • listNotifications reads the representative recipient's Inbox 100 receipts at a time (MAX_NOTIFICATION_LIST_LIMIT). It drops host-health events and events for other repositories, and keeps reading until it has the number the request asked for or runs out of receipts.
  • When more remain, the returned cursor points at the last notification actually shown. It uses the same cursor format the service uses, so the next request starts right after it and nothing is skipped or shown twice.
  • When nothing remains, nextCursor is null. Before, it passed on the underlying cursor even when the rest of the Inbox had nothing the demo could show.
  • The page size is checked the same way the normal service checks it.

Regression test (packages/api/test/demoInbox.test.ts)

  • I replaced the old test stub, which ignored paging, with a fake service that pages like the real NotificationService: newest first, with a cursor and a limit.
  • The new test puts 120 hidden receipts in front of three visible ones, with one more hidden receipt between two of them. A request for 2 returns the first two visible notifications and needs two underlying reads, because the first 100 receipts are all hidden. Following its cursor returns the third with nextCursor: null.
  • Run against the previous version of the adapter, the new test fails and the other five pass.
  • ESLint with zero warnings allowed passes on both files, and a type-check of the two files reports no errors in them.

Completeness check: listNotifications was the only place in this PR that paged first and filtered afterwards. The unread count and the choice of recipient already filter in the database query, and getUnreadNotificationCount doesn't page. I found nothing outside F2 to report.

One cost to know about: a recipient with a long run of hidden receipts takes one database query per 100 of them. I didn't move the filtering into NotificationService's own query, because that would mean changing core service code.

There's no visual preview because this change only affects what the API returns.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 3m 58s
  • Tokens: 785,981 (778,380 in / 7,601 out)
  • Cost: $0.56

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: 6550432806✓

…vent-kind filters before paging, so the first page is no longer empty when eligible notifications exist further back. The focused test file passes (6/6).

I fixed F2: the demo Inbox now applies its repository and event-kind filters before paging, so the first page is no longer empty when eligible notifications exist further back. The focused test file passes (6/6).

**The fix (`packages/api/services/demoInbox.ts`)**
- `listNotifications` reads the representative recipient's Inbox 100 receipts at a time (`MAX_NOTIFICATION_LIST_LIMIT`). It drops host-health events and events for other repositories, and keeps reading until it has the number the request asked for or runs out of receipts.
- **When more remain**, the returned cursor points at the last notification actually shown. It uses the same cursor format the service uses, so the next request starts right after it and nothing is skipped or shown twice.
- **When nothing remains**, `nextCursor` is `null`. Before, it passed on the underlying cursor even when the rest of the Inbox had nothing the demo could show.
- The page size is checked the same way the normal service checks it.

**Regression test (`packages/api/test/demoInbox.test.ts`)**
- I replaced the old test stub, which ignored paging, with a fake service that pages like the real `NotificationService`: newest first, with a cursor and a limit.
- The new test puts 120 hidden receipts in front of three visible ones, with one more hidden receipt between two of them. A request for 2 returns the first two visible notifications and needs two underlying reads, because the first 100 receipts are all hidden. Following its cursor returns the third with `nextCursor: null`.
- Run against the previous version of the adapter, the new test fails and the other five pass.
- ESLint with zero warnings allowed passes on both files, and a type-check of the two files reports no errors in them.

**Completeness check:** `listNotifications` was the only place in this PR that paged first and filtered afterwards. The unread count and the choice of recipient already filter in the database query, and `getUnreadNotificationCount` doesn't page. I found nothing outside F2 to report.

One cost to know about: a recipient with a long run of hidden receipts takes one database query per 100 of them. I didn't move the filtering into `NotificationService`'s own query, because that would mean changing core service code.

There's no visual preview because this change only affects what the API returns.

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

propr-dev Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

🔀 Resolved merge conflicts from main into 3405/claude-opus-5-5-fix-demo-mode-for-the-0-9-20261031-1710-qul in commit 104b613

Conflicting Files

  • CHANGELOG.md

Resolution Summary

I resolved the one conflict, in CHANGELOG.md. A search of the whole repository (excluding node_modules and .git) found no other conflict markers.

What the conflict was about: Both branches added a new bullet at the same spot, the top of ## [Unreleased] → ### Fixed, so git couldn't decide which to keep.

  • This PR's entry: "Demo mode shows the whole product again". It describes the demo visitor becoming a read-only viewer, the 405 DEMO_MODE_READ_ONLY and 403 DEMO_MODE_LIVE_DATA_UNAVAILABLE responses, and the Goals and Inbox behaviour for the demo repositories.
  • main's entry: "Agent image on rootless and restricted Docker hosts". It describes the single-layer Dockerfile.agent without overlayfs whiteouts, the pinned Node base, and the new scripts/check-image-whiteouts.sh check in the smoke tests.

How I resolved it: I kept both entries word for word, with the PR's entry first and main's right after it, and removed all the conflict markers. I also dropped the blank line the merge left between them, since the other entries in the file sit directly under each other.

Why: The two entries describe unrelated fixes, so neither replaces the other. A changelog should list every change, so keeping both is the only correct result. I changed no wording, so each branch's description stays accurate. The result is valid Markdown, and the ### Security section after it is unchanged.


🤖 Resolution Details

  • Model: Claude Opus 5.5
  • Time: 2m 49s

View Task Execution


System-triggered merge conflict resolution

…-mode-for-the-0-9-20261031-1710-qul

Automatically resolved merge conflicts after merging target branch into PR branch.
Resolved conflicts in:
- CHANGELOG.md

PR: #3406
Model: Claude Opus 5.5
@integry

integry commented Oct 31, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev

propr-dev Bot commented Oct 31, 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 Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR restores demo navigation and broadens Goals and Inbox visibility while retaining read-only authorization. It needs a localized correction to dismissed-notification handling before merge.

✅ Layered write protection — Demo permissions authorize only GET/HEAD, and the existing API write barrier retains the 405 DEMO_MODE_READ_ONLY response.

✅ Explicit management boundary — Management routes default to refusing demo access unless explicitly allowed; extension profiles and OpenCode discovery also receive explicit protection.

✅ Repository-scoped goal access — Expanded goal reads remain repository-bounded, while mutations retain owner checks.

This review used static analysis only; no commands were run. The supplied issue description is truncated, so assessment covers its visible requirements. Current checks report no failures and seven pending checks.

Merge blockers

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

F3: 🔴 Dismissed Inbox entries can disappear

  • Required behavior: The changed demo Inbox must honor the supported includeDismissed list option rather than returning an empty result when eligible dismissed notifications exist.

  • Evidence: packages/api/services/demoInbox.ts, eligibleReceipts, representativeRecipient, and listNotifications

    1. The curated database contains inbox-enabled receipts targeting a configured demo repository, but all those receipts have dismissed_at set.
    2. A demo visitor requests /api/notifications?includeDismissed=true. The route forwards that option to the new demo reader.
    3. representativeRecipient uses eligibleReceipts, which unconditionally applies whereNull('receipt.dismissed_at'). It therefore finds no recipient.
    4. listNotifications immediately returns an empty list without calling the ordinary notification service, although that service explicitly supports returning dismissed receipts.

    The observable result is that dismissed notifications cannot be inspected even when requested. Repository filtering and the write barrier do not address this selection error. Existing tests cover empty databases and dismissed receipts excluded from default selection, but do not cover an entirely dismissed Inbox requested with includeDismissed=true. Verification provenance: static trace of the supplied reader, route, and notification-service implementation.

  • Minimum fix: Preserve the default representative selection, but when includeDismissed=true and no default representative exists, select a representative from eligible receipts including dismissed ones. Keep unread counting restricted to undismissed receipts and add a regression covering this case.

Suggestions

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

S4: 🟢 Exercise the real Inbox service

The new Inbox tests use service results whose event IDs differ from the database receipts used for recipient selection and unread counts. An integration test using the actual NotificationService would verify selection, filtering, pagination, and counts together. This is optional additional coverage beyond the focused regression required above.

S5: 🟢 Bound hidden-receipt scanning

The demo reader scans underlying pages until it finds enough visible notifications or exhausts the recipient’s Inbox. A large hidden history can make a small request expensive. Consider applying repository and kind filtering within the database query as a performance follow-up; no supplied evidence establishes a current operational failure.

Score

The authorization changes are careful and well covered, but the new Inbox reader has a concrete option-handling defect. Current checks have no reported failures, with seven still pending.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 37s
  • Tokens: 62,046 (61,009 in / 1,037 out)
  • Cost: $0.55

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 S4 S5

🤖 Review by ProPR

@integry

integry commented Nov 1, 2026

Copy link
Copy Markdown
Owner

/fix F3
While in packages/api/services/demoInbox.ts, check every list option the ordinary notification service supports (includeDismissed, read/unread filters, category or repository filters, pagination cursors) against the demo representative selection in one pass, so this doesn't take another review round per option. Add a test per option.

@propr-dev

propr-dev Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 3534fdd

Addressed 1 AI review comment (IDs: 6550535702)

Addressed finding F3

Summary of Changes

I fixed F3: the demo Inbox now shows dismissed notifications when the visitor asks for includeDismissed=true, even if every eligible receipt is dismissed. The demo Inbox tests pass (10/10) and the notification route tests pass (15/15). Lint is clean, and the root typecheck reports nothing for these files.

Options the ordinary service supports. NotificationService.listNotifications (packages/core/src/services/notificationService.ts:132) accepts only three options: cursor, limit and includeDismissed. The route reads the same three. There are no read/unread, category or repository filters, so those had nothing to check or test.

Changes in packages/api/services/demoInbox.ts:

  • includeDismissed (F3): the demo still reads the same representative user's Inbox as before, so turning the option on never switches to a different user's Inbox. Only when no one has an active notification to show does it fall back to the user with the most eligible receipts, dismissed ones included. The unread count still counts only undismissed receipts, as the ordinary service does.
  • Same defect, cursor: the reader used to return an empty list before checking its options when there was no representative, so a malformed cursor or a non-boolean includeDismissed gave an empty result instead of an error. It now checks limit, includeDismissed and cursor first, as the ordinary service does. Through the HTTP route the route already rejected these, so this only affected direct calls to the reader.

Tests added to packages/api/test/demoInbox.test.ts, one or more per option:

  • includeDismissed:
    • An Inbox where everything is dismissed is empty by default but listed when dismissed receipts are requested; the option reaches the ordinary service and the unread count stays 0.
    • A user with more dismissed receipts doesn't replace the default representative, and a non-boolean value is rejected.
  • cursor: the cursor reaches the representative's Inbox, and a malformed one is rejected even when no representative exists.
  • limit: results come back at the requested page size with a correct next cursor, and an invalid limit is rejected.

I also ran the new tests against the previous version of the reader: the two includeDismissed tests and the cursor test fail there. The limit test passes on both versions, so it only guards current behaviour.

There's no visual change, so I didn't capture previews.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @integry
  • Time: 4m 52s
  • Tokens: 808,948 (801,208 in / 7,740 out)
  • Cost: $0.55

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: 6551077989✓

…s when the visitor asks for `includeDismissed=true`, even if every eligible receipt is dismissed. The demo Inbox tests pass (10/10) and the notification route tests pass (15/15). Lint is clean, and the root typecheck reports nothing for these files.

I fixed F3: the demo Inbox now shows dismissed notifications when the visitor asks for `includeDismissed=true`, even if every eligible receipt is dismissed. The demo Inbox tests pass (10/10) and the notification route tests pass (15/15). Lint is clean, and the root typecheck reports nothing for these files.

**Options the ordinary service supports.** `NotificationService.listNotifications` (`packages/core/src/services/notificationService.ts:132`) accepts only three options: `cursor`, `limit` and `includeDismissed`. The route reads the same three. There are no read/unread, category or repository filters, so those had nothing to check or test.

**Changes in `packages/api/services/demoInbox.ts`:**
- **`includeDismissed` (F3):** the demo still reads the same representative user's Inbox as before, so turning the option on never switches to a different user's Inbox. Only when no one has an active notification to show does it fall back to the user with the most eligible receipts, dismissed ones included. The unread count still counts only undismissed receipts, as the ordinary service does.
- **Same defect, `cursor`:** the reader used to return an empty list before checking its options when there was no representative, so a malformed cursor or a non-boolean `includeDismissed` gave an empty result instead of an error. It now checks `limit`, `includeDismissed` and `cursor` first, as the ordinary service does. Through the HTTP route the route already rejected these, so this only affected direct calls to the reader.

**Tests added to `packages/api/test/demoInbox.test.ts`, one or more per option:**
- **`includeDismissed`:**
  - An Inbox where everything is dismissed is empty by default but listed when dismissed receipts are requested; the option reaches the ordinary service and the unread count stays 0.
  - A user with more dismissed receipts doesn't replace the default representative, and a non-boolean value is rejected.
- **`cursor`:** the cursor reaches the representative's Inbox, and a malformed one is rejected even when no representative exists.
- **`limit`:** results come back at the requested page size with a correct next cursor, and an invalid limit is rejected.

I also ran the new tests against the previous version of the reader: the two `includeDismissed` tests and the cursor test fail there. The `limit` test passes on both versions, so it only guards current behaviour.

There's no visual change, so I didn't capture previews.

PR: #3406
Comment by: @integry (ID: 6551077989)
Model: Claude Opus 5.5
@integry

integry commented Nov 1, 2026

Copy link
Copy Markdown
Owner

/review

@propr-dev

propr-dev Bot commented Nov 1, 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 1, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

Ready to merge within the visible scope, conditional on the pending Validate Changes check completing successfully. The implementation restores demo visibility while preserving read-only authorization and repository boundaries.

✅ Layered write protection — Demo permissions authorize only GET/HEAD while demo mode is enabled; the existing API middleware still rejects mutations.

✅ Restricted management access — An explicit allowlist opens curated management reads while other management routes reject demo viewers.

✅ Consistent Inbox pagination — Representative selection excludes hidden receipts, and pagination scans past hidden notifications without skipping visible results.

This is a static review of the supplied code; no commands or tests were run. The linked issue text is explicitly truncated, so acceptance assessment covers its visible requirements. Current checks report no failures, with one pending.

Merge blockers

No merge blockers.

Suggestions

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

S6: 🟢 Exercise the real notification service

Add an integration test using NotificationService and the same database as representative selection. In packages/api/test/demoInbox.test.ts, the service stub returns notifications unrelated to the seeded receipt IDs and does not implement dismissed filtering. The existing tests verify selection and option forwarding, but a shared database fixture would better detect divergence between selection, returned notifications, and unread counts. This is optional coverage improvement; the supplied service implementation supports the current logic.

Score

The changed paths have coherent access boundaries and substantial regression coverage, with no verified merge blocker. Merge readiness remains conditional on the pending validation check.

Score: 9/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 21s
  • Tokens: 64,512 (64,023 in / 489 out)
  • Cost: $0.56

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 S6

🤖 Review by ProPR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants