Skip to content
This repository was archived by the owner on Oct 22, 2026. It is now read-only.

feat(reputation): import reputation from lnp2pBot - #744

Open
grunch wants to merge 2 commits into
feat/reputation-servicefrom
feat/reputation-telegram
Open

grunch wants to merge 2 commits into
feat/reputation-servicefrom
feat/reputation-telegram

Conversation

@grunch

@grunch grunch commented Oct 3, 2026

Copy link
Copy Markdown
Member

What changes and why

This is phase 5, PR 5.3 of the reputation portability plan. It is stacked on #743 (5.2). The bot side is lnp2pBot/bot#933 (export) and #934 (rebind).

The new Import reputation screen (/import_reputation) lets a user bring the reputation they earned on lnp2pBot, or on another Mostro, into the selected node:

  1. "Get it from lnp2pBot" opens https://t.me/lnp2pbot?start=rep_<identity> in Telegram (lnp2pbot.dart). The identity is written as 43 characters of unpadded base64url, so the start parameter stays under Telegram's 64-character cap.

  2. The bot asks the user to confirm the identity, then sends the attestation as a message. The user pastes it into the screen. An attestation exported from another Mostro and still pending (5.2) is prefilled.

  3. Check:

    • extractAttestationJson finds the event JSON in the paste, so surrounding text and whitespace are fine;
    • ReputationAttestation.parse verifies it;
    • the screen shows the figures: ratings received, average, days trading.

    The screen also states that the import links the two accounts.

  4. "Import into this Mostro" calls ReputationService.importReputation.

Every refusal, found locally or sent by the node, is shown in the user's language (reputation_errors.dart).

Strings. 21 new strings, in all seven ARB files. Automation ids. Five ids under reputation.import.*, all attached.

Deviation from the plan. The plan has the bot answer with a button that opens the app's deep link. Telegram URL buttons only accept http(s) and tg:// links, so lnp2pBot sends the attestation as text instead, and the paste is the hand-off on every platform. Because nothing can open a mostro: reputation link, no inbound deep link is added.

Tests

  • lnp2pbot_test.dart:
    • the export link's shape and length;
    • the base64url round trip, done the way the bot decodes it;
    • finding the attestation in a paste.
  • import_reputation_screen_test.dart:
    • a pasted attestation shows its figures and imports;
    • a non-attestation, an expired attestation and a node refusal each show their message.
flutter analyze: No issues found!
flutter test:    +1496 All tests passed!   (Flutter 3.35.7)

Screenshots

None yet: the screen is reachable from Settings in 5.4, where the screenshots will be added.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UrKanPgEfEBiEo3snHz4WZ

@coderabbitai

coderabbitai Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f01b9f0c-7515-41fc-a8b5-ea6711f5e9d8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-03T15:11:35.198448Z a52411a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a52411a581

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

grunch and others added 2 commits October 7, 2026 08:09
Phase 5, PR 5.3 of the reputation portability plan. A new Import
reputation screen (/import_reputation):

- "Get it from lnp2pBot" opens t.me/lnp2pbot?start=rep_<identity>, the
  identity as 43 base64url characters so the start parameter stays
  under Telegram's cap.
- The user pastes what the bot sent (or an attestation exported from
  another Mostro, prefilled when one is pending); the screen finds the
  event JSON in the paste, verifies it and shows the figures before
  importing them into the selected node.
- Every refusal, local or from the node, is shown in the user's
  language (reputation_errors.dart), in every ARB.

Telegram URL buttons cannot open an app scheme, so lnp2pBot sends the
attestation as text and the paste is the hand-off on every platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrKanPgEfEBiEo3snHz4WZ
The lnp2pBot button put the master public key in a Telegram link
without checking full privacy mode, so Telegram could link the
identity to the user's account before the import was refused. Take
the identity from ReputationService.identityPublicKey, which refuses
in full privacy mode, and show reputation_identity_required instead.

A retry that succeeded also left the earlier failure on screen next
to "Your reputation was imported."; clear the error when an import
starts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E4t8avpoStb19ERrS77V2m
@grunch
grunch force-pushed the feat/reputation-service branch from 60a209a to 6e99df9 Compare October 7, 2026 11:23
@grunch
grunch force-pushed the feat/reputation-telegram branch from a52411a to 0c52f22 Compare October 7, 2026 11:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant