Skip to content

feat(core,cli): defect-report — ZeroGError → QA-ready defect#52

Merged
rajkaria merged 1 commit into
mainfrom
feat/defect-report-qa-template
Jun 1, 2026
Merged

feat(core,cli): defect-report — ZeroGError → QA-ready defect#52
rajkaria merged 1 commit into
mainfrom
feat/defect-report-qa-template

Conversation

@rajkaria
Copy link
Copy Markdown
Owner

@rajkaria rajkaria commented Jun 1, 2026

What

Turns any ZeroGError into a ready-to-file QA defect report in the bilingual template used by the 0G ecosystem app-test program.

0gkit-core (new exports)

  • buildDefectReport(input) — renders the QA defect template. Every ZeroGError already carries a code + helpUrl, so the report auto-fills ownership, a suggested severity, the environment line, the actual result, and a root-cause hint. Only repro steps / expected / screenshot are left for the human tester.
  • suggestOwnership(code) — infra-class codes (chain/storage/compute/DA/attestation/indexer) → 0G Infra; integration/config/wallet/contracts/jobs/observability → Hackathon项目. App Suite / 生态 dApp remain valid manual overrides.
  • suggestSeverity(code) — P1 blockers, P3 caller-fixable config, P2 otherwise. Always rendered as a suggested — confirm against impact value.
  • Framework-agnostic, zero deps — a browser dApp's error boundary and the CLI emit the same report.

0gkit-cli

  • New --defect-report global flag. On error, prints the defect report to stderr (mirrors --copy-issue-context; keeps --json stdout clean). Auto-derives Chain ID + network from the resolved context.

Docs

  • core package page: new API section + exports list.

Why

The 0G app-test reviewers file reproducible, routed defects by hand. This makes any 0gkit-based dApp (Foundry included) emit a half-complete, groupable defect for free — env + code + routing captured, so the tester only adds repro steps. Codes also make defects aggregatable into systemic patterns, which the program explicitly wants.

Tests

  • 0gkit-core: 11 new tests (ownership/severity over the full code enum, render, ZeroGError instance, overrides, fallbacks). 77 pass.
  • 0gkit-cli: 2 new tests for the --defect-report flag. 131 pass.
  • typecheck (core + cli), boundary:check (no violations), format — all green.

🤖 Generated with Claude Code

…efect

Adds buildDefectReport() + suggestOwnership()/suggestSeverity() to 0gkit-core
and a --defect-report CLI flag. Renders the bilingual defect template used by
the 0G ecosystem app-test program (github.com/lvxuan149/0g-apac-app-test),
auto-filling ownership, suggested severity, environment, actual result, and
root-cause from the error code + helpUrl. Framework-agnostic (no deps) so a
browser dApp error boundary and the CLI emit the same report.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
0gkit Ready Ready Preview, Comment Jun 1, 2026 7:32am
0gkit-docs Ready Ready Preview, Comment Jun 1, 2026 7:32am
0gkit-playground Ready Ready Preview, Comment Jun 1, 2026 7:32am

Request Review

@rajkaria rajkaria merged commit 006e514 into main Jun 1, 2026
8 checks passed
@rajkaria rajkaria deleted the feat/defect-report-qa-template branch June 1, 2026 07:38
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