Skip to content

feat(agent): render public-safe scenario summaries#416

Open
claytonlin1110 wants to merge 2 commits into
JSONbored:mainfrom
claytonlin1110:feat/scenario-summary-render
Open

feat(agent): render public-safe scenario summaries#416
claytonlin1110 wants to merge 2 commits into
JSONbored:mainfrom
claytonlin1110:feat/scenario-summary-render

Conversation

@claytonlin1110
Copy link
Copy Markdown
Contributor

Summary

  • Adds src/scenarios/scenario-summary.ts with renderPublicScenarioSummary(), converting outputs from the existing pressure, eligibility, and blocker simulators into a structured PublicScenarioSummary for MCP/API and control-panel consumers
  • All text fields pass through sanitizePublicComment with a final defensive guard rejecting any serialization still containing forbidden language (wallet, hotkey, score estimates, trust scores, private reviewability)
  • Adds test/unit/scenario-summary.test.ts with 28 tests covering ranked option rendering, eligibility notes, blocker notes, data classification, combined inputs, sanitizer fixtures, and advisory-only invariants
  • Closes feat(agent): add repo-specific scenario simulator #271

Scope

  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; global coverage stays at or above 97% for lines, statements, functions, and branches (aim for 98%+ branch coverage locally so CI variance does not fail near the threshold)
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • The full npm run test:coverage suite has 3 pre-existing failures on Windows (mcp-cli.test.ts, github-type-label.test.ts, mcp-release.test.ts) caused by a libuv platform assertion unrelated to this PR. All 96 scenario-related tests pass. Remaining CI checks (actionlint, build:mcp, ui:*, audit) are left for CI to run.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (not applicable)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (no API surface change; render layer is internal)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (not applicable — backend only)
  • Visible UI changes include screenshots or a short recording. (not applicable — no UI changes)
  • Public docs/changelogs are updated where needed. (not applicable)

Notes

  • renderPublicScenarioSummary() is composable: all inputs are optional, so callers can pass any subset of simulator outputs (pressure simulation, eligibility plan, blockers, scenario input) without requiring all of them.
  • The assertPublicSummaryClean guard at the end of the render function is a defensive belt-and-suspenders check; in practice all fields are already sanitized individually before reaching it.

@claytonlin1110 claytonlin1110 requested a review from JSONbored as a code owner June 5, 2026 11:15
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Jun 5, 2026
@github-actions github-actions Bot added the feature New feature or request label Jun 5, 2026
@gittensory
Copy link
Copy Markdown

gittensory Bot commented Jun 5, 2026

Important

Gittensory found maintainer review notes

Scoped related-work signals were found for this PR. They are advisory unless the gate reports a blocker.

Readiness score: 75/100

Signal Result Evidence Action
Linked issue ✅ Linked #271 No action.
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden. Review top overlaps.
Review load ❌ 8/20 Readiness component derived from cached public PR metadata and labels; size label size:L. Add scope summary.
Validation evidence ✅ 25/25 PR body includes validation/test evidence. No action.
Open PR queue ❌ 3/10 17 open PR(s), 15 likely reviewable. Expect slower review.
Contributor context ✅ Confirmed Gittensor contributor claytonlin1110; Gittensor profile; 33 PR(s), 2 issue(s). No action.
Gate result ✅ Passing No configured blocker found. No action.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Review load = cached public PR metadata such as size labels, changed paths, and preflight status.
  • Open PR queue = repo-wide review pressure; it is not a PR quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
Review context
  • Author: claytonlin1110
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 33 PR(s), 2 issue(s).
  • Related work: Items reference the same linked issue feat(agent): add repo-specific scenario simulator #271. (issue #271)
  • Related work: Titles/paths share 8 meaningful terms. (issue #290)
  • Related work: Titles/paths share 11 meaningful terms. (PR #345)
  • Additional title-only matches omitted; title-only overlap does not block.
Maintainer notes
  • Possible duplicate or overlapping work: 49 related open work cluster(s) were detected.
Contributor next steps
  • Review top overlaps.
  • Add scope summary.
  • Expect slower review.
  • Check active issues and PRs before submitting.
  • Re-run Gittensory review

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. Learn more about Gittensor contribution workflows.

@gittensory gittensory Bot added the gittensory:reviewed Gittensor contributor context label Jun 5, 2026
@github-actions github-actions Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue label Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request gittensor:feature Gittensor-scored feature linked to a feature issue gittensory:reviewed Gittensor contributor context size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

feat(agent): add repo-specific scenario simulator

2 participants