Skip to content

feat: behavior-tree trace-testing pipeline (Phase 3)#73

Merged
guilyx merged 3 commits into
develfrom
cursor/trace-test-pipeline-2d56
Jul 4, 2026
Merged

feat: behavior-tree trace-testing pipeline (Phase 3)#73
guilyx merged 3 commits into
develfrom
cursor/trace-test-pipeline-2d56

Conversation

@guilyx

@guilyx guilyx commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary

Phase 3 of the roadmap: a declarative trace-testing pipeline for the behavior trees under edit, built on the exec core (#72, now merged to devel). This is the "pipeline for testing the behavior tree" from the review.

Rebased onto devel; conflicts resolved (CHANGELOG.md, plus the latched-status tick.ts refinement kept over devel's original). Now targets devel directly.

What's included

  • src/btcpp/exec/trace.tsTraceScenario / TraceAssertion DSL and runScenario(doc, scenario):
    • Mocks: per-leaf outcomes (fixed or per-tick scripts) keyed by instance name / registered ID.
    • Assertions: node status at a path, rootStatus, or blackboard subset — at a specific tick or the final tick. Missing (never-ticked) nodes read as IDLE.
    • Records the full per-tick trace so both live and end-of-run expectations work; failures report the actual value.
  • Sample *.trace.json fixtures: simple_sequence (happy + failing-branch), fallback_recovery (primary→backup recovery), subtree_running (two-tick RUNNING action through a SubTree).
  • src/test/unit/trace.test.ts — unit tests for the runner plus a discovery runner that executes every fixtures/**/*.trace.json against its sibling .xml, turning fixtures into a CI behavior gate.

Included engine refinement

Improved the exec core to a Groot-like latched-status model: internal-state reset (for re-ticking) is separated from visible halt (IDLE), so a failed node keeps its FAILURE status in the snapshot instead of being clobbered. Benefits both traces and the overlays. All exec-core and verifier tests still pass with this version.

Testing

  • npm run test:unit — 77 passed (trace + exec + verifier together)
  • npm run check-types
  • npm run lint
  • npm run compile
Open in Web Open in Cursor 

@cursor cursor Bot marked this pull request as ready for review July 2, 2026 21:35
cursor[bot]
cursor Bot previously approved these changes Jul 2, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: medium. Cursor Bugbot was not present on this PR; CI checks (pre-commit, Linux/macOS/Windows builds) all passed. Approving the trace-testing pipeline changes with unit tests and fixtures; no reviewers assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

Base automatically changed from cursor/exec-tick-core-2d56 to devel July 2, 2026 21:51
@guilyx guilyx dismissed cursor[bot]’s stale review July 2, 2026 21:51

The base branch was changed.

…peline-2d56

# Conflicts:
#	CHANGELOG.md
#	src/btcpp/exec/tick.ts

Co-authored-by: Erwin L. <[email protected]>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Cursor Bugbot was not present on this PR; pre-commit passed and there are no unresolved automated findings. Approving the trace-testing pipeline changes; no reviewers assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@guilyx guilyx merged commit f5ce5f6 into devel Jul 4, 2026
6 checks passed
@guilyx guilyx deleted the cursor/trace-test-pipeline-2d56 branch July 4, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants