Skip to content

Nation desk culture layer + streaks auth + custody docstring fix - #30

Merged
thisyearnofear merged 10 commits into
mainfrom
audit/stage-a
Nov 6, 2026
Merged

thisyearnofear merged 10 commits into
mainfrom
audit/stage-a

Conversation

@thisyearnofear

Copy link
Copy Markdown
Owner

Summary

  • Nation desk (MVP Phase 1, docs/internal/mvp-plan-2026-11): anonymous confidence poll (/api/sentiment + SentimentVote), sovereign-debt block, routable ways-to-hold, and share/OG cards woven into the existing currency surfaces — CurrencyStoryInspector (connected + walletless Home) and /currency/[code] — rather than on standalone pages. /country index + doorway route; compare folded into /pair.
  • L1 vote invite on the moment card taps into the inspector where the poll lives.
  • 5 funnel events + nation-desk group in funnel-outcomes — virality/intent gates measurable.
  • Security fix (R13): /api/streaks/[address] now requires requireWalletAuth matching the URL address on all methods (was: anyone could read/mutate/delete any wallet's streak); DELETE genuinely 404s in production.
  • Permission.ts docstring corrected: it described the deleted Privy Safe custody path and pointed at a doc removed 2026-08-31 — rewritten to the two-layer model.
  • Cleanup: dead use-analytics queue removed; pre-existing capital-history.test.ts tsc failure fixed (repo now typechecks 0 errors).

Test plan

  • 26 new vitest cases pass (sentiment, holdable-assets, streaks auth rejections); funnel-allowlist tripwire passes
  • tsc --noEmit — 0 errors; eslint clean on all touched files
  • Prod check: walletless → /country/ngn → doorway → /currency/ngn → vote → weigh → convert doorway → Exchange
  • Prod check: connected wallet streak view loads (signed headers via cached session proof — watch for a one-time signature prompt)

Generated with Devin

Quincybob and others added 5 commits November 6, 2026 13:53
Demand-validation layer for the pre-PMF pivot (docs/internal/mvp-plan-2026-11):
anonymous confidence poll, sovereign-debt block, and routable ways-to-hold
mounted inside the currency surfaces — CurrencyStoryInspector (both
connected and walletless Home) and /currency/[code] — so users vote and
see access without leaving the app.

- models/SentimentVote + /api/sentiment: one vote per anonymous session
  per currency, 180-day TTL, codes allowlisted against the dataset;
  SENTIMENTS kept in a leaf lib so mongoose never enters the client bundle
- lib/holdable-assets: scans only swap-executable token maps through the
  unroutable list; no rail renders honest absence + convert_intent fake
  door (measures demand before any integration)
- /country doorway → /currency/[code] (moment-style meta + OG card);
  country-card OG route kept; compare folded into the existing /pair stage
- 5 funnel events + 'nation desk' group in funnel-outcomes = the virality
  and intent gates measurable from day one
- cleanup: dead use-analytics queue removed (call sites in Tooltip,
  use-app-shell, TabContentRouter)
- 3 new test files, 24 cases; geo-gated thesis surfaces stay denied in GB

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The block still described the deleted Privy Safe / VAULT_PRIVATE_KEY
execution path (removed in 78b3413) and pointed at a doc that no
longer exists — the worst possible comment for counsel or an auditor
testing the non-custodial claim. Rewritten to the actual two-layer
model: app gates everywhere, on-chain caveats via the user-own smart
account on kit-supported chains (Celo, Celo Sepolia, Arbitrum),
advisory-only + fail-closed elsewhere.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The confidence poll lived only inside the story inspector (L2) —
invisible until a user opened the sheet. A single question line now
sits under the LiveLine: 'How confident are you in the naira? →' taps
through to the inspector where the poll and ways-to-hold live.
Discovery invites at L1, the poll responds at L2 — same depth contract.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The route keyed every method on the caller-supplied URL address — anyone
could read, inflate or delete another wallet's streak state, and the
"dev only" DELETE was not env-gated. This is the unauthenticated-address
pattern the repo rules already forbid for agent memory.

- requireWalletAuth must recover the URL address or 401 (all methods)
- DELETE 404s in production
- use-streak-rewards signs via getWalletAuthHeaders + wallet-context
  signMessage (sessionStorage-cached session proof, one signature);
  shared fetchStreakFromApi/patchActivity take optional headers
- public aggregate /api/streaks/stats untouched
- +2 tests: missing auth and wrong-wallet signature both 401

Also adds the L1 vote invite on the moment card ("How confident are you
in the {money}? →") tapping into the story inspector where the poll
lives — discovery invites at L1, the poll responds at L2.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
fetchMock.mock.calls is any[][] — the ([u]: [unknown]) destructure
was a pre-existing tsc failure that blocked the pre-push typecheck.
Reads the first arg positionally instead.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@vercel

vercel Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
diversify Ready Ready Preview Nov 6, 2026 3:12pm UTC

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

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

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cf16cd3c-45cb-43cc-b6d4-cbfcbafa2b8e
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Quincybob and others added 2 commits November 6, 2026 14:39
The curated scheduled-events calendar correctly surfaces the Dec 8 FOMC
now that Oct 27 has passed — two tests pinned the October date/ID and
went red in CI. Not product code.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Node >=22 exposes window without a Web Storage backend unless
--localstorage-file is set, so the 7 return-visit-lead tests crashed on
window.localStorage locally and in the pre-push hook while CI's jsdom
masked it. Define a Map-backed surface only when the real one is absent.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Quincybob and others added 3 commits November 6, 2026 14:58
The sovereign-debt dataset has sources with no url (undefined) — Next
serializes getStaticProps to JSON and crashes the build on /currency/GHS
("cannot be serialized as JSON"). Round-tripping the derived debt and
ways props drops undefined keys before Next sees them. Verified with a
full local `next build` — all 43 static pages generate, including all 29
/currency/* paths.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Node >=22 environments can expose window without a Web Storage backend
(localStorage needs --localstorage-file). ~360 tests across dozens of
files crashed on window.localStorage locally and in the pre-push hook
while jsdom environments silently masked it. Install a Map-backed
surface only when the real one is absent — jsdom keeps its own.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The plain-object shim still missed two real cases: test files that spy
on Storage.prototype (a prototype spy never sees calls on a plain
object), and sessionStorage. Now: patch the Storage prototype with a
WeakMap-backed store when the class exists but surfaces are missing,
hand out Storage-derived surfaces, share one surface between window and
globalThis, and keep it writable so per-file shims still override.
358 -> 0 local failures across the affected suites.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@thisyearnofear
thisyearnofear merged commit d37d976 into main Nov 6, 2026
8 of 9 checks passed

This branch was successfully deployed

1 active deployment
Preview — cddabd12 Deployed Nov 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant