Skip to content

test: close the v0.2.0 audit gaps; fix the anytime strategy's dropped tracer - #88

Merged
bsbodden merged 2 commits into
mainfrom
test/release-gaps
Nov 16, 2026
Merged

bsbodden merged 2 commits into
mainfrom
test/release-gaps

Conversation

@bsbodden

Copy link
Copy Markdown
Contributor

The test gaps the release audit listed and that should have been closed before 0.2.0 shipped. 48 new tests, one library bug found and fixed.

Bug (fix(planner)). AnytimePlanningStrategy's fast path called astar_plan directly and dropped the tracer that rebind_inner_tracer had bound into its inner strategy, so a tracer given to GoapGraph saw no search expansions from an anytime run while the lazy, repair and two-phase wrappers reported theirs (#63). Caught by the new wrapper-forwarding tests.

Crash-resume (tests/integration/test_crash_resume.py): every round builds a new GoapGraph against the same checkpointer and thread. Asserted across the crash: plan identity, execution history, replan count and reason, failure counts and blacklist (including a denial answered by the new process), sub-goal index and skipped sub-goals, the wall-clock anchor (not re-anchored), the no-plan explanation, reflections not blanked by a fresh tracer, and that finished and no-plan threads stay at END. Sync and async.

Async parity (tests/test_async_parity.py): the same scenario on invoke and ainvoke, compared minus timing: MaxActionsPolicy, MaxCostPolicy, OnStuckPolicy; MultiGoal any / best_value / strict sequential (#35) / skip; stuck-handler goal relaxation; retried failure plus denial counts; handled tool errors (#37); the parallel executor's per-action delta merge (#16); GoalPolicy(blacklist_fallback=True) (#15). Also pinned: a goal object with a checkpointer raises TypeError naming GoalSpec on both paths and initial_state is the way (#17); the compile-option TypeError names the bad key and both option sets for all three on-ramps (#19); format_goap_result caps at 40 keys (#57).

Codec round-trips (tests/test_codec_roundtrips.py), through JsonPlusSerializer: ActionResult.cost, MultiGoal.mode/on_infeasible and the legacy dict defaults, every GoalPolicy field, NirvanaGoal via goal_from_dict, every PlanMetadata and CSPMetadata field including ResourceUsage, ScheduleEntry, makespan and InfeasibilityExplanation, every ActionQos field (exception classes recorded by name and reset on load, as documented), and a typed-form ActionSpec surviving as a boolean gate.

Tracer forwarding and context (tests/test_tracer_forwarding_and_context.py): lazy, anytime, repair and two-phase wrappers forward the planner tracer; a wrapper built with its own inner tracer keeps it; the pipeline, repair, utility, lazy and anytime planners see non-planning context keys (#30).

Full non-API suite: 2129 passed; make lint (black, isort, mypy, ruff) green.

AnytimePlanningStrategy's fast path called astar_plan directly and
dropped the tracer rebind_inner_tracer had bound into the inner strategy,
so a tracer given to GoapGraph saw no search expansions from an anytime
run while the lazy, repair and two-phase wrappers reported theirs (#63).
Found by the new wrapper-forwarding tests, which also pin that the
pipeline, repair and utility planners see non-planning context keys
(#30).
…round-trips)

A run resumed by a new process on the same checkpointer and thread keeps
its plan, history, replan count, failure counts and blacklist, sub-goal
index and skipped sub-goals, wall-clock anchor, no-plan explanation and
reflections, and a finished thread stays finished. ainvoke matches invoke
for termination policies, the three MultiGoal modes and the strict
sequential default, stuck recovery, failure counts, handled tool errors,
the parallel wave merge and the blacklist fallback; the goal-object-with-
checkpointer error, the compile-option TypeError wording and the report
key cap are pinned. Every codec round-trips every field through the
checkpointer serializer.
@github-actions github-actions Bot added the maintenance CI/build/tooling maintenance label Nov 16, 2026
@github-actions

Copy link
Copy Markdown

✅ Code Quality Report

Metric Score Status
MFCQI Score 0.8119375833483001 ✅ Good
Test Coverage 94% ✅ Good
Security Issues 0 ✅ Clean

Quality Gates

  • MFCQI Score: ✅ Minimum 0.75 (Current: 0.8119375833483001)
  • Test Coverage: ✅ Minimum 80% (Current: 94%)
  • Security: ✅ Zero vulnerabilities (Current: 0)

🎉 All quality gates passed! This PR maintains high code quality standards.

📊 View detailed MFCQI breakdown

Run uv run python -m mfcqi analyze langgoap locally to see detailed metrics breakdown.

@bsbodden
bsbodden merged commit 57df76e into main Nov 16, 2026
20 checks passed
@bsbodden
bsbodden deleted the test/release-gaps branch November 16, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance CI/build/tooling maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant