traverse-framework / traverse-framework/registry

CREATIVE: Publish core.refund-eligibility-decide (rules-bound refund eligibility)

Open
#504 0 comments 0 reactions 0 assignees View on GitHub
enhancement help wanted no-spec-needed
Dominant language
Rust
Stars
1
Forks
1
Avg merge
1h 17m
Merged PRs (30d)
217

Description

## Why (creative vignette)

Agents love to promise refunds. Runtime should call a **rules-bound refund eligibility** capability: given order facts + policy table, decide eligible / ineligible / manual_review with reason codes.

## Guardrails (required)

- Machine-readable contract (inputs/outputs/errors)
- Deterministic OR fail-closed with explicit uncertainty — **no silent LLM invent**
- Tests + publish checklist like other caps
- NOT a thin LLM string wrapper / generic util
- Business/agent-governance domain

## One-PR ask

Publish **`core.refund-eligibility-decide@1.0.0`**:

**Suggested contract:**
- Inputs: `order` (id, status, purchased_at, amount, currency, optional category); `request` (reason_code, requested_amount, now); `rules` ordered policy rules (window days, status allowlist, partial refund caps); `policy_version`
- Outputs: `decision` (`eligible|ineligible|manual_review`), `approved_amount` (number|null), `reason_code`, `matched_rule_id`, `policy_version`, `ok`
- Behavior: first-match rules; amount cannot exceed order amount; invalid rules fail closed

Creative freedom: pick a concrete merchant policy vignette (digital goods vs physical, restocking fees, etc.) as long as the contract stays machine-readable and fail-closed.

Follow [`CONTRIBUTING.md`](https://github.com/traverse-framework/registry/blob/main/CONTRIBUTING.md) and [`capabilities/README.md`](https://github.com/traverse-framework/registry/blob/main/capabilities/README.md) publish checklist.

- Include `capability-src/` with real Rust tests meeting registry coverage gates (`functions` 100%, lines/regions ≥ 95%)
- Use `traverse-cli capability publish` (or the documented scaffold) so `artifact.digest` / `artifact.url` survive
- Declare `authoring.method` (`human` or `llm-assisted`)
- Ensure every `use_cases[].persona_ref` resolves (scaffold personas if needed)
- Run `bash scripts/ci/pre_pr_check.sh ` before opening
- One capability per PR; branch from `origin/main`, not another `publish/*` branch

**Apps are not ready — publish the capability only.** No app wiring, no demo product surface.

## Out of scope

- Payment provider execution / money movement
- Chatty "customer apology" generation
- Replacing commerce cart caps

## Done when

- CI green; published in next index
- Tests: within window eligible, outside window ineligible, over-amount reject, manual_review path

## Host / deps notes

**Pure WASM.** Caller supplies `now` and order facts. No connector.

## Labels

`help wanted` · `enhancement` · `no-spec-needed`

Contributor guide

Open the contributing guide

Research direction

Read CONTRIBUTING.md and capabilities/README.md first, then inspect the documented scaffold and existing capability-src/ Rust tests. Use traverse-cli capability publish and run bash scripts/ci/pre_pr_check.sh ; done means the capability is published with its contract, coverage-gated tests, resolved persona references, preserved artifact metadata, and green CI.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.