Skip to content

Commit c126232

Browse files
Merge pull request gastownhall#21 from gastownhall/fix/profile-stamp-count-mismatch-complete
fix: distinguish GitHub assessments from Wasteland stamps on profile
2 parents 4c06b63 + e803120 commit c126232

8 files changed

Lines changed: 68 additions & 12 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ The web UI provides:
134134
config, sync upstream.
135135
- **Profiles** — look up developer character sheets from the-pile. Search by
136136
handle or name, view skills, value dimensions, notable projects, and
137-
reputation stamps. Navigate to `/profile` for search or
137+
GitHub assessments. Navigate to `/profile` for search or
138138
`/profile/<handle>` for a direct lookup.
139139
- **Command palette** — press `Cmd+K` (or `Ctrl+K`) to navigate, create
140140
items, or view keyboard shortcuts.

cmd/wl/cmd_profile.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func newProfileCmd(stdout, stderr io.Writer) *cobra.Command {
1919
Long: `Look up a developer's character sheet from hop/the-pile.
2020
2121
Shows identity, skills (languages, domains, capabilities), notable projects,
22-
and value dimensions assembled from boot blocks and reputation stamps.
22+
and value dimensions assembled from boot blocks and GitHub assessments.
2323
2424
EXAMPLES:
2525
wl profile torvalds # Show Torvalds' profile
@@ -163,8 +163,8 @@ func runProfile(_ *cobra.Command, stdout, _ io.Writer, handle string) error {
163163
}
164164

165165
// Stats footer
166-
fmt.Fprintf(stdout, "Stamps: %d Total stars: %d Repos: %d\n",
167-
profile.StampCount, profile.TotalStars, profile.TotalRepos)
166+
fmt.Fprintf(stdout, "Assessments: %d Total stars: %d Repos: %d\n",
167+
profile.AssessmentCount, profile.TotalStars, profile.TotalRepos)
168168

169169
return nil
170170
}

internal/api/pile_handlers_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ func TestHandleProfile_Success(t *testing.T) {
101101
if profile.Handle != "test" {
102102
t.Errorf("handle = %q, want test", profile.Handle)
103103
}
104+
if profile.AssessmentCount != 0 {
105+
t.Errorf("assessment_count = %d, want 0", profile.AssessmentCount)
106+
}
104107
}
105108

106109
func TestHandleProfileSearch_LimitClamped(t *testing.T) {

internal/pile/profile.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ type Profile struct {
3232
Reliability float64 `json:"reliability"`
3333
Creativity float64 `json:"creativity"`
3434

35-
// Aggregated from stamps
36-
StampCount int `json:"stamp_count"`
35+
// Aggregated from the-pile stamps (GitHub analysis, NOT wasteland reputation)
36+
AssessmentCount int `json:"assessment_count"`
37+
3738
Languages []SkillEntry `json:"languages,omitempty"`
3839
Domains []SkillEntry `json:"domains,omitempty"`
3940
Capabilities []SkillEntry `json:"capabilities,omitempty"`
@@ -119,7 +120,7 @@ func QueryProfile(p RowQuerier, handle string) (*Profile, error) {
119120
return nil, fmt.Errorf("querying stamps: %w", err)
120121
}
121122

122-
profile.StampCount = len(stampRows)
123+
profile.AssessmentCount = len(stampRows)
123124
parseStamps(stampRows, profile)
124125

125126
return profile, nil

internal/pile/profile_test.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,41 @@ func TestQueryProfile_Success(t *testing.T) {
9494
if profile.Quality < 4.5 {
9595
t.Errorf("quality = %f, want >= 4.5 (0.95 * 5)", profile.Quality)
9696
}
97+
// Empty stamp rows → AssessmentCount should be 0
98+
if profile.AssessmentCount != 0 {
99+
t.Errorf("AssessmentCount = %d, want 0 (no stamp rows)", profile.AssessmentCount)
100+
}
101+
}
102+
103+
func TestQueryProfile_WithStamps(t *testing.T) {
104+
sheetJSON, _ := json.Marshal(map[string]any{
105+
"identity": map[string]any{"display_name": "Test"},
106+
"value_dimensions": map[string]any{"quality": 0.5},
107+
})
108+
109+
q := &fakeQuerier{rows: map[string][]map[string]any{
110+
"SELECT handle": {
111+
{
112+
"handle": "test",
113+
"source": "github",
114+
"sheet_json": string(sheetJSON),
115+
"confidence": "0.8",
116+
"created_at": "2024-01-01",
117+
},
118+
},
119+
"SELECT skill_tags": {
120+
{"skill_tags": `["go"]`, "valence": `{"quality":4,"reliability":3,"creativity":2}`, "confidence": "0.9", "message": "Strong Go skills"},
121+
{"skill_tags": `["python"]`, "valence": `{"quality":3,"reliability":4,"creativity":3}`, "confidence": "0.8", "message": "Python experience"},
122+
},
123+
}}
124+
125+
profile, err := QueryProfile(q, "test")
126+
if err != nil {
127+
t.Fatalf("unexpected error: %v", err)
128+
}
129+
if profile.AssessmentCount != 2 {
130+
t.Errorf("AssessmentCount = %d, want 2", profile.AssessmentCount)
131+
}
97132
}
98133

99134
func TestSearchProfiles(t *testing.T) {

web/src/api/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export interface ProfileResponse {
243243
quality: number;
244244
reliability: number;
245245
creativity: number;
246-
stamp_count: number;
246+
assessment_count: number;
247247
languages?: ProfileSkillEntry[];
248248
domains?: ProfileSkillEntry[];
249249
capabilities?: ProfileSkillEntry[];

web/src/components/ProfileView.module.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,20 @@
7373
background-color: var(--green);
7474
}
7575

76+
.assessmentBadge {
77+
display: inline-block;
78+
padding: 2px 8px;
79+
border-radius: 4px;
80+
font-size: 0.75rem;
81+
font-weight: 600;
82+
text-transform: uppercase;
83+
letter-spacing: 0.03em;
84+
color: var(--fg);
85+
background-color: var(--surface);
86+
border: 1px solid var(--border);
87+
cursor: help;
88+
}
89+
7690
.unverifiedNote {
7791
font-size: 0.75rem;
7892
color: var(--dim);

web/src/components/ProfileView.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,15 @@ export function ProfileView() {
6464
<span className={styles.confidence} title="How confident the system is in this profile data">
6565
{(data.confidence * 100).toFixed(0)}% confidence
6666
</span>
67-
{data.stamp_count > 0 && (
68-
<span className={styles.verifiedBadge}>
69-
{data.stamp_count} {data.stamp_count === 1 ? "stamp" : "stamps"} earned
67+
{data.assessment_count > 0 && (
68+
<span
69+
className={styles.assessmentBadge}
70+
title="Skill assessments from GitHub profile analysis — not Wasteland reputation stamps"
71+
>
72+
{data.assessment_count} {data.assessment_count === 1 ? "assessment" : "assessments"}
7073
</span>
7174
)}
72-
{data.stamp_count === 0 && <span className={styles.unverifiedNote}>No Wasteland stamps yet</span>}
75+
{data.assessment_count === 0 && <span className={styles.unverifiedNote}>No assessments yet</span>}
7376
</div>
7477
</div>
7578

0 commit comments

Comments
 (0)