Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Contributing

## Issues and proposals

Open a [GitHub issue](https://github.com/toprameen/bend-ta/issues) before
starting substantial API or indicator work. For a bug, include a minimal Bend
example with inputs and parameters, your Bend and bend-ta versions, the native
or JavaScript backend, and the expected and actual outputs. Report security
issues using the [security policy](SECURITY.md).

## Bend-only source policy

Write all maintained program logic in Bend, including the library, examples,
Expand Down Expand Up @@ -81,6 +89,10 @@ and hand-maintained catalogs.

## Changes and review

Open a pull request against `main` from a feature branch or your fork. Explain
what changed, how you checked it, and any effect on the public API or numerical
results. Keep logic and tests in separate commits, with logic first.

Keep algorithms in `src/core/` and bind concrete operations in the facade.
Use the same state transitions for batch and streaming. Add applicable laws and
independent reference fixtures before extending the public interface.
Expand All @@ -90,9 +102,22 @@ a pull request. For changes to contracts, the runner, or the gate, use a
temporary copy outside the checkout to verify that a relevant defect is rejected.
Preserve existing assertions and justify arithmetic assumptions.

Maintainers should require the `Bend-only and tests` check through branch
protection and review changes to the workflow, policy, agent instructions,
Every change to `main` goes through a pull request and must pass the
`Bend-only and tests` check. A maintainer approves outside contributions.
When there is only one maintainer, they review the diff on their own pull
requests before merging. Once there is a second maintainer, require one
approval from someone other than the author. Maintainers use **Rebase and
merge** and review changes to the workflow, policy, agent instructions,
tooling, and proof contracts.

Policy changes require a maintainer decision. Keep instructions usable from a
normal clone.

## Releases

Tag tested commits on `main` as `vMAJOR.MINOR.PATCH` and record changes in the
[GitHub release notes](https://github.com/toprameen/bend-ta/releases). During
`0.x`, use a patch bump for compatible fixes and a minor bump for features or
breaking changes. Note changes to public APIs, computed outputs, warm-up
behavior, and compiler requirements. Publish corresponding BendHub versions
from the same commits, using the registry's four-part version format.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# bend-ta

F32 technical analysis in Bend for streaming and batch calculations.
Technical analysis indicators for Bend, with batch and streaming APIs.

## Use

Import the [F32 API](f32.bend) using a path relative to your Bend file.
Import the [F32 API](f32.bend) from [BendHub](https://hub.bend-lang.com/n/bend-ta).

```bend
import Base
import ./f32.bend as TA
import bend-ta@0.1.0.0/f32.bend as TA

def averages() -> Result<&2, &2, TA.Error(), List<&2, Maybe<&2, F32>>>:
TA.SMA.batch([3.0, 6.0, 9.0, 12.0], 3)
Expand All @@ -18,7 +18,7 @@ The result is `Done{[None{}, None{}, Some{6.0}, Some{9.0}]}`. `None` marks
warm-up. An invalid period returns `Fail`.

The [moving averages example](examples/moving_averages.bend) shows batch and
single-observation streaming with `init` and `next`. Run it with
single-observation streaming with `init` and `next`. From a checkout, run
`bend examples/moving_averages.bend`.

`TA.Stream.scan` processes a chunk from an existing state and returns the
Expand Down
5 changes: 5 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Security policy

Report suspected vulnerabilities through GitHub's [private reporting
form](https://github.com/toprameen/bend-ta/security/advisories/new). Include
the affected version or commit, steps to reproduce, and the potential impact.