fix(v2): /contribute @<id> targets a specific contract (R-2) + unknown-token warning#49
Merged
Conversation
… unknown token detect_contributors.load_people_map now maps each person id to itself (id wins over github/email/name collisions), so `/contribute @<id>` reliably credits a specific contract for multi-contract people who share a github handle (R-2: bob-arch + bob-pm both `github: bob-arch-e2e`). aggregate_signals now warns on stderr when a token matches no github handle or person id, so typos no longer silently earn 0h. Verified end-to-end: `/contribute @bob-pm` credits bob-pm (8h) under a shared handle; an unknown token warns. Docs: docs/contribute-directive.md. Tests: test_detect_contributors.py. Implements docs/proposals/v2-multi-contract-id-attribution.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the R-2 follow-up from the 2026-05-31 E2E run (
docs/proposals/v2-multi-contract-id-attribution.md): a multi-contract person who shares one GitHub handle (e.g.bob-arch+bob-pm, bothgithub: bob-arch-e2e) was previously unaddressable — the shared handle resolves to a single contract, so the other could never be credited (it derived 0h in the E2E).Fix
load_people_mapnow maps each personid→ itself (id wins over any github/email/name collision; ids are unique → collision-free). So/contribute @<id>reliably credits that exact contract. Previously@<id>only worked "by accident" via the unmapped-token fallback.aggregate_signalswarns on stderr when a/contributetoken matches neither a github handle nor a person id — a typo previously vanished silently (credited as-is → engine awards 0h).docs/contribute-directive.mddocuments@<person-id>and the multi-contract guidance.Verification (isolated demo, shared handle)
/contribute @bob-pm(id) → credits bob-pm 8h ✓ (was reachable only by accident before)./contribute @bob-shared(shared handle) → resolves to one contract (documented as ambiguous → use@<id>).@bob-pmm→ stderr warning ✓.Testing
pytest -m "not e2e" tests/→ 553 passed (+2 new intest_detect_contributors.py), 0 failures.Note / not in this PR
emailstill resolves first-match (local_evidence._resolve_person); use a distinct email per contract or/contribute @<id>to disambiguate. Tracked separately.🤖 Generated with Claude Code