b888afab71
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 16s
CI / build (pull_request) Successful in 19s
CI / quality (pull_request) Successful in 19s
CI / security (pull_request) Successful in 32s
CI / typecheck (pull_request) Successful in 44s
CI / integration_tests (pull_request) Successful in 2m46s
CI / unit_tests (pull_request) Failing after 19m21s
CI / docker (pull_request) Has been skipped
CI / benchmark-regression (pull_request) Successful in 21m3s
CI / coverage (pull_request) Has been cancelled
Add builtin/plan-subplan tool for strategy actors to emit SUBPLAN_SPAWN or SUBPLAN_PARALLEL_SPAWN decisions when decomposing a plan into child plans. Implements all acceptance criteria from issue #198: - SubplanPayload (Pydantic) validates goal, resource_scopes/project_ref (at least one required), merge_strategy, max_parallel (1-50), parallel flag, dependencies, and context_view override. - Defaults: merge_strategy=git_three_way, max_parallel=5, parallel=False, dependencies=[]. Omitted fields inherit sensible values automatically. - make_plan_subplan_spec(decision_service=None) factory supports optional DecisionService injection for persistent decision recording. - _build_rationale() generates human-readable rationale text (goal, scope, execution mode, dependencies, context_view) surfaced in plan explain. - register_subplan_tool() added to tool/builtins/__init__.py for bulk registration. PLAN_SUBPLAN_SPEC exported as the default ready-to-use spec. - Actor YAML example (examples/actors/strategy_with_subplan.yaml) with annotated serial and parallel spawn payload examples. - Behave BDD: 20 scenarios, 70 steps covering validation, defaults, decision type, rationale, service injection, registry, and ToolRunner. - Robot Framework: 9 smoke tests via robot/plan_subplan_tool.robot. - ASV benchmarks: benchmarks/subplan_actor_tool_bench.py (5 suites). - Coverage: 100% on subplan_tool.py. Lint, typecheck, and security clean. ISSUES CLOSED: #198
64 lines
3.1 KiB
Plaintext
64 lines
3.1 KiB
Plaintext
*** Settings ***
|
|
Documentation Smoke tests for builtin/plan-subplan actor tool
|
|
Resource ${CURDIR}/common.resource
|
|
Suite Setup Setup Test Environment
|
|
Suite Teardown Cleanup Test Environment
|
|
|
|
*** Variables ***
|
|
${HELPER_SCRIPT} robot/helper_plan_subplan_tool.py
|
|
|
|
*** Test Cases ***
|
|
Serial Subplan Spawn
|
|
[Documentation] Emit a SUBPLAN_SPAWN decision for a serial subplan
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} serial cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} serial-spawn-ok
|
|
|
|
Parallel Subplan Spawn
|
|
[Documentation] Emit a SUBPLAN_PARALLEL_SPAWN decision for a parallel subplan
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} parallel cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} parallel-spawn-ok
|
|
|
|
Validation Error Without Scope
|
|
[Documentation] Tool returns error when no resource_scopes or project_ref provided
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} validation cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} validation-error-ok
|
|
|
|
Default Values Applied
|
|
[Documentation] merge_strategy, max_parallel, and dependencies use sensible defaults
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} defaults cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} defaults-ok
|
|
|
|
Decision Service Injection
|
|
[Documentation] Injected DecisionService receives the emitted Decision object
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} service cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} service-injection-ok
|
|
|
|
Tool Registration In Registry
|
|
[Documentation] register_subplan_tool adds builtin/plan-subplan to ToolRegistry
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} registration cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} registration-ok
|
|
|
|
ToolRunner Execution
|
|
[Documentation] ToolRunner executes builtin/plan-subplan and returns success
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} runner cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} runner-execution-ok
|
|
|
|
Rationale Text Contains Goal
|
|
[Documentation] Rationale text includes goal and execution mode
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} rationale cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} rationale-ok
|
|
|
|
SubplanPayload Model Direct Validation
|
|
[Documentation] SubplanPayload can be constructed directly for testing
|
|
${result}= Run Process ${PYTHON} ${HELPER_SCRIPT} payload cwd=${WORKSPACE}
|
|
Should Be Equal As Integers ${result.rc} 0
|
|
Should Contain ${result.stdout} payload-model-ok
|