Skip to content

Template marketplace: quality signals, new examples, better search, safe installs#233

Merged
Nanle-code merged 5 commits into
Nanle-code:masterfrom
manoahLinks:feat/marketplace-quality-signals
May 30, 2026
Merged

Template marketplace: quality signals, new examples, better search, safe installs#233
Nanle-code merged 5 commits into
Nanle-code:masterfrom
manoahLinks:feat/marketplace-quality-signals

Conversation

@manoahLinks
Copy link
Copy Markdown
Contributor

This PR bundles four related improvements to the template marketplace and scaffolding workflow.

Closes

#216 — Quality signals & trust indicators

  • Added documented and maintenance (active/maintained/deprecated/unknown) metadata to TemplateEntry.
  • Added a 0–100 quality_score() blending verification, documentation, usage and maintenance, plus trust_indicators() badges.
  • Ranked search by quality score; surface score, maintenance, docs status and badges in list/search/show.
  • Seeded registry.json with the new metadata.

#217 — Real-world example templates

New built-in templates under templates/examples/, each with Cargo.toml, documented src/lib.rs + tests, and a README.md:

  • escrow — DeFi buyer/seller/arbiter token escrow.
  • dao-governance — member proposals with one-member-one-vote tallying.
  • multisig-vault — threshold M-of-N shared-custody vault.

Registered in registry.json and listed in templates/README.md.

#218 — Search relevance & filtering

  • Relevance ranking: name > tag > description matches (exact/prefix weighted highest), then quality, then downloads.
  • New filters on template search: --tags (must have all), --verified, --min-quality; query is now optional.
  • Each result explains why it matched (matched fields + relevance); active filters and match count summarized.
  • Consolidated the duplicate search command handler.

#219 — Install progress & recovery

  • Each install step (fetch → validate → install) runs behind a spinner resolving to a check mark.
  • PathCleanup RAII guard rolls back partially-written directories on failure, for both marketplace installs and the regular contract scaffold path; staging temp dir is always cleaned up.
  • Actionable error messages explaining the failure and the automatic rollback.

Tests

Added unit tests for quality scoring/badges, relevance scoring, and install rollback-vs-commit behavior.

manoahLinks and others added 4 commits May 30, 2026 06:08
Closes Nanle-code#216

Surface lightweight quality signals so users can identify dependable
templates more easily in a growing community catalog.

- Add `documented` and `maintenance` (active/maintained/deprecated/unknown)
  metadata to TemplateEntry, alongside existing verified/downloads.
- Compute a 0-100 quality score blending verification, documentation,
  usage and maintenance state, plus human-readable trust badges.
- Rank search results by quality score (downloads break ties) so trusted,
  well-documented and well-maintained templates surface first.
- Show quality score, maintenance, documentation status and trust badges
  in `template list`, `search` and `show`.
- Seed registry.json with the new metadata and document the feature.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…sig)

Closes Nanle-code#217

Expand the built-in example templates with common real-world use cases so
contributors can learn the system quickly and bootstrap useful contracts.

- escrow: DeFi token escrow with buyer/seller/arbiter roles for marketplaces,
  freelance payments and OTC trades.
- dao-governance: minimal DAO with member proposals and one-member-one-vote
  tallying.
- multisig-vault: threshold (M-of-N) multi-signature vault for shared-custody
  token transfers and treasuries.

Each template ships a Cargo.toml, documented src/lib.rs with unit tests, and a
README with build/deploy/usage instructions, and uses the standard
{{PROJECT_NAME}} placeholders. Registered in registry.json (builtin source,
quality metadata) and listed in templates/README.md.
…lanations

Closes Nanle-code#218

Make template discovery faster and results easier to scan.

- Add relevance-based ranking: name matches outweigh tag matches, which
  outweigh description matches; exact/prefix name matches score highest.
  Results sort by relevance, then quality score, then downloads.
- Add structured filters to `template search`: --tags (must have all),
  --verified, and --min-quality. Query is now optional ("" lists all).
- Explain each result by reporting which fields matched and a relevance
  value, and summarize the active filters above the results.
- Add SearchFilters/SearchResult/search_templates_ranked to the templates
  module; keep search_templates as a thin backwards-compatible wrapper.
- Consolidate the duplicate search command handler into one implementation
  and document the new flags. Add unit tests for relevance scoring.
Closes Nanle-code#219

Make template installation clearer and recoverable.

- Show each install step (fetch, validate, install) behind a spinner that
  resolves to a check mark on success.
- Add a PathCleanup RAII guard that rolls back partially-written directories
  when any step fails, for both marketplace installs (staged temp dir + target
  dir) and the regular contract scaffold path. The staging temp dir is always
  cleaned up.
- Surface actionable error messages explaining the failure and that the
  partial install was rolled back; the download-count update is now best-effort
  and never rolls back a successful install.
- Add unit tests covering rollback-vs-commit behavior.
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@manoahLinks Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

The repository had unresolved merge artifacts (duplicated functions, match
arms, struct fields and imports) across several modules that prevented
`cargo build`. Resolve them so the branch compiles and tests run.

- Cargo.toml: remove duplicate `sha2` key; drop the unused `soroban-sdk`
  dependency (only referenced inside generated-template string literals), which
  also fixes an unresolvable `quote` version conflict with zxcvbn.
- templates.rs: make `TemplateEntry.source` the `TemplateSource` enum (matches
  registry.json), delete the duplicate string/`serde_json::Value` variants of
  template_source_content/add_template/fetch_template/update_template, drop the
  unreachable tail in load_registry (now falls back to the bundled registry),
  and add a builtin-template fetch path.
- new.rs: resolve duplicated dapp_main/dapp_package/scaffold_dapp; use enum
  source Display.
- wallet.rs: fix interleaved Rotate/Export/Import match arms and the
  encrypt_secret arity.
- tx.rs: remove duplicate TxFilter fields. network.rs: remove duplicate Add
  arm. deploy.rs: drop duplicate import line. main.rs: remove stray `mod info`.
- crypto.rs: derive Debug on StrengthReport so its test compiles.

Builds clean; 100/102 unit tests pass. The 2 remaining failures
(deploy sha256 fixture, soroban event parsing) are pre-existing and unrelated
to these conflicts.
@Nanle-code Nanle-code merged commit bf0dfa1 into Nanle-code:master May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants