feat(core,cli): defect-report — ZeroGError → QA-ready defect#52
Merged
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
What
Turns any
ZeroGErrorinto 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. EveryZeroGErroralready carries acode+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/生态 dAppremain valid manual overrides.suggestSeverity(code)— P1 blockers, P3 caller-fixable config, P2 otherwise. Always rendered as a suggested — confirm against impact value.0gkit-cli--defect-reportglobal flag. On error, prints the defect report to stderr (mirrors--copy-issue-context; keeps--jsonstdout clean). Auto-derives Chain ID + network from the resolved context.Docs
corepackage 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-reportflag. 131 pass.boundary:check(no violations), format — all green.🤖 Generated with Claude Code