Skip to content

feat(profile): profiles in Settings, /u?id= and dg profile (P1-7, 1/2) - #346

Merged
PastaPastaPasta merged 2 commits into
masterfrom
feat/p1-7-profiles
Oct 2, 2026
Merged

PastaPastaPasta merged 2 commits into
masterfrom
feat/p1-7-profiles

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Owner

P1-7 (1/2): profiles

Reads and writes the existing forge-community profile type. The contracts are not changed: this PR uses only the type's existing properties.

What ships

  • Settings → Public profile (/settings/profile/). Edit the display name, bio, company, location, up to 4 https links and the avatar. A live preview shows beside the form. Each field is checked as you type, Save shows the cost, and the write goes through the usual confirm dialog. Delete profile refunds part of the fee. A notice above the form says the profile is public and never encrypted, private repos included.
  • /u profile page, in GitHub's layout: a side column with the avatar, display name, DPNS pill, bio, Follow or Edit profile, counts, company, location and links. Repos sit beside it on desktop and below it at 390 px.
  • /u/?id=<identity id> (D-222). /u/?name= still takes a DPNS name, or an identity id as before. Internal links (Author pills, follow lists, header, jump box) now use ?id=. Follower and following pages take ?id= too.
  • Avatars from avatarConfig. Forge hosts no images. The options are:
    • absent: the initial, as before;
    • identicon / identicon:<seed>: a 5×5 SHA-256 pattern drawn locally;
    • an https image link: shown only after the viewer clicks "Load avatar from ". This uses the same per-host allow-list as Markdown images (moved to hooks/use-image-hosts.ts).
  • dg profile show [IDENTITY], dg profile set …, dg profile delete. set keeps any field you don't name, and an empty value clears a field. --link is repeatable and replaces all links; --clear-links removes them; --bio-file reads the bio from a file. Invalid input fails with E201 before anything is signed.

Shared rule

forge_core::rules::profile and forge-web/lib/rules/profile.ts share one normalization rule:

  • trim Unicode White_Space (not U+FEFF, which JS trim would strip);
  • a blank field counts as absent;
  • no control characters (a bio may keep line breaks and tabs);
  • links are deduplicated, https only, with no whitespace;
  • avatarConfig must follow one of the avatar conventions above.

36 new conformance vectors (profile_input__*, avatar_config__*) pass in both languages. The conventions are documented in docs/contracts/forge-v2.md (profile row).

Budget

/u reads one more document, the profile, in parallel with the other reads. Measured cold on sakura: 9 DAPI requests. The new pb-5 budget test is ≤ 12 and asserts the profile is read exactly once; it passes against sakura. a11y covers settings-profile and profile-by-id in both themes, plus a one-h1 check.

Live verification on sakura (scratch identities alice, bob)

  • dg create 37.2M credits (first forge-community write), replace 1.75M, no-op unchanged, invalid input refused with E201.
  • Web create 36.8M credits, then an edit to an image avatar: the image is not fetched until "Load avatar" is clicked (0 requests before, 1 after). Delete removed the document.
  • The cost model now has a measured profile base (24M). The dg quote overhead is 40M.
  • Evidence: dash-forge-qa/evidence/p1-7/ (dg-*.txt, web/*.png, web/web-*.log).

Review

The code-review skill ran at high effort and its valid findings were fixed:

  • the loading gate on Settings;
  • a refusal of an empty first profile in dg;
  • a stored unknown avatar is now shown as such and replaced only on save;
  • astral initials;
  • a stdin --bio-file - now needs --yes;
  • one avatar element instead of two;
  • the host store moved out of markdown-view;
  • withScheme keeps host:port;
  • the label when your own profile can't be read;
  • duplicated engine and field lists removed.

A simplify pass then reused sameValue and dg's identity_arg.

Gates: cargo fmt, clippy -D warnings, cargo test --workspace, tsc, eslint and vitest (5,384 tests) all pass.

PR 2 of 2 (signed-commit badges from profile.pubkeys) follows.

🤖 Generated with Claude Code

Settings → Public profile and dg profile show/set/delete read and write the forge-community profile document (display name, bio, avatar, company, location, links). Both clients check edits with one shared rule (forge_core::rules::profile, lib/rules/profile.ts) held equal by the profile_input and avatar_config vectors. /u lays the profile out as GitHub does, takes ?id= (D-222) beside ?name=, and draws the avatar from avatarConfig: the initial, a local identicon, or an https image loaded only when the viewer asks. Internal profile links use ?id=. The profile page reads one more document (9 requests cold on sakura, pb-5).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 02c9e304-f02d-456e-9c71-085253e9c88b

📥 Commits

Reviewing files that changed from the base of the PR and between fe00ecb and 76285e8.

📒 Files selected for processing (83)
  • crates/dg/src/errors.rs
  • crates/dg/src/issue.rs
  • crates/dg/src/main.rs
  • crates/dg/src/profile.rs
  • crates/dg/src/quote.rs
  • crates/forge-core/src/lib.rs
  • crates/forge-core/src/profile.rs
  • crates/forge-core/src/rules.rs
  • crates/forge-core/src/rules/profile.rs
  • docs/contracts/forge-v2.md
  • docs/guides/costs.md
  • docs/guides/identity-and-keys.md
  • forge-contracts/vectors/avatar_config__absent_is_default.json
  • forge-contracts/vectors/avatar_config__empty_is_default.json
  • forge-contracts/vectors/avatar_config__http_url_invalid.json
  • forge-contracts/vectors/avatar_config__https_url.json
  • forge-contracts/vectors/avatar_config__identicon_empty_seed_invalid.json
  • forge-contracts/vectors/avatar_config__identicon_is_case_sensitive.json
  • forge-contracts/vectors/avatar_config__identicon_seed_64.json
  • forge-contracts/vectors/avatar_config__identicon_seed_65_invalid.json
  • forge-contracts/vectors/avatar_config__identicon_seed_space_invalid.json
  • forge-contracts/vectors/avatar_config__identicon_seeds_with_identity.json
  • forge-contracts/vectors/avatar_config__identicon_with_seed.json
  • forge-contracts/vectors/avatar_config__untrimmed_is_invalid.json
  • forge-contracts/vectors/avatar_config__url_201_chars_invalid.json
  • forge-contracts/vectors/profile_input__avatar_identicon_seed_ok.json
  • forge-contracts/vectors/profile_input__avatar_image_link_ok.json
  • forge-contracts/vectors/profile_input__avatar_unknown_refused.json
  • forge-contracts/vectors/profile_input__bio_500_two_byte_chars.json
  • forge-contracts/vectors/profile_input__bio_control_character.json
  • forge-contracts/vectors/profile_input__bio_keeps_tabs_and_line_breaks.json
  • forge-contracts/vectors/profile_input__bio_over_1000_bytes.json
  • forge-contracts/vectors/profile_input__blank_fields_are_absent.json
  • forge-contracts/vectors/profile_input__bom_is_not_trimmed.json
  • forge-contracts/vectors/profile_input__company_c1_control.json
  • forge-contracts/vectors/profile_input__display_name_60_astral_chars.json
  • forge-contracts/vectors/profile_input__display_name_61_chars.json
  • forge-contracts/vectors/profile_input__five_links_refused.json
  • forge-contracts/vectors/profile_input__five_with_a_repeat_is_four.json
  • forge-contracts/vectors/profile_input__invalid_fields_in_field_order.json
  • forge-contracts/vectors/profile_input__link_201_chars_refused.json
  • forge-contracts/vectors/profile_input__link_at_in_path_ok.json
  • forge-contracts/vectors/profile_input__link_empty_host_refused.json
  • forge-contracts/vectors/profile_input__link_http_refused.json
  • forge-contracts/vectors/profile_input__link_nbsp_refused.json
  • forge-contracts/vectors/profile_input__link_userinfo_refused.json
  • forge-contracts/vectors/profile_input__location_line_break.json
  • forge-contracts/vectors/profile_input__trims_and_dedupes.json
  • forge-web/app/settings/page.tsx
  • forge-web/app/settings/profile/page.tsx
  • forge-web/app/u/client.tsx
  • forge-web/app/u/followers/client.tsx
  • forge-web/app/u/followers/page.tsx
  • forge-web/app/u/following/client.tsx
  • forge-web/app/u/following/page.tsx
  • forge-web/app/u/page.tsx
  • forge-web/components/app-header.tsx
  • forge-web/components/author.tsx
  • forge-web/components/follow-list-content.tsx
  • forge-web/components/markdown-view.tsx
  • forge-web/components/profile-content.tsx
  • forge-web/components/profile-settings.test.ts
  • forge-web/components/profile-settings.tsx
  • forge-web/components/ui/profile-avatar.test.tsx
  • forge-web/components/ui/profile-avatar.tsx
  • forge-web/e2e/a11y.spec.ts
  • forge-web/e2e/discovery-urls.spec.ts
  • forge-web/e2e/page-budget.spec.ts
  • forge-web/hooks/use-image-hosts.ts
  • forge-web/hooks/use-query-param.ts
  • forge-web/lib/design/identicon.test.ts
  • forge-web/lib/design/identicon.ts
  • forge-web/lib/page-title.test.ts
  • forge-web/lib/page-title.ts
  • forge-web/lib/repo/index.ts
  • forge-web/lib/repo/profile.test.ts
  • forge-web/lib/repo/profile.ts
  • forge-web/lib/repo/resolveRepo.ts
  • forge-web/lib/rules/conformance.test.ts
  • forge-web/lib/rules/profile.ts
  • forge-web/lib/sdk/cost.ts
  • forge-web/lib/view/profile-links.test.ts
  • forge-web/lib/view/profile-links.ts
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

# Conflicts:
#	forge-web/lib/rules/conformance.test.ts
@PastaPastaPasta
PastaPastaPasta merged commit f0fe821 into master Oct 2, 2026
30 checks passed
@PastaPastaPasta
PastaPastaPasta deleted the feat/p1-7-profiles branch October 2, 2026 09:26
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