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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ doc_kind: feature
topics: ["agent", "refactor", "orchestration", "testing"]
created: 2026-03-03
updated: 2026-03-03
status: active
status: archived
mode: openspec
---

Expand All @@ -16,9 +16,11 @@ mode: openspec

## OpenSpec Artifacts

- Proposal: `openspec/changes/refactor-dare-agent-structure-split/proposal.md`
- Design: `openspec/changes/refactor-dare-agent-structure-split/design.md`
- Tasks: `openspec/changes/refactor-dare-agent-structure-split/tasks.md`
- Proposal: `openspec/changes/archive/2026-03-03-refactor-dare-agent-structure-split/proposal.md`
- Design: `openspec/changes/archive/2026-03-03-refactor-dare-agent-structure-split/design.md`
- Specs:
- `openspec/changes/archive/2026-03-03-refactor-dare-agent-structure-split/specs/core-runtime/spec.md`
- Tasks: `openspec/changes/archive/2026-03-03-refactor-dare-agent-structure-split/tasks.md`

## Governance Anchors

Expand All @@ -35,6 +37,11 @@ mode: openspec
- `../../.venv/bin/python -m pytest -q tests/unit/test_dare_agent_orchestration_split.py::test_run_tool_loop_retries_until_done_predicate_is_satisfied`
- `../../.venv/bin/python -m pytest -q tests/unit/test_dare_agent_orchestration_split.py`
- `../../.venv/bin/python -m pytest -q tests/unit/test_five_layer_agent.py tests/unit/test_dare_agent_hook_governance.py tests/unit/test_dare_agent_hook_transport_boundary.py`
- `git push origin codex/refactor-dare-agent-structure-split`
- `openspec archive refactor-dare-agent-structure-split -y`
- `openspec list`
- `openspec validate --specs --strict --json --no-interactive`
- `./scripts/ci/check_governance_evidence_truth.sh`

### Results

Expand All @@ -44,6 +51,11 @@ mode: openspec
- `../../.venv/bin/python -m pytest -q tests/unit/test_dare_agent_orchestration_split.py::test_run_tool_loop_retries_until_done_predicate_is_satisfied`: passed (`1 passed, 1 warning`) after the PR #163 review fix raised `max_calls` above the expected completion point, so the retry coverage now proves the loop exits on `done_predicate` satisfaction instead of coincidentally stopping at the budget ceiling.
- `../../.venv/bin/python -m pytest -q tests/unit/test_dare_agent_orchestration_split.py`: passed (`9 passed, 1 warning`) with both the existing façade delegation assertions and the new direct execution-unit tests.
- `../../.venv/bin/python -m pytest -q tests/unit/test_five_layer_agent.py tests/unit/test_dare_agent_hook_governance.py tests/unit/test_dare_agent_hook_transport_boundary.py`: passed (`39 passed, 1 warning`) after the new unit tests landed, confirming no regression on the previously accepted A-101 coverage surface.
- `git push origin codex/refactor-dare-agent-structure-split`: published the verification branch and enabled PR `#163`.
- `openspec archive refactor-dare-agent-structure-split -y`: archived the completed change to `openspec/changes/archive/2026-03-03-refactor-dare-agent-structure-split/` and synced the modularization requirement back into the main `core-runtime` spec.
- `openspec list`: after archive, `refactor-dare-agent-structure-split` no longer appears in the active change list, confirming the change is out of execution scope.
- `openspec validate --specs --strict --json --no-interactive`: passed (`39/39` specs valid, `0` failures) after the `core-runtime` spec was updated during archive.
- `./scripts/ci/check_governance_evidence_truth.sh`: passed after the archive move, artifact-link rewrite, and evidence closeout updates were synchronized.

### Behavior Verification

Expand All @@ -62,3 +74,5 @@ mode: openspec
- Historical owner feedback thread: `https://github.com/zts212653/Deterministic-Agent-Runtime-Engine/pull/117`
- Final verification PR: `https://github.com/zts212653/Deterministic-Agent-Runtime-Engine/pull/163`
- PR #163 review thread: `https://github.com/zts212653/Deterministic-Agent-Runtime-Engine/pull/163#discussion_r2875871921`
- Completion-archive PR: `https://github.com/zts212653/Deterministic-Agent-Runtime-Engine/pull/168`
- Archive target: `openspec/changes/archive/2026-03-03-refactor-dare-agent-structure-split/`
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
- `dare_framework/agent/_internal/orchestration.py`
- New targeted tests:
- `tests/unit/test_dare_agent_orchestration_split.py`
- Current scope verifies facade-to-internal delegation wiring; branch-level success/failure/approval/policy/retry coverage remains pending under task 3.1.
- Current scope now covers both facade-to-internal delegation wiring and direct `_internal` success/failure/approval/policy/retry branches completed under task 3.1.
- Regression suites executed:
- `/Users/lang/workspace/github/Deterministic-Agent-Runtime-Engine/.venv/bin/pytest -q tests/unit/test_five_layer_agent.py tests/unit/test_dare_agent_hook_governance.py tests/unit/test_dare_agent_hook_transport_boundary.py tests/unit/test_dare_agent_orchestration_split.py`
- `PYTHONPYCACHEPREFIX=/tmp/pycache python3 -m compileall -q dare_framework tests`
Expand Down
15 changes: 15 additions & 0 deletions openspec/specs/core-runtime/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,18 @@ The runtime SHALL support deterministic approval rule scopes (`once`, `session`,
- **WHEN** the model requests `run_command` with command `git status --short`
- **THEN** the invocation matches and is auto-approved

### Requirement: DareAgent orchestration implementation is modularized with behavior parity
The runtime SHALL implement session/milestone/execute/tool orchestration through explicit internal execution modules while preserving the externally observable behavior of `DareAgent`.

- `DareAgent` MUST remain the public orchestration entry point and API owner.
- Core loop internals MUST be decomposed into dedicated execution units with clear ownership boundaries.
- Refactoring MUST NOT change existing runtime semantics for budget checks, hook emission, security policy gates, approval flow, event logging, and structured failure returns.

#### Scenario: Refactored orchestration preserves execution semantics
- **WHEN** the runtime executes the existing milestone/execute/tool paths after modularization
- **THEN** it preserves prior success/failure semantics, including policy gating and error normalization behavior

#### Scenario: Core loop logic is unit-testable without full agent integration
- **WHEN** loop behaviors are verified in targeted unit tests for extracted execution units
- **THEN** key control-flow branches (success, denial, approval-required, retry, failure) are validated without requiring full end-to-end agent integration tests

Loading