feat(miner): add CoC-compliant rejection message templates - #2804
Conversation
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2804 +/- ##
=======================================
Coverage 96.22% 96.22%
=======================================
Files 255 255
Lines 27944 27944
Branches 10156 10156
=======================================
Hits 26889 26889
Misses 433 433
Partials 622 622 🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-03 21:50:38 UTC
⏸️ Suggested Action - Manual Review Review summary Nits — 4 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
0815ebf to
63980bf
Compare
63980bf to
4d9b9e6
Compare
|
Fixed. |
Add packages/gittensory-miner/lib/rejection-templates.js: a pure, deterministic renderer for the courtesy note the miner may leave locally when one of its PRs is closed/rejected. Static templates keyed by reason bucket (gate_close, maintainer_close_no_reason, superseded_by_duplicate) rendered from a structured context (repoFullName + prNumber); no GitHub calls, no LLM, no network. Notes are courteous and non-defensive, never re-litigating the maintainer decision. containsPrivateLanguage mirrors sanitizePublicComment's redaction set and the templates are asserted free of private-language tokens. Closes JSONbored#2324.
4d9b9e6 to
f211c4d
Compare
Summary
Adds CoC-compliant rejection message templates to
@jsonbored/gittensory-miner: when one of the miner's PRs is closed/rejected, it can render a single, final, human-readable courtesy note (for a local run summary or CLI output — posting anywhere is a separate write action, out of scope here). Pure content/formatting: static template strings + a deterministic renderer, no GitHub calls, no LLM, no network.renderRejectionMessage(reason, context)renders the note for one of the reason buckets inREJECTION_REASONS—gate_close,maintainer_close_no_reason,superseded_by_duplicate— from a structuredcontext(repoFullName=owner/repo,prNumber= positive integer). It throws on an unknown reason, a malformed context, or (defensively) any unresolved placeholder, so a caller can never emit a half-rendered note. Same inputs always render the same message.containsPrivateLanguage(text)mirrors the redaction set insanitizePublicComment(src/github/commands.ts); the templates are authored clean and this is asserted in tests. The structured context (a PR number + a validatedowner/repo) carries no private scoring/reward/wallet data, so — deliberately — no value-level redaction is applied that would mangle a legitimate repo name.Closes #2324.
Location note: the issue sketched
src/manage/rejection-templates.ts, but this package is authored as plain-JSlib/*.js+ hand-written.d.ts(no TS build — itsbuildisnode --check), like every other module beside it (deny-hooks,run-state,event-ledger,claim-ledger, …). I followed that established, merged convention rather than introducing a TS toolchain to the package.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run typechecknpm run test:coveragelocally — the newtest/unit/miner-rejection-templates.test.tspasses (whole miner suite green). This change lives entirely inpackages/**, which Codecov does not measure, so it carries nocodecov/patchobligation; the logic is nonetheless exercised across every reason bucket rendering cleanly, the courteous/no-private-language assertions, the private-language guard, unknown-reason, and malformed-context rejection.node --check lib/rejection-templates.jsvianpm run --workspace @jsonbored/gittensory-miner buildnpm audit --audit-level=moderate— this PR adds no dependencies, so dependency-review has nothing new to evaluate.If any required check was skipped, explain why:
packages/gittensory-miner/libplus its test — nosrc/**, UI, API schema, DB, or Cloudflare-binding surface is touched.Safety
UI Evidencesection. — n/a: no visible UI, frontend, docs, or extension change.Notes
Additive: two new files (
lib/rejection-templates.js+ itslib/rejection-templates.d.ts), one line added to the packagebuild(node --check) gate, and one new test file. No existing code is modified.