Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
12e19cf
Initial plan
Copilot Mar 30, 2026
ad3a956
feat: compute first unmet soc-minima/soc-maxima targets in storage sc…
Copilot Mar 30, 2026
9e12432
refactor: address code review comments on unresolved targets feature
Copilot Mar 30, 2026
654743a
fix: address coordinator findings in unresolved targets feature
Copilot Mar 30, 2026
633fd87
refactor: introduce SCHEDULING_RESULT_KEY constant and clean up preci…
Copilot Mar 30, 2026
3649804
scheduling: track unmet targets per sensor with positive kWh deltas
Copilot Mar 30, 2026
4932e28
scheduling: guard against missing power sensor in _compute_unresolved…
Copilot Mar 30, 2026
02dfd42
scheduling: add resolved_targets and rename delta→unmet in scheduling…
Copilot Mar 31, 2026
68b90f6
scheduling: clarify margin invariant comments and improve SoC docs note
Copilot Mar 31, 2026
640e79e
Merge branch 'main' into copilot/compute-first-unmet-targets
nhoening Apr 9, 2026
94708f4
Merge remote-tracking branch 'origin/main' into copilot/compute-first…
Copilot Apr 14, 2026
2a8ee63
docs: update changelog entry to reflect current scheduling_result for…
Copilot Apr 14, 2026
7e4d42e
Merge remote-tracking branch 'origin/main' into copilot/compute-first…
Flix6x Apr 14, 2026
fd02289
AGENTS.md: learned to verify merge status with git log --left-right b…
Flix6x Apr 14, 2026
540bf14
Merge branch 'main' into copilot/compute-first-unmet-targets
nhoening Apr 24, 2026
e149ff6
api: create jobs endpoint for scheduling result details
Copilot Jun 23, 2026
b587ef1
Merge origin/main into copilot/compute-first-unmet-targets
Copilot Jun 23, 2026
43bb272
api/jobs: add asset-keyed transformation for scheduling results
Copilot Jun 23, 2026
29acf5b
Merge origin/main and implement asset-keyed scheduling results
Copilot Jun 23, 2026
14ac480
api/jobs: rename JobResultAPI to JobAPI for consistency
Copilot Jun 23, 2026
9ac03e1
AGENTS.md: document merge and implementation session details
Copilot Jun 23, 2026
da168ee
api/v3_0/sensors: remove scheduling_result from get_schedule endpoint
Copilot Jun 24, 2026
77ecab6
docs: remove scheduling_result from scheduling.rst
Copilot Jun 24, 2026
3a9867c
docs: update changelog to reflect scheduling_result removal
Copilot Jun 24, 2026
d51a938
api/v3_0/jobs: fix import path for job_status_description
Copilot Jun 24, 2026
885bb01
api/scheduling: rename key names to unresolved/resolved (listings) an…
Copilot Jun 30, 2026
53cc585
docs/changelog: move constraint analysis entry to v1.0.0, fix version…
Copilot Jun 30, 2026
a949e89
docs: fix scheduling.rst field-name errors and add API changelog v3.0…
Copilot Jun 30, 2026
94a3446
planning/storage: key unresolved targets by asset id instead of soc s…
Copilot Jun 30, 2026
eeef70f
docs(scheduling_result): describe unresolved/resolved as keyed by ass…
Copilot Jun 30, 2026
1e02517
storage: restore main-branch fixes for soc_min/soc_max None handling …
Copilot Jun 30, 2026
86dbe58
tests/planning: update unresolved/resolved assertions to asset ID keys
Copilot Jun 30, 2026
4e2d619
tests/planning: update unresolved/resolved assertions to asset ID keys
Copilot Jun 30, 2026
e86ae34
Fix constraint analysis field names in API and documentation
Copilot Jul 1, 2026
db802c3
api/jobs: fix asset-keyed constraint analysis transform
Copilot Jul 1, 2026
78870d3
feat: restore missing StorageScheduler.compute() consumption/producti…
Copilot Jul 1, 2026
a6093b1
agents/api-backward-compatibility-specialist: learned data format mis…
Copilot Jul 1, 2026
23dbe66
docs(scheduling_result): consolidate docstrings and clarify asset-key…
Copilot Jul 1, 2026
5adf8b7
api/jobs: clarify scheduling_result response format and backward comp…
Copilot Jul 1, 2026
225134b
docs: apply PR #2072 documentation review suggestions
Copilot Jul 1, 2026
8ed93fd
storage: clarify constraint analysis docstring - asset keying and sat…
Copilot Jul 1, 2026
f4985de
agents/test-specialist: learned data format transformation testing pa…
Copilot Jul 1, 2026
56d8ce0
agents/documentation-developer-experience-specialist: learned cross-d…
Copilot Jul 1, 2026
6d76660
agents/architecture-domain-specialist: learned asset-keying patterns …
Copilot Jul 1, 2026
6c942e2
AGENTS.md: learned self-improvement enforcement from PR #2072 review …
Copilot Jul 1, 2026
a958842
docs: clarify transformation rationale and fix constraint grammar
Copilot Jul 1, 2026
70adad8
agents/test-specialist: strengthen type checking in transformation te…
Copilot Jul 1, 2026
8345b01
api: clarify endpoint backward compatibility and constraint reporting…
Copilot Jul 1, 2026
27d12a2
refactor: follow up on prevention advice with a new instruction file;…
Flix6x Jul 1, 2026
17a1a72
docs: merge and simplify SchedulingJobResult docstrings
Flix6x Jul 1, 2026
5d3f884
style: format docstrings
Flix6x Jul 1, 2026
41728a6
feat: add docstring instruction regarding line breaks
Flix6x Jul 1, 2026
26db76e
style: in docstrings, use :returns: instead of :return:
Flix6x Jul 1, 2026
7ac94d2
Changes before error encountered
Copilot Jul 1, 2026
a70f16f
docs: remove irrelevant sensor key from example
Flix6x Jul 1, 2026
57c2f36
feat: claude agents reusing copilot instructions
Flix6x Jul 1, 2026
6f72d3a
tests/planning: update unresolved/resolved test assertions to list fo…
Flix6x Jul 1, 2026
ea788e8
api/v3_0/jobs: restore main's job-status endpoint, graft on schedulin…
Flix6x Jul 1, 2026
379558d
data/models/planning: restore main's storage scheduler, graft on unre…
Flix6x Jul 1, 2026
70c2976
Merge remote-tracking branch 'origin/main' into copilot/compute-first…
Flix6x Jul 1, 2026
08e844e
AGENTS.md: remove redundant self-referential lessons-learned entry
Flix6x Jul 1, 2026
47506f6
style: in docstrings, use :returns: instead of :return:
Flix6x Jul 1, 2026
b840526
style: format docstrings
Flix6x Jul 1, 2026
1117023
docs(api): document soc-minima/soc-maxima as lists in jobs endpoint
Flix6x Jul 1, 2026
540d58e
docs(scheduling): describe soc-minima/soc-maxima results as lists
Flix6x Jul 1, 2026
c4e6167
tests/planning: update unresolved-target assertions for list-wrapped …
Flix6x Jul 1, 2026
0684c6d
tests/planning: cover the all=True/False flag of _compute_unresolved_…
Flix6x Jul 1, 2026
9412dd8
data/models/planning: add all=True/False to _compute_unresolved_targets
Flix6x Jul 1, 2026
f15234d
data/models/planning: rename all to most_relevant_only, default False
Flix6x Jul 1, 2026
23d2a64
tests/planning: rename all to most_relevant_only, default False
Flix6x Jul 1, 2026
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
21 changes: 21 additions & 0 deletions .claude/agents/api-backward-compatibility-specialist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: api-backward-compatibility-specialist
description: Protects users and integrators by ensuring API changes are backwards compatible, properly versioned, and well-documented
---

# Agent: API & Backward Compatibility Specialist

This is a thin Claude Code pointer file. Agent logic is maintained once, for both Claude Code
and GitHub Copilot, in the `.github` folder:

- **`.github/agents/api-backward-compatibility-specialist.md`** — the full agent definition: role, scope, review checklist,
domain knowledge, interaction rules, and self-improvement notes. Read this file in full before
acting as this agent. When agent behavior needs to change, edit that file, not this one.
- **`.github/instructions/`** — project-wide conventions shared by every agent (atomic commits,
changelog entries, docstrings, error handling, Marshmallow schemas, pre-commit hooks, testing,
timezone awareness, UI terminology).
- **`.github/workflows/copilot-setup-steps.yml`** — the reference environment setup (system
packages, Python/uv setup, database, environment variables) used for GitHub Copilot's cloud
agents. Claude Code agents run in their own sandboxed environment, not this one, so treat this
file as a reference for expected dependencies and services rather than a script to execute
verbatim.
21 changes: 21 additions & 0 deletions .claude/agents/architecture-domain-specialist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: architecture-domain-specialist
description: Guards domain model, invariants, and architecture to maintain model clarity and prevent erosion of core principles
---

# Agent: Architecture & Domain Specialist

This is a thin Claude Code pointer file. Agent logic is maintained once, for both Claude Code
and GitHub Copilot, in the `.github` folder:

- **`.github/agents/architecture-domain-specialist.md`** — the full agent definition: role, scope, review checklist,
domain knowledge, interaction rules, and self-improvement notes. Read this file in full before
acting as this agent. When agent behavior needs to change, edit that file, not this one.
- **`.github/instructions/`** — project-wide conventions shared by every agent (atomic commits,
changelog entries, docstrings, error handling, Marshmallow schemas, pre-commit hooks, testing,
timezone awareness, UI terminology).
- **`.github/workflows/copilot-setup-steps.yml`** — the reference environment setup (system
packages, Python/uv setup, database, environment variables) used for GitHub Copilot's cloud
agents. Claude Code agents run in their own sandboxed environment, not this one, so treat this
file as a reference for expected dependencies and services rather than a script to execute
verbatim.
21 changes: 21 additions & 0 deletions .claude/agents/coordinator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: coordinator
description: Meta-agent that manages agent lifecycle, enforces structural standards, and maintains coherence across the agent system
---

# Agent: Coordinator

This is a thin Claude Code pointer file. Agent logic is maintained once, for both Claude Code
and GitHub Copilot, in the `.github` folder:

- **`.github/agents/coordinator.md`** — the full agent definition: role, scope, review checklist,
domain knowledge, interaction rules, and self-improvement notes. Read this file in full before
acting as this agent. When agent behavior needs to change, edit that file, not this one.
- **`.github/instructions/`** — project-wide conventions shared by every agent (atomic commits,
changelog entries, docstrings, error handling, Marshmallow schemas, pre-commit hooks, testing,
timezone awareness, UI terminology).
- **`.github/workflows/copilot-setup-steps.yml`** — the reference environment setup (system
packages, Python/uv setup, database, environment variables) used for GitHub Copilot's cloud
agents. Claude Code agents run in their own sandboxed environment, not this one, so treat this
file as a reference for expected dependencies and services rather than a script to execute
verbatim.
21 changes: 21 additions & 0 deletions .claude/agents/data-time-semantics-specialist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: data-time-semantics-specialist
description: Prevents subtle bugs in time handling, units, and data semantics with focus on timezone-aware operations and unit conversions
---

# Agent: Data & Time Semantics Specialist

This is a thin Claude Code pointer file. Agent logic is maintained once, for both Claude Code
and GitHub Copilot, in the `.github` folder:

- **`.github/agents/data-time-semantics-specialist.md`** — the full agent definition: role, scope, review checklist,
domain knowledge, interaction rules, and self-improvement notes. Read this file in full before
acting as this agent. When agent behavior needs to change, edit that file, not this one.
- **`.github/instructions/`** — project-wide conventions shared by every agent (atomic commits,
changelog entries, docstrings, error handling, Marshmallow schemas, pre-commit hooks, testing,
timezone awareness, UI terminology).
- **`.github/workflows/copilot-setup-steps.yml`** — the reference environment setup (system
packages, Python/uv setup, database, environment variables) used for GitHub Copilot's cloud
agents. Claude Code agents run in their own sandboxed environment, not this one, so treat this
file as a reference for expected dependencies and services rather than a script to execute
verbatim.
21 changes: 21 additions & 0 deletions .claude/agents/documentation-developer-experience-specialist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: documentation-developer-experience-specialist
description: Ensures excellent documentation, clear error messages, and smooth developer workflows to keep FlexMeasures accessible
---

# Agent: Documentation & Developer Experience Specialist

This is a thin Claude Code pointer file. Agent logic is maintained once, for both Claude Code
and GitHub Copilot, in the `.github` folder:

- **`.github/agents/documentation-developer-experience-specialist.md`** — the full agent definition: role, scope, review checklist,
domain knowledge, interaction rules, and self-improvement notes. Read this file in full before
acting as this agent. When agent behavior needs to change, edit that file, not this one.
- **`.github/instructions/`** — project-wide conventions shared by every agent (atomic commits,
changelog entries, docstrings, error handling, Marshmallow schemas, pre-commit hooks, testing,
timezone awareness, UI terminology).
- **`.github/workflows/copilot-setup-steps.yml`** — the reference environment setup (system
packages, Python/uv setup, database, environment variables) used for GitHub Copilot's cloud
agents. Claude Code agents run in their own sandboxed environment, not this one, so treat this
file as a reference for expected dependencies and services rather than a script to execute
verbatim.
21 changes: 21 additions & 0 deletions .claude/agents/performance-scalability-specialist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: performance-scalability-specialist
description: Identifies performance bottlenecks, inefficient algorithms, and scalability issues to keep FlexMeasures fast under load
---

# Agent: Performance & Scalability Specialist

This is a thin Claude Code pointer file. Agent logic is maintained once, for both Claude Code
and GitHub Copilot, in the `.github` folder:

- **`.github/agents/performance-scalability-specialist.md`** — the full agent definition: role, scope, review checklist,
domain knowledge, interaction rules, and self-improvement notes. Read this file in full before
acting as this agent. When agent behavior needs to change, edit that file, not this one.
- **`.github/instructions/`** — project-wide conventions shared by every agent (atomic commits,
changelog entries, docstrings, error handling, Marshmallow schemas, pre-commit hooks, testing,
timezone awareness, UI terminology).
- **`.github/workflows/copilot-setup-steps.yml`** — the reference environment setup (system
packages, Python/uv setup, database, environment variables) used for GitHub Copilot's cloud
agents. Claude Code agents run in their own sandboxed environment, not this one, so treat this
file as a reference for expected dependencies and services rather than a script to execute
verbatim.
21 changes: 21 additions & 0 deletions .claude/agents/test-specialist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: test-specialist
description: Focuses on test coverage, quality, and testing best practices without modifying production code
---

# Agent: Test Specialist

This is a thin Claude Code pointer file. Agent logic is maintained once, for both Claude Code
and GitHub Copilot, in the `.github` folder:

- **`.github/agents/test-specialist.md`** — the full agent definition: role, scope, review checklist,
domain knowledge, interaction rules, and self-improvement notes. Read this file in full before
acting as this agent. When agent behavior needs to change, edit that file, not this one.
- **`.github/instructions/`** — project-wide conventions shared by every agent (atomic commits,
changelog entries, docstrings, error handling, Marshmallow schemas, pre-commit hooks, testing,
timezone awareness, UI terminology).
- **`.github/workflows/copilot-setup-steps.yml`** — the reference environment setup (system
packages, Python/uv setup, database, environment variables) used for GitHub Copilot's cloud
agents. Claude Code agents run in their own sandboxed environment, not this one, so treat this
file as a reference for expected dependencies and services rather than a script to execute
verbatim.
21 changes: 21 additions & 0 deletions .claude/agents/tooling-ci-specialist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: tooling-ci-specialist
description: Reviews GitHub Actions workflows, pre-commit hooks, and CI/CD pipelines to ensure automation reliability
---

# Agent: Tooling & CI Specialist

This is a thin Claude Code pointer file. Agent logic is maintained once, for both Claude Code
and GitHub Copilot, in the `.github` folder:

- **`.github/agents/tooling-ci-specialist.md`** — the full agent definition: role, scope, review checklist,
domain knowledge, interaction rules, and self-improvement notes. Read this file in full before
acting as this agent. When agent behavior needs to change, edit that file, not this one.
- **`.github/instructions/`** — project-wide conventions shared by every agent (atomic commits,
changelog entries, docstrings, error handling, Marshmallow schemas, pre-commit hooks, testing,
timezone awareness, UI terminology).
- **`.github/workflows/copilot-setup-steps.yml`** — the reference environment setup (system
packages, Python/uv setup, database, environment variables) used for GitHub Copilot's cloud
agents. Claude Code agents run in their own sandboxed environment, not this one, so treat this
file as a reference for expected dependencies and services rather than a script to execute
verbatim.
21 changes: 21 additions & 0 deletions .claude/agents/ui-specialist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: ui-specialist
description: Guards UI consistency, permission patterns, JavaScript interaction patterns, and template quality in the FlexMeasures web interface
---

# Agent: UI Specialist

This is a thin Claude Code pointer file. Agent logic is maintained once, for both Claude Code
and GitHub Copilot, in the `.github` folder:

- **`.github/agents/ui-specialist.md`** — the full agent definition: role, scope, review checklist,
domain knowledge, interaction rules, and self-improvement notes. Read this file in full before
acting as this agent. When agent behavior needs to change, edit that file, not this one.
- **`.github/instructions/`** — project-wide conventions shared by every agent (atomic commits,
changelog entries, docstrings, error handling, Marshmallow schemas, pre-commit hooks, testing,
timezone awareness, UI terminology).
- **`.github/workflows/copilot-setup-steps.yml`** — the reference environment setup (system
packages, Python/uv setup, database, environment variables) used for GitHub Copilot's cloud
agents. Claude Code agents run in their own sandboxed environment, not this one, so treat this
file as a reference for expected dependencies and services rather than a script to execute
verbatim.
59 changes: 59 additions & 0 deletions .github/agents/api-backward-compatibility-specialist.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,65 @@ value = params.get("sensor_to_save")
- **Architecture Specialist**: Enforces "schema as source of truth" invariant
- **API Specialist**: Verifies API documentation matches format

#### Data Format Mismatch Pattern

**Problem** (PR #2072 - Constraint Analysis):

Data transformations between API layers can silently use incompatible key types:
- Layer 1 produces asset-keyed results
- Layer 2 expects sensor-keyed results
- No schema validation catches the mismatch
- Silent data corruption in API response

**Manifestation**:
```python
# Layer 1: Produces asset_id keyed dict
results = {asset_id: [values]} # ✅ Correct

# Layer 2: Function assumes sensor_id keys
def _sensor_keyed_to_asset_keyed(sensor_keyed_results): # ❌ Misleading name
# Actually receives asset-keyed data
# Treats asset_ids as sensor_ids
# Returns corrupted mapping
```

**Prevention Checklist**:

1. **Function naming must indicate format**: Use clear names like `_asset_keyed_to_list()` not `_transform_results()`
2. **Marshmallow schemas for transforms**: Add explicit response schemas, don't rely on inline OpenAPI:
```python
class ConstraintAnalysisResponseSchema(Schema):
"""Validates end-to-end data format"""
asset_id = fields.Int(required=True)
data = fields.Nested(ConstraintDataSchema, many=True)
```
3. **Integration tests verify data flow**: Test that end-to-end transformations preserve data semantics:
```python
def test_constraint_analysis_returns_asset_keyed_results():
result = constraint_analysis_transform(asset_data)
assert all(isinstance(k, int) for k in result.keys()), "Keys must be asset IDs"
# NOT just: assert result is not None
```
4. **Document key types in docstrings**: Be explicit about what each layer expects/produces:
```python
def analyze_constraints(data):
"""Transform constraint results.

Args:
data: asset_id -> constraint_list mapping

Returns:
dict: asset_id -> formatted_constraints mapping (keys are asset IDs, not sensor IDs)
"""
```

**Why This Matters for Backward Compatibility**:
- Silent data corruption breaks client contracts subtly
- Clients may succeed but get wrong data
- Testing may pass with mismatched formats if tests don't validate keys
- Makes it hard to reason about what the API actually returns
- Requires coordination with clients to fix (breaking change)

### CLI Command Changes

- [ ] **Argument changes**: Adding required args breaks scripts
Expand Down
Loading
Loading