Skip to content

Commit 8d74676

Browse files
committed
docs: add LICENSE, CONTRIBUTING, and CHANGELOG
- LICENSE: MIT, retaining the original behavior3 copyright (Renato de Pontes Pereira, 2014) as required by the upstream license, plus henrytien (2026) for the independent maintenance. - CONTRIBUTING: build/test/format expectations and naming conventions. - CHANGELOG: Keep a Changelog format, documenting this round of work.
1 parent 6224aa3 commit 8d74676

3 files changed

Lines changed: 140 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Changelog
2+
3+
All notable changes to this project are documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
- Optional library logger (`Logf` / `SetLogger` / `SetLogOutput`), silent by
12+
default so the library never writes to stdout unasked.
13+
- `loader.CreateBehaviorTreeFromConfigSafe`: an error-returning loader that
14+
recovers from malformed-config panics instead of crashing the process.
15+
- Core unit tests for composites (Sequence, Priority), the Inverter decorator,
16+
and `RUNNING` tick propagation.
17+
- Bilingual (中文 / English) documentation site built with Docusaurus, plus a
18+
"Design Notes" page covering node concepts and implementation-specific tips.
19+
- CI workflows: cross-platform Go build/vet/test, and automatic deployment of
20+
the documentation site to GitHub Pages.
21+
- `LICENSE`, `CONTRIBUTING.md`, and this `CHANGELOG.md`.
22+
23+
### Changed
24+
- Renamed the import alias `b3` to `bt` across the codebase to match the
25+
behavior-tree naming (pure alias rename, no behavior change).
26+
- Standardized naming: external brand / module path is `behavior-tree`; the Go
27+
package declaration is `behaviortree`.
28+
- Upgraded the Go directive to 1.23.
29+
- Rewrote the README with installation, a quick-start example, and a built-in
30+
node overview; removed outdated local-editor setup steps.
31+
32+
### Fixed
33+
- Corrected copy-paste panic messages in the `Limiter`, `MaxTime`, `Repeater`,
34+
`RepeatUntilFailure`, and `RepeatUntilSuccess` decorators, which all named
35+
the wrong decorator type.
36+
- Removed dead `unreachable code` after `panic` in the config package and
37+
replaced the deprecated `io/ioutil` with `os`.
38+
- Replaced dead external links (behaviac.com, the Youdao note) with stable
39+
references.
40+
41+
## [0.2.0]
42+
43+
Earlier history, inherited from `magicsea/behavior3go`:
44+
45+
### Added
46+
- `SubTree` node support (requires the editor to export the node `category`).
47+
- `RandWait` action: random wait supporting `min_ms`/`max_ms`, compatible with
48+
`timemini`/`timemax` and a fixed `milliseconds`.
49+
- `Probability` decorator: supports `probability`/`rate`/`percent` and
50+
`skip_status`.
51+
52+
[Unreleased]: https://github.com/henrytien/behavior-tree/compare/master...HEAD

CONTRIBUTING.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Contributing
2+
3+
Thanks for your interest in improving **behavior-tree**! This project is a Go
4+
implementation of the [behavior3](https://github.com/behavior3) behavior tree,
5+
maintained independently at `github.com/henrytien/behavior-tree`.
6+
7+
## Getting started
8+
9+
Requires Go 1.23 or later.
10+
11+
```bash
12+
git clone https://github.com/henrytien/behavior-tree
13+
cd behavior-tree
14+
go build ./...
15+
go test ./...
16+
```
17+
18+
## Before opening a pull request
19+
20+
Please make sure the following all pass locally:
21+
22+
```bash
23+
gofmt -l . # should print nothing
24+
go vet ./... # should report nothing
25+
go test ./... # should pass
26+
```
27+
28+
- **Format**: code must be `gofmt`-clean.
29+
- **Tests**: add tests for new behavior. Core behavior tests live in
30+
`loader/` (the loader package imports every node package, so trees can be
31+
assembled from JSON configs in tests without import cycles).
32+
- **No stray output**: the library must stay silent by default. Route any
33+
diagnostic output through `Logf` rather than `fmt.Println`.
34+
- **Backward compatibility**: avoid breaking the existing public API. Prefer
35+
additive changes (for example, the error-returning `...Safe` loader sits
36+
alongside the panic-based one).
37+
38+
## Commit messages
39+
40+
Use short, imperative, English commit subjects with a type prefix, e.g.:
41+
42+
```
43+
feat: add CreateBehaviorTreeFromConfigSafe returning an error
44+
fix: correct copy-paste panic messages in decorators
45+
docs: add Design Notes page
46+
test: add core behavior tests for composites
47+
```
48+
49+
## Naming conventions
50+
51+
- External brand, repository, module path, docs: `behavior-tree`.
52+
- Go package declaration: `behaviortree` (Go package names cannot contain
53+
hyphens).
54+
- Import alias used throughout the code and examples: `bt`.
55+
56+
## Documentation
57+
58+
User-facing docs live under `website/` (Docusaurus, bilingual 中文 / English).
59+
Chinese is the default locale; English translations live under
60+
`website/i18n/en/`. When you change behavior, update the matching doc page in
61+
both languages.
62+
63+
## Reporting issues
64+
65+
When filing a bug, please include the behavior tree JSON (or a minimal
66+
reproduction), the Go version, and what you expected versus what happened.

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2014 Renato de Pontes Pereira
4+
Copyright (c) 2026 henrytien
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.

0 commit comments

Comments
 (0)