iiitl / iiitl/Opensource_Compass

Fix: `MaintainerActive` Signal Is Never Set — Repos Always Lose 20 Points

Open
#4 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good first issue
Dominant language
TypeScript
Stars
0
Forks
16
PR merge metrics
No merged PRs in 30d

Description

The scoring engine (`engine.go`) awards **20 points** when the `MaintainerActive` signal is `true`. However, looking at `signals.go`, the `MaintainerActive` field is **never assigned** — it stays at its zero value (`false`) for every single repository.

This means every repository recommendation silently loses 20 points regardless of actual maintainer activity, making scores consistently lower than intended.

---

### 📍 File to Change

`backend/core_service/internal/orchestration/signals.go`

---

### 🔍 Current Buggy Code (lines ~10–40 in `signals.go`)

```go
// MaintainerActive is NEVER set — always stays false
func (s *Service) BuildRepoSignals(...) scoring.RepoSignals {
signals := scoring.RepoSignals{}

repoData, err := s.githubClient.FetchRepo(ctx, repo)
// ... MaintainerActive is never touched here

return signals
}
```

---

### ✅ What To Do

After fetching `repoData`, add a heuristic check: if the repo was pushed to within the last **7 days**, consider the maintainer active.

```go
// Add this block after the RecentActivity check in signals.go:

// Check if maintainer is active (pushed within last 7 days)
pushedTime, err := time.Parse(time.RFC3339, repoData.LastPushedAt)
if err == nil && time.Since(pushedTime).Hours() < 24*7 {
signals.MaintainerActive = true
}
```

Add a brief comment explaining the heuristic so future contributors understand the logic.

---

### 🏁 Acceptance Criteria

- [ ] `signals.MaintainerActive` is now set to `true` when the repo was pushed to within the last 7 days
- [ ] The existing `signals.RecentActivity` check (30-day threshold) is untouched
- [ ] The code compiles: `go build ./...` from `backend/core_service` must pass
- [ ] A short comment documents the heuristic (e.g., `// Active maintainer: pushed within last 7 days`)

---

### 💡 Technical Hints

- Edit `backend/core_service/internal/orchestration/signals.go` — specifically the `BuildRepoSignals` function
- `repoData.LastPushedAt` is a string formatted as RFC3339 — parse it using `time.Parse(time.RFC3339, ...)`
- The same parsing pattern is already used a few lines above for `RecentActivity` — follow the same style
- You do **not** need to make any new API calls; `repoData` is already fetched

---

### 🚀 Getting Started

1. Fork the repository
2. Create a branch: `git checkout -b fix/issue-3-maintainer-active-signal`
3. Edit `backend/core_service/internal/orchestration/signals.go`
4. Verify it compiles: `cd backend/core_service && go build ./...`
5. Open a Pull Request!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open backend/core_service/internal/orchestration/signals.go and start with the BuildRepoSignals function, comparing the existing RecentActivity parsing with the requested heuristic. Confirm the MaintainerActive behavior and preserve the existing RecentActivity check, then run go build ./... from backend/core_service.】【。

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.