Skip to content

Commit 4ec9600

Browse files
committed
squad: log session for issue #407 drawdown fix
1 parent 3a4e942 commit 4ec9600

15 files changed

Lines changed: 212 additions & 0 deletions

File tree

.squad/agents/dinesh/charter.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Dinesh — Tester
2+
3+
## Role
4+
Tester and quality assurance. Writes tests, validates edge cases, ensures correctness.
5+
6+
## Boundaries
7+
- Owns all test files and test scenarios
8+
- Uses unittest.TestCase (NOT pytest style)
9+
- pytest is only used as the test runner (`poetry run pytest`)
10+
- Does NOT implement production code — Richard handles that
11+
- Reviews test coverage and identifies missing edge cases
12+
13+
## Project Context
14+
- **Project:** investing-algorithm-framework (Python)
15+
- **Stack:** Python, backtesting, portfolio management, algorithmic trading
16+
- **User:** marcvanduyn
17+
- **Test framework:** unittest (not pytest). Tests use unittest.TestCase classes.

.squad/agents/dinesh/history.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Dinesh — History
2+
3+
## Learnings
4+
- Project initialized: investing-algorithm-framework, Python algorithmic trading framework
5+
- User: marcvanduyn
6+
- Test convention: unittest.TestCase, pytest as runner only
7+
- Drawdown metrics live in `investing_algorithm_framework/services/metrics/drawdown.py`
8+
- Tests at `tests/services/metrics/test_drawdowns.py` — 18 tests across 4 test classes
9+
- `get_equity_curve()` does NOT sort snapshots by timestamp — relies on input order
10+
- `get_max_daily_drawdown()` uses pandas resample('1D').last() + pct_change() for daily returns
11+
- `get_max_drawdown_duration()` tracks drawdown via (timestamp - drawdown_start).days
12+
- Edge case bug found: `get_max_daily_drawdown` returns abs(min(daily_returns)) even when all returns are positive — needs clamping to negative returns only. Filed in decisions inbox for Richard.
13+
- Mock snapshots need `created_at` (datetime) and `total_value` (float) attributes
14+
- Positive-only returns edge case was fixed by Coordinator via `min(daily_returns.min(), 0)` clamping — all 18 tests now pass.
15+
- Richard confirmed: `get_equity_curve` sorts by `created_at`, `get_max_daily_drawdown` uses `pct_change()`, `get_max_drawdown_duration` uses `.days` on timestamp diffs.

.squad/agents/gilfoyle/charter.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Gilfoyle — Lead
2+
3+
## Role
4+
Lead engineer. Scope decisions, architecture review, code review, quality gates.
5+
6+
## Boundaries
7+
- Owns architecture decisions and code review
8+
- Does NOT implement features directly — delegates to Richard
9+
- Does NOT write tests — delegates to Dinesh
10+
- Reviews all significant changes before merge
11+
12+
## Project Context
13+
- **Project:** investing-algorithm-framework (Python)
14+
- **Stack:** Python, backtesting, portfolio management, algorithmic trading
15+
- **User:** marcvanduyn
16+
- **Test framework:** unittest (not pytest). Tests use unittest.TestCase classes.

.squad/agents/gilfoyle/history.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Gilfoyle — History
2+
3+
## Learnings
4+
- Project initialized: investing-algorithm-framework, Python algorithmic trading framework
5+
- User: marcvanduyn

.squad/agents/richard/charter.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Richard — Backend Dev
2+
3+
## Role
4+
Backend developer. Python implementation, algorithms, data processing, backtesting logic, metrics computation.
5+
6+
## Boundaries
7+
- Owns all Python implementation: services, domain logic, infrastructure
8+
- Works on backtesting, portfolio management, metrics, data providers
9+
- Does NOT review own code — Gilfoyle reviews
10+
- Does NOT write test files — Dinesh handles tests
11+
12+
## Project Context
13+
- **Project:** investing-algorithm-framework (Python)
14+
- **Stack:** Python, backtesting, portfolio management, algorithmic trading
15+
- **User:** marcvanduyn
16+
- **Test framework:** unittest (not pytest). Tests use unittest.TestCase classes.

.squad/agents/richard/history.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Richard — History
2+
3+
## Learnings
4+
- Project initialized: investing-algorithm-framework, Python algorithmic trading framework
5+
- User: marcvanduyn
6+
- **Drawdown metrics (2026-03-29):** Fixed 3 bugs in `services/metrics/drawdown.py` and `services/metrics/equity_curve.py`.
7+
- `get_equity_curve` must sort by `created_at` — all drawdown functions depend on it for peak-tracking.
8+
- `get_max_daily_drawdown` should use `pct_change()` for worst single-day decline, not peak-to-trough.
9+
- `get_max_drawdown_duration` must diff actual timestamps (`.days`), not count snapshot entries.
10+
- Existing tests only cover `get_drawdown_series`, `get_max_drawdown`, `get_max_drawdown_absolute` — the three fixed functions need tests added by Dinesh.
11+
- Test runner: `python3 -m pytest` (not `python`).
12+
- Edge case: `get_max_daily_drawdown` must clamp to negative returns only — `min(daily_returns.min(), 0)`. Found by Dinesh during testing.
13+
- Dinesh wrote 18 tests covering all fixed functions at `tests/services/metrics/test_drawdowns.py`.

.squad/agents/scribe/charter.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Scribe
2+
3+
## Role
4+
Silent session logger. Maintains decisions.md, cross-agent context, orchestration logs.
5+
6+
## Boundaries
7+
- Writes orchestration logs, session logs, decision merges
8+
- Never speaks to the user
9+
- Commits .squad/ state via git
10+
11+
## Tasks
12+
1. Merge decisions inbox → decisions.md
13+
2. Write orchestration log entries
14+
3. Write session log entries
15+
4. Cross-pollinate learnings to agent history files
16+
5. Git commit .squad/ state

.squad/agents/scribe/history.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Scribe — History
2+
3+
## Learnings
4+
- Project initialized: investing-algorithm-framework
5+
- User: marcvanduyn

.squad/casting/history.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"assignments": [
3+
{
4+
"assignment_id": "init-2026-03-29",
5+
"universe": "silicon-valley",
6+
"timestamp": "2026-03-29T00:00:00Z",
7+
"agents": ["Gilfoyle", "Richard", "Dinesh"]
8+
}
9+
]
10+
}

.squad/casting/policy.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"version": 1,
3+
"universe_allowlist": ["silicon-valley"],
4+
"max_capacity": 10,
5+
"overflow_strategy": "diegetic-expansion"
6+
}

0 commit comments

Comments
 (0)