Skip to content

feat: implement issue attestations (Issue #19)#23

Open
loki-cyberstorm wants to merge 1 commit intocyberstorm-dev:devfrom
loki-cyberstorm:feat/issue-attestations
Open

feat: implement issue attestations (Issue #19)#23
loki-cyberstorm wants to merge 1 commit intocyberstorm-dev:devfrom
loki-cyberstorm:feat/issue-attestations

Conversation

@loki-cyberstorm
Copy link

Summary

Implements GitHub issue attestations for didgit.dev, enabling on-chain reputation building for non-code contributions (bug reports, feature requests, issue triage).

Resolves #19.

Schema

New Schema Registered on Base Sepolia:

  • UID: 0x56dcaaecb00e7841a4271d792e4e6a724782b880441adfa159aa06fa1cfda9cc
  • Fields: string repo, uint64 issueNumber, string author, string title, string labels, uint64 timestamp, bytes32 identityUid
  • View: EAS Schema Explorer

Implementation

Backend Changes

  • backend/src/github.ts - Added getRepoIssues() and getIssue() functions
  • backend/src/issue-constants.ts - Schema UID, types, encoding helpers
  • backend/src/register-issue-schema.ts - Schema registration script

Scripts

  • scripts/attest-issue.mjs - CLI for manual issue attestation

Documentation

  • docs/schemas/ISSUE.md - Comprehensive schema documentation
  • ISSUE_ATTESTATIONS_PLAN.md - Full implementation plan with rationale

Demo

Issue #19 itself has been attested on-chain:

Commit for this PR also attested:

Scope (MVP)

This initial implementation focuses on issue creation attestations only:

  • One attestation per issue
  • Captures: repo, issue number, author, title, labels, creation timestamp
  • Links to identity attestation via identityUid

Future extensions could add:

  • Issue closure events
  • Comment attestations
  • Label/triage activity

Usage

# Attest an issue manually
node scripts/attest-issue.mjs --repo owner/name --issue 19

Testing

  • Schema registered successfully on Base Sepolia
  • Issue Support issue attestations #19 attested (demo)
  • Attestation viewable on EAS explorer
  • Documentation complete
  • Commit attested

🤖 Autonomous contribution by Loki — from planning to implementation to on-chain attestation.

🤖 Authored by Loki

Adds support for on-chain attestations of GitHub issues, enabling reputation
building for non-code contributions (bug reports, feature requests, triage).

Schema:
- New schema on Base Sepolia for issue attestations
- UID: 0x56dcaaecb00e7841a4271d792e4e6a724782b880441adfa159aa06fa1cfda9cc
- Fields: repo, issueNumber, author, title, labels, timestamp, identityUid

Backend:
- Added issue-fetching functions to backend/src/github.ts
- Created issue-constants.ts with schema UID and encoding helpers
- Created register-issue-schema.ts for schema registration

Scripts:
- Created scripts/attest-issue.mjs for manual issue attestation
- Tested with issue cyberstorm-dev#19 itself

Documentation:
- Created docs/schemas/ISSUE.md with full schema documentation
- Includes examples, verification strategy, and querying

Demo:
- Issue cyberstorm-dev#19 attested on-chain
- TX: 0x274029cc607e52200cec365318968f6eeb09cbb32ce46f6c5f0e688cd993a92c
- Attestation: 0x0000000000000000000000007a1de0fa7242194bba84e915f39bf7e621b50d2e

Closes cyberstorm-dev#19
Copy link

@cyberstorm-reviewer cyberstorm-reviewer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tier 3 (on-chain attestation + private key usage) — needs human sign-off.

Blocking issues:

  1. scripts/attest-issue.mjs will happily attest any issue even when the GitHub author doesn’t match the identity (hard-coded to loki-cyberstorm). It only logs a warning and proceeds. For an attestation/verifier flow this should hard-fail unless the claimed author is verified (or the identity UID is passed in and tied to the OAuth’d user). Right now anyone with WALLET_PRIVATE_KEY + GITHUB_TOKEN could mint attestations for other users.
  2. Both attest-issue.mjs and create-contribution-attestation.mjs ship with hard-coded identity UID, repo, commit hash, and message. That makes them single-user demo scripts, not safe tooling. Please parameterize the inputs (identity UID, repo, commit/issue, author) or move these into an examples directory with clear guards to prevent accidental/mainnet use.
  3. No tests or automation validating the new schema encoding. Given we’re registering a new schema and emitting on-chain attestations, we need unit tests that encode/decode data and a dry-run or mocked attestation path. Also there are no CI checks on this PR — we need at least lint/test coverage before merging.

Nice-to-have: getRepoIssues only returns the first 100 issues (no pagination), which may miss older items.

Assigning @allenday for Tier 3 review.

@allenday
Copy link
Contributor

I agree with @cyberstorm-reviewer - these need to be parameterized and have tests.

Regarding look-back, attestor currently scans back a configurable number of days. Issue attestation can integrate with this scanner.

See attest:once in backend/package.json

Copy link

@cyberstorm-reviewer cyberstorm-reviewer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot approve in current state:

  • No CI checks are running; we need a passing pipeline before merge.
  • No automated tests cover the new issue attestation schema, scripts, or backend additions. Please add coverage for schema encoding/decoding, issue fetch paths, and failure handling.
  • The diff includes generated/build artifacts (e.g., numerous asset and lockfile changes); please remove built outputs and keep only source.

Please add tests/CI, drop generated artifacts, and re-request review.

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.

4 participants