Skip to content

[PROJ-1821] Align the Corgi Commons cold-start story - #357

Merged
AndrewNordstrom merged 9 commits into
mainfrom
dev/PROJ-1821-cold-start-story-alignment
Jul 13, 2026
Merged

AndrewNordstrom merged 9 commits into
mainfrom
dev/PROJ-1821-cold-start-story-alignment

Conversation

@AndrewNordstrom

@AndrewNordstrom AndrewNordstrom commented Jul 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • align the homepage, how-it-works, demo, start, and authenticated product surfaces around Corgi Commons
  • explain signals, topics, content rules, publication, Bluesky rendering, and Corgi receipts consistently
  • merge the approved production lifecycle contract so operator approval applies signals, topics, and adopted rules before durable rescore
  • add a compare-and-swap feed-record updater plus a mechanical, review-gated Corgi Commons snapshot approval path
  • make snapshot capture fail closed: weak live cohorts emit only a non-approvable report, never a fixture-backed live manifest or review sheet
  • regenerate full and public OpenAPI artifacts and guard current product claims with focused tests

Verification

  • npm run verify (150 files, 1,653 tests plus backend and both frontend builds)
  • npm run docs:verify
  • cd web-next && npm run lint && npx tsc --noEmit && npm run build
  • focused cold-start, lifecycle, content-rule, and demo snapshot tests
  • staged lease validation and git diff --cached --check

Release boundary

  • the approved snapshot manifest is not hand-edited in this PR; it will be recaptured from the deployed Corgi Commons runtime and can land only if the live cohort passes every objective gate and the matching review sheet is acknowledged
  • the current production preflight fails the reviewer-safe snapshot gates, so the demo must remain on its explicitly labeled mechanics fixture unless a later capture passes
  • the live Bluesky record update remains compare-and-swap and deployment-gated
  • five unbriefed human comprehension sessions remain a manual evidence step and are not claimed here

Linear: PROJ-1821

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 23 minutes

Your organization has reached its usage spending cap. Adjust your spending cap in the billing tab.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4371cb2b-281a-4de0-b1bc-9e00440beb81

📥 Commits

Reviewing files that changed from the base of the PR and between 7999508 and 9991252.

📒 Files selected for processing (28)
  • docs/SYSTEM_OVERVIEW.md
  • docs/agent/REPO_CONTRACT.md
  • docs/docs-site/openapi.json
  • docs/openapi-public.json
  • docs/openapi.json
  • ops/receipts/2026-07-13/PROJ-1821/validation.md
  • scripts/generate-openapi.ts
  • src/admin/routes/status.ts
  • src/demo/corpus.ts
  • src/demo/snapshot-capture.ts
  • src/governance/routes/vote.ts
  • tests/admin-status.test.ts
  • tests/corgi-cold-start-product-story.test.ts
  • tests/demo-v4-snapshot-source.test.ts
  • tests/generate-openapi-cleanup.test.ts
  • tests/governance-query-validation.test.ts
  • tests/topic-voting.test.ts
  • tests/votable-params-record-shape.test.ts
  • tests/web-next-admin-lifecycle.test.ts
  • tests/web-next-governance-status.test.ts
  • tests/web-next-homepage-anchors.test.ts
  • web-next/app/admin/page.tsx
  • web-next/app/docs/page.tsx
  • web-next/app/how-it-works/page.tsx
  • web-next/app/proposals/page.tsx
  • web-next/lib/admin-lifecycle.ts
  • web-next/lib/api/admin.ts
  • web-next/lib/governance-status.ts

Walkthrough

The PR reframes Corgi Commons as an approved governance pilot, documents reviewed policy application, expands OpenAPI contracts, adds snapshot approval tooling, centralizes content-rule matching, updates admin lifecycle controls, and aligns public, demo, documentation, and test surfaces.

Changes

Corgi Commons pilot alignment

Layer / File(s) Summary
Pilot narrative and governance contracts
README.md, docs/*, docs/agent/*, docs/openapi*.json
Updates pilot eligibility, aggregation, review/approval, rescoring, transparency, waitlist, demo, debug, admin, and statistics-provenance contracts.
Snapshot capture, approval, and feed metadata
scripts/*, src/demo/snapshot-capture.ts, src/feed/*
Adds gated capture reports, approval validation, artifact cleanup/write controls, compare-and-swap Bluesky metadata updates, and Corgi Commons snapshot compatibility.
Governance runtime and lifecycle
src/governance/*, src/admin/routes/*, web-next/app/admin/*, web-next/lib/api/*
Restricts voting to approved participants, exposes approval timestamps, disables direct transitions, centralizes content matching, and replaces direct admin application with approval/rejection controls.
Public and demo surfaces
web-next/app/*, web-next/components/*, web-next/lib/replay-model.ts
Aligns product copy, demo disclosures, replay content, receipts, navigation, scoring explanations, and Bluesky/Corgi boundaries with the frozen Corgi Commons corpus.
Validation and regression coverage
tests/*, web-next/*/__tests__/*, web-next/e2e/*
Adds coverage for pilot allowlisting, approved-participant counts, lifecycle conflicts, snapshot gates, malformed demo payloads, narrative boundaries, and renamed public metadata.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PilotParticipant
  participant GovernanceUI
  participant GovernanceAPI
  participant Operator
  participant Rescore
  PilotParticipant->>GovernanceUI: Submit policy ballot
  GovernanceUI->>GovernanceAPI: Close voting window
  GovernanceAPI->>Operator: Present aggregated policy for review
  Operator->>GovernanceAPI: Approve or reject policy
  GovernanceAPI->>Rescore: Apply approved policy and queue rescore
Loading

Possibly related issues

  • PROJ-1821 — Directly covers the cold-start story alignment implemented across public, demo, governance, documentation, API, and Bluesky surfaces.
  • PROJ-1818 — Covers the broader Corgi Commons lifecycle, waitlist pilot, demo isolation, snapshot approval, and public-surface alignment.
  • PROJ-1753 — Overlaps with demo clarity, onboarding, corpus safety, and Corgi Commons presentation updates.

Possibly related PRs

Suggested labels: documentation, javascript

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.95% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the PR’s main change: aligning the Corgi Commons cold-start story.
Description check ✅ Passed The description is clearly related and matches the story, lifecycle, snapshot, and OpenAPI updates in the changeset.
Linked Issues check ✅ Passed The changes align with the linked issue goals across public/demo/authenticated copy, approval flow, snapshot capture, and record safety.
Out of Scope Changes check ✅ Passed No clearly unrelated code changes stand out; the added docs, routes, scripts, and tests all support the stated Corgi Commons alignment.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev/PROJ-1821-cold-start-story-alignment
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch dev/PROJ-1821-cold-start-story-alignment

Warning

Review ran into problems

🔥 Problems

These MCP integrations need to be re-authenticated in the Integrations settings: Notion


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

@AndrewNordstrom
AndrewNordstrom marked this pull request as ready for review July 13, 2026 20:22
@AndrewNordstrom

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot added documentation Improvements or additions to documentation javascript Pull requests that update javascript code labels Jul 13, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 16

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/content-filter-matching.test.ts (1)

1-72: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Missing edge-case coverage: null text, empty rules, and exclude-side prefix matching.

The suite covers include-keyword whole-word/phrase matching well, but misses cases the source function explicitly branches on:

  • checkContentRules(null, { includeKeywords: [...], excludeKeywords: [] }) → should return { passes: false, reason: 'no_text_with_include_filter' }.
  • checkContentRules(null, { includeKeywords: [], excludeKeywords: [] }) → should return { passes: true }.
  • checkContentRules(text, { includeKeywords: [], excludeKeywords: [] }) → should short-circuit { passes: true }.
  • Exclude keywords use prefixMatch: true in matchesKeyword, so a word-based exclude keyword (e.g. 'foss') should also match inside a larger word (e.g. 'fossil') via the boundary regex — unlike include keywords. Only the substring-fallback path ('18+') is tested for exclude; the word-boundary path's prefix behavior for excludes is unverified.

As per path instructions for **/*.test.ts: "Check for tests that only cover the happy path. Suggest edge cases: empty inputs, boundary values, null/undefined, ... and error conditions."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/content-filter-matching.test.ts` around lines 1 - 72, Add tests in the
content filter matching suite for null text with include rules, null text with
empty rules, and non-null text with empty rules, asserting the documented
results. Also add an exclude-keyword case using a word keyword such as “foss”
against “fossil” to verify prefix matching through the boundary-regex path,
while preserving the existing include whole-word behavior.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/agent/REPO_CONTRACT.md`:
- Around line 121-122: Update Gotcha `#3` in REPO_CONTRACT.md to point frontend
installation instructions at the canonical web-next/ application, or explicitly
list both web-next/ and web/ if setup still requires both. Align the commands
with the frontend targeted by npm run verify and avoid directing new
contributors to web/ alone.

In `@docs/openapi.json`:
- Around line 2314-2373: Update the OpenAPI definitions for
/api/governance/epochs/transition and /api/admin/governance/end-round to remove
the ineffective force parameter and advertised 200 transition payload, and
document their 409 DirectTransitionDisabled response instead. Add a contract
test covering both disabled endpoints and snapshotting their 409 responses.
- Around line 12207-12234: The 400 response for the full-dataset export is
incorrectly documented as application/zip. Update the export route schema near
the full-dataset handler so 200 remains application/zip while 400 uses
application/json, then add a regression test asserting both response content
types.

In `@scripts/approve-demo-snapshot.ts`:
- Around line 68-107: Protect the approved artifact in main by checking whether
options.outputPath already exists before writeFile; refuse to overwrite either a
valid approved manifest or unrelated existing file unless a --force option is
present in argv. Extend parseOptions and its option typing to recognize --force,
preserve current behavior for new paths, and add tests covering both
existing-file rejection and forced overwrite.

In `@scripts/generate-openapi.ts`:
- Around line 72-79: Update the cleanup logic in the finally block of
generate-openapi so app.close(), db.end(), and redis.quit() are executed through
the same Promise.allSettled call. Ensure a failure from any one cleanup
operation does not prevent the remaining application, database, or Redis handles
from being closed.

In `@scripts/update-corgi-commons-record.ts`:
- Around line 32-33: Update the network calls in the script’s login, getRecord,
and putRecord flows to use AbortController-based timeouts (approximately 10–15
seconds), passing the abort signal through each request. Catch aborted requests
and surface a clear timeout error instead of allowing the deployment step to
hang, and preserve distinct handling for swapRecord CID mismatches by reporting
a clear CAS-conflict error.
- Line 1: Migrate the script’s BskyAgent usage to the current `@atproto/api` Agent
and CredentialSession authentication pattern, first confirming the installed API
version’s guidance and exports. Update the initialization and login flow while
preserving the existing getRecord and putRecord behavior, including CAS
semantics.

In `@src/governance/content-rule-matcher.ts`:
- Around line 5-46: Bound the module-level keywordMatcherCache used by
getKeywordMatcher so distinct keyword/prefixMatch combinations cannot grow
indefinitely. Implement a simple maximum-size eviction policy, such as removing
the least-recently-used entry on insertion and refreshing hits, while preserving
matcher reuse and existing matching behavior in matchesKeyword.

In `@src/governance/routes/epochs.ts`:
- Line 190: Align the subscriber_count response contract with its query in the
current epoch endpoint: either join approved_participants so only approved
active subscribers are counted, or rename the field and description to reflect
all active subscribers. Add a regression test for /api/governance/epochs/current
covering both approved-active and pending-active rows, asserting the intended
count and response contract.

In `@src/governance/routes/vote.ts`:
- Line 6: Update the route documentation near the vote handler to describe the
conditional isParticipantApproved gate controlled by config.FEED_PRIVATE_MODE,
unless the intended policy is to enforce approval unconditionally. Add coverage
for active subscribers in default mode and for the approval requirement when
FEED_PRIVATE_MODE is true.

In `@tests/web-next-homepage-anchors.test.ts`:
- Around line 51-58: Expand the landing-page text guard in the test labeled
“labels the landing replay as an illustrative Corgi Commons preview” to include
the source of every component rendered by web-next/app/page.tsx, including
HeroSection, SocialProof, CommunityExamplesSection, BentoSection, FAQSection,
and CTASection, or assert against the rendered route text. Preserve the existing
positive assertions while ensuring “Birders Who Code” is rejected anywhere in
the complete homepage content.

In `@tests/web-next-landing-ctas-render.test.tsx`:
- Line 102: Strengthen the CTA assertion in the render test by retaining the
visible “Try the governance demo” check and also verifying that the rendered CTA
has href="/demo". Add a regression case covering a missing or incorrectly wired
CTA destination, using the existing DemoCTA render/test setup and preserving the
current label assertion.

In `@web-next/app/admin/page.tsx`:
- Around line 181-192: Surface failures for the lifecycle mutations
openMutation, closeMutation, approveMutation, and rejectMutation by deriving a
lifecycle error state from their mutation errors and rendering an “Action failed
— try again.” message in each associated ConfirmModal (or once above the
lifecycle actions). Keep the modal open on failure, clear confirmation only on
success, and preserve the existing invalidation behavior.

In `@web-next/app/demo/__tests__/http-client.test.ts`:
- Line 294: Extend the HTTP client tests around the existing community-name
assertion with table-driven cases for empty/null community identity, missing or
stale corpus provenance, duplicate topic slugs, and null/undefined payload
fields, asserting the exact parser and client error behavior. Add non-2xx
response tests and concurrent-request coverage if the client shares session
state, ensuring mocks reflect the real parser and response handling.

In `@web-next/app/proposals/page.tsx`:
- Line 148: Update the enacted-proposals filtering in the proposals page to
require an explicit enacted/approved status from the epoch-history response,
rather than relying only on closed_at. Trace the epoch-history response type and
API mapping to expose or preserve that status, apply the predicate to the
rendered list, and add a test confirming a closed rejected epoch remains
excluded.

In `@web-next/components/bento-section.tsx`:
- Line 128: Update the sequence arrow visibility in the step layout around the
six-column grid and the arrow-rendering element near lines 136–139 so arrows
remain hidden whenever the layout wraps at md widths; show them only at the xl
single-row breakpoint. Add a responsive regression check covering the md
breakpoint to verify row-ending arrows are not rendered.

---

Outside diff comments:
In `@tests/content-filter-matching.test.ts`:
- Around line 1-72: Add tests in the content filter matching suite for null text
with include rules, null text with empty rules, and non-null text with empty
rules, asserting the documented results. Also add an exclude-keyword case using
a word keyword such as “foss” against “fossil” to verify prefix matching through
the boundary-regex path, while preserving the existing include whole-word
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 94b5e157-b2af-4f47-8a8b-3b391d93e9c5

📥 Commits

Reviewing files that changed from the base of the PR and between 7bac290 and 2d6dcc8.

📒 Files selected for processing (68)
  • README.md
  • docs/PRD.md
  • docs/SYSTEM_OVERVIEW.md
  • docs/agent/REPO_CONTRACT.md
  • docs/docs-site/openapi.json
  • docs/openapi-public.json
  • docs/openapi.json
  • package.json
  • scripts/approve-demo-snapshot.ts
  • scripts/demo-snapshot-capture.ts
  • scripts/generate-openapi.ts
  • scripts/publish-feed.ts
  • scripts/update-corgi-commons-record.ts
  • src/bot/announcements.ts
  • src/demo/content-rules.ts
  • src/demo/corpus.ts
  • src/demo/service.ts
  • src/feed/demo-snapshot-source.ts
  • src/feed/server.ts
  • src/governance/content-filter.ts
  • src/governance/content-rule-matcher.ts
  • src/governance/routes/epochs.ts
  • src/governance/routes/vote.ts
  • tests/content-filter-matching.test.ts
  • tests/corgi-cold-start-product-story.test.ts
  • tests/demo-content-rules.test.ts
  • tests/demo-v4-routes.test.ts
  • tests/demo-v4-snapshot-source.test.ts
  • tests/web-next-demo-fixtures.test.ts
  • tests/web-next-homepage-anchors.test.ts
  • tests/web-next-landing-ctas-render.test.tsx
  • web-next/app/about/page.tsx
  • web-next/app/admin/page.tsx
  • web-next/app/dashboard/page.tsx
  • web-next/app/demo/__tests__/demo-copy.test.ts
  • web-next/app/demo/__tests__/frontend-release-blockers.test.tsx
  • web-next/app/demo/__tests__/http-client.test.ts
  • web-next/app/demo/layout.tsx
  • web-next/app/demo/page.tsx
  • web-next/app/demo/shadow-demo-api-schemas.ts
  • web-next/app/demo/shadow-demo-copy.ts
  • web-next/app/demo/shadow-demo-fixtures.ts
  • web-next/app/docs/page.tsx
  • web-next/app/history/page.tsx
  • web-next/app/how-it-works/page.tsx
  • web-next/app/not-found.tsx
  • web-next/app/page.tsx
  • web-next/app/post/page.tsx
  • web-next/app/proposals/page.tsx
  • web-next/app/start/page.tsx
  • web-next/app/vote/page.tsx
  • web-next/components/bento-section.tsx
  • web-next/components/community-examples-section.tsx
  • web-next/components/demo/community-picker.tsx
  • web-next/components/demo/live-proof-panel.tsx
  • web-next/components/demo/vote-panel.tsx
  • web-next/components/faq-section.tsx
  • web-next/components/feed/corgi-rank-badge.tsx
  • web-next/components/footer-section.tsx
  • web-next/components/header.tsx
  • web-next/components/hero-section.tsx
  • web-next/components/how-it-works-replay.tsx
  • web-next/components/landing-ctas.tsx
  • web-next/components/replay-teaser.tsx
  • web-next/components/social-proof.tsx
  • web-next/e2e/production-hard-refresh.spec.ts
  • web-next/lib/api/admin.ts
  • web-next/lib/replay-model.ts

Comment thread docs/agent/REPO_CONTRACT.md
Comment thread docs/openapi.json Outdated
Comment thread docs/openapi.json
Comment thread scripts/approve-demo-snapshot.ts
Comment thread scripts/generate-openapi.ts Outdated
Comment thread tests/web-next-landing-ctas-render.test.tsx
Comment thread web-next/app/admin/page.tsx Outdated
Comment thread web-next/app/demo/__tests__/http-client.test.ts
Comment thread web-next/app/proposals/page.tsx
Comment thread web-next/components/bento-section.tsx
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 13, 2026
@AndrewNordstrom

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
putComment timed out

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 14

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/demo/corpus.ts (1)

335-352: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Quality-only reviewer gate failures can still report live health. Capture mode adds a warning but does not downgrade health unless the count gates already failed.

  • src/demo/corpus.ts#L335-L352: set health.status to degraded whenever gateFailures is non-empty.
  • tests/demo-v4-snapshot-source.test.ts#L415-L432: add independent English-share, rich-media, and author-concentration failures, including threshold boundaries.

AI agent prompt: Implement the health downgrade and parameterize tests for every reviewer-safe gate.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/demo/corpus.ts` around lines 335 - 352, Update the corpus health result
near the warning construction so any non-empty gateFailures sets health.status
to degraded, including quality-only reviewer gate failures. In
tests/demo-v4-snapshot-source.test.ts lines 415-432, parameterize independent
English-share, rich-media, and author-concentration failure cases, covering each
gate’s threshold boundaries.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/agent/REPO_CONTRACT.md`:
- Around line 138-141: Update Gotcha `#3` in REPO_CONTRACT.md to instruct
contributors to install dependencies in web-next as the canonical frontend,
while mentioning web only for legacy compatibility, matching the setup block’s
order and scope.

In `@docs/SYSTEM_OVERVIEW.md`:
- Around line 131-138: Insert a blank line before the governance_audit_log and
subscribers headings in the schema documentation, preserving all existing
heading and paragraph content.
- Around line 166-168: Update the Content-Rule Governance paragraph to use
explicit “include-keyword rules” and “exclude-keyword rules” terminology, while
preserving the existing allowlist behavior, precedence, approved signal and
topic policy, rescoring, and bounded demo scope.

In `@scripts/generate-openapi.ts`:
- Around line 71-83: Update the cleanup logic in the generator’s finally block
so cleanup failures do not replace an error thrown by the main generation flow,
preserving the original “Failed to fetch spec” or parsing error when both
operations fail. Only surface the cleanup AggregateError when the try block
completed successfully, and add coverage for a failed app.inject response
combined with rejected db.end and redis.quit calls.

In `@src/demo/snapshot-capture.ts`:
- Around line 75-81: Update the approvable artifact-writing flow after the
options.report.approvable check to prevent partial outputs: write the manifest
and review sheet sequentially or via temporary files, and on any write failure
remove both final approval artifacts after all in-flight writes have settled.
Preserve report writing and ensure neither manifest nor reviewSheet remains when
either artifact write fails.

In `@src/governance/routes/vote.ts`:
- Around line 244-247: Recheck participant approval within the vote transaction
before the ballot write, using the approved_participants row lock or equivalent
transactional guard so revocation cannot race with INSERT or UPDATE. Update the
vote path around isParticipantApproved and the governance_votes write, and add
tests covering revoke-before-write and concurrent revoke/write behavior.

In `@tests/corgi-cold-start-product-story.test.ts`:
- Around line 160-179: Generalize the OpenAPI contract test around the existing
disabled-lifecycle and full-dataset assertions to load and validate
docs/openapi.json, docs/openapi-public.json, and docs/docs-site/openapi.json.
Apply the transition and media-type checks to every spec, then add structural
equality assertions for shared contracts including /api/governance/vote
requestBody, /api/governance/waitlist, and transparency stats_status.required so
regeneration drift is detected.

In `@tests/governance-query-validation.test.ts`:
- Around line 104-168: Add coverage in the governance epoch tests for a
pending-review epoch with results_approved_at set to null, asserting the
response preserves null, and for /api/governance/epochs/current when the
approved-participant count is '0', asserting subscriber_count is 0. Reuse the
existing Fastify setup and dbQueryMock patterns in the current test suite.

In `@tests/web-next-homepage-anchors.test.ts`:
- Around line 65-69: Extend the assertions for renderedHomepageContent in the
homepage anchor test to require both “Illustrative preview” and “frozen snapshot
sourced from Corgi Commons.” Preserve the existing pageContent assertions and
retired-name check, using the already aggregated ReplayTeaser source content.

In `@web-next/app/admin/page.tsx`:
- Line 253: Update the participation copy and calculation in the relevant admin
page component so they use the approved-participant count contract rather than
feed.subscriberCount, or retain subscriber-specific wording if that count is
intentionally used. Trace the existing approved-participant data source and use
it as the denominator, then add regression coverage where subscriber and
approved-participant totals differ.
- Around line 203-212: Update invalidate in the admin page to return a combined
promise for all three queryClient.invalidateQueries calls, then make each
onSuccess handler in openMutation, closeMutation, approveMutation, and
rejectMutation async and await invalidate before closing the confirmation modal.
Add a delayed-invalidation test verifying lifecycle controls remain disabled and
cannot be resubmitted until the refreshed state is available.

In `@web-next/app/demo/__tests__/demo-copy.test.ts`:
- Line 57: Expand the tests around DISCLOSURE.posts to exercise fallback
presentation rather than only matching the literal copy. Add a focused
fallback-corpus case that verifies the mechanics-fixture label and confirms
snapshot-specific metadata is omitted, while preserving the existing disclosure
contract assertion.

In `@web-next/app/docs/page.tsx`:
- Around line 19-21: The public descriptions use inconsistent Corgi/Bluesky
rendering-boundary wording. In web-next/app/docs/page.tsx lines 19-21, state
that Corgi serves an ordered feed for Bluesky clients to render; in
web-next/app/how-it-works/page.tsx line 39, rename the step to “Render in
Bluesky” and state that Corgi serves the ordered feed. Add a cross-surface
assertion preventing future wording that says Bluesky receives or publishes
posts.

In `@web-next/app/proposals/page.tsx`:
- Around line 30-32: Update policyApplied() so active epochs with an omitted
phase are treated as policy-applied, while preserving the existing behavior for
phase "running" and rejecting other explicitly provided phases. Add table-driven
tests covering active/running, active/omitted, and active/non-running phase
combinations, plus relevant status cases.

---

Outside diff comments:
In `@src/demo/corpus.ts`:
- Around line 335-352: Update the corpus health result near the warning
construction so any non-empty gateFailures sets health.status to degraded,
including quality-only reviewer gate failures. In
tests/demo-v4-snapshot-source.test.ts lines 415-432, parameterize independent
English-share, rich-media, and author-concentration failure cases, covering each
gate’s threshold boundaries.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 873b773e-26ad-4622-949f-726559771ecb

📥 Commits

Reviewing files that changed from the base of the PR and between 7bac290 and 7999508.

📒 Files selected for processing (76)
  • README.md
  • docs/PRD.md
  • docs/SYSTEM_OVERVIEW.md
  • docs/agent/REPO_CONTRACT.md
  • docs/docs-site/openapi.json
  • docs/lab/demo-shadow-governance-contract.md
  • docs/openapi-public.json
  • docs/openapi.json
  • package.json
  • scripts/approve-demo-snapshot.ts
  • scripts/demo-snapshot-capture.ts
  • scripts/generate-openapi.ts
  • scripts/publish-feed.ts
  • scripts/update-corgi-commons-record.ts
  • src/admin/routes/export.ts
  • src/admin/routes/governance.ts
  • src/bot/announcements.ts
  • src/demo/content-rules.ts
  • src/demo/corpus.ts
  • src/demo/service.ts
  • src/demo/snapshot-capture.ts
  • src/feed/demo-snapshot-source.ts
  • src/feed/server.ts
  • src/governance/content-filter.ts
  • src/governance/content-rule-matcher.ts
  • src/governance/routes/epochs.ts
  • src/governance/routes/vote.ts
  • tests/content-filter-matching.test.ts
  • tests/corgi-cold-start-product-story.test.ts
  • tests/demo-content-rules.test.ts
  • tests/demo-v4-routes.test.ts
  • tests/demo-v4-snapshot-source.test.ts
  • tests/governance-admin.test.ts
  • tests/governance-query-validation.test.ts
  • tests/votable-params-record-shape.test.ts
  • tests/web-next-demo-fixtures.test.ts
  • tests/web-next-homepage-anchors.test.ts
  • tests/web-next-landing-ctas-render.test.tsx
  • web-next/app/about/page.tsx
  • web-next/app/admin/page.tsx
  • web-next/app/dashboard/page.tsx
  • web-next/app/demo/__tests__/demo-copy.test.ts
  • web-next/app/demo/__tests__/frontend-release-blockers.test.tsx
  • web-next/app/demo/__tests__/http-client.test.ts
  • web-next/app/demo/layout.tsx
  • web-next/app/demo/page.tsx
  • web-next/app/demo/shadow-demo-api-schemas.ts
  • web-next/app/demo/shadow-demo-copy.ts
  • web-next/app/demo/shadow-demo-fixtures.ts
  • web-next/app/docs/page.tsx
  • web-next/app/history/page.tsx
  • web-next/app/how-it-works/page.tsx
  • web-next/app/not-found.tsx
  • web-next/app/page.tsx
  • web-next/app/post/page.tsx
  • web-next/app/proposals/page.tsx
  • web-next/app/start/page.tsx
  • web-next/app/vote/page.tsx
  • web-next/components/bento-section.tsx
  • web-next/components/community-examples-section.tsx
  • web-next/components/demo/community-picker.tsx
  • web-next/components/demo/live-proof-panel.tsx
  • web-next/components/demo/vote-panel.tsx
  • web-next/components/faq-section.tsx
  • web-next/components/feed/corgi-rank-badge.tsx
  • web-next/components/footer-section.tsx
  • web-next/components/header.tsx
  • web-next/components/hero-section.tsx
  • web-next/components/how-it-works-replay.tsx
  • web-next/components/landing-ctas.tsx
  • web-next/components/replay-teaser.tsx
  • web-next/components/social-proof.tsx
  • web-next/e2e/production-hard-refresh.spec.ts
  • web-next/lib/api/admin.ts
  • web-next/lib/api/client.ts
  • web-next/lib/replay-model.ts
💤 Files with no reviewable changes (1)
  • src/admin/routes/governance.ts

Comment thread docs/agent/REPO_CONTRACT.md
Comment thread docs/SYSTEM_OVERVIEW.md
Comment thread docs/SYSTEM_OVERVIEW.md Outdated
Comment thread scripts/generate-openapi.ts Outdated
Comment thread src/demo/snapshot-capture.ts Outdated
Comment thread web-next/app/admin/page.tsx Outdated
Comment thread web-next/app/admin/page.tsx
Comment thread web-next/app/demo/__tests__/demo-copy.test.ts
Comment thread web-next/app/docs/page.tsx Outdated
Comment thread web-next/app/proposals/page.tsx Outdated
@AndrewNordstrom
AndrewNordstrom enabled auto-merge (squash) July 13, 2026 22:36
@AndrewNordstrom
AndrewNordstrom merged commit 64ae6f8 into main Jul 13, 2026
33 of 127 checks passed
@AndrewNordstrom
AndrewNordstrom deleted the dev/PROJ-1821-cold-start-story-alignment branch July 13, 2026 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant