Planned Effort
3 story points — sprint item #4 (Medium): Remove/deprecate export_count legacy alias on GET /api/export/state
One issue → one PR. the-claw benchmarks are a separate issue/PR (Thursday sprint #7).
Depends on
| Prerequisite |
Why |
| Monday PR merged (#3, #5, #6) |
CHANGELOG.md, docs/deprecation-policy.md, docs/api-reference.md |
| Tuesday + Wednesday merged or rebased |
Green CI (Ubuntu + Windows) on base branch |
Problem
GET /api/export/state returns duplicate counters: last_export_session_count (canonical) and export_count (legacy alias). Monday documented the alias as deprecated; the bundled SPA still falls back to export_count in static/js/projects.js, which keeps the duplicate field on the wire indefinitely.
Goal
Complete the migration started Monday: one canonical field in JSON, SPA and tests updated, user-visible change recorded under [Unreleased] in CHANGELOG.md.
Recommended approach (atomic bundled deploy)
Because the SPA ships in the same repo as the API, this single PR should:
- Update
static/js/projects.js to read only last_export_session_count.
- Remove
export_count from api/export_api.py response body.
- Update tests that assert
export_count.
- Update
docs/api-reference.md (remove alias row and example JSON key).
- Add
CHANGELOG.md entry under ### Removed (stay in [Unreleased] until v0.1.0 tag — path B).
Policy note: docs/deprecation-policy.md requires two tagged releases for fields external integrators rely on. The bundled SPA is updated in the same merge, so removal is acceptable for this internal contract. If review asks to keep the alias on the wire longer, use Fallback below.
Fallback (deprecate on wire only)
- Keep
export_count in JSON; mark deprecated in api-reference.
- SPA uses only
last_export_session_count.
- CHANGELOG
### Deprecated with planned removal (e.g. 0.2.0).
- Tests assert canonical field; optionally assert deprecated alias still present.
Scope — files
| File |
Change |
api/export_api.py |
Remove "export_count": n from get_export_state() |
static/js/projects.js |
Drop ?? exportState.export_count fallback |
docs/api-reference.md |
Remove export_count from field table + example JSON |
tests/test_api_routes.py |
Assert last_export_session_count; remove export_count requirement |
tests/test_export_api_bulk.py |
Same |
CHANGELOG.md |
### Removed (or ### Deprecated if fallback) |
Acceptance Criteria
Planned Effort
3 story points — sprint item #4 (Medium): Remove/deprecate
export_countlegacy alias onGET /api/export/stateOne issue → one PR. the-claw benchmarks are a separate issue/PR (Thursday sprint #7).
Depends on
CHANGELOG.md,docs/deprecation-policy.md,docs/api-reference.mdProblem
GET /api/export/statereturns duplicate counters:last_export_session_count(canonical) andexport_count(legacy alias). Monday documented the alias as deprecated; the bundled SPA still falls back toexport_countinstatic/js/projects.js, which keeps the duplicate field on the wire indefinitely.Goal
Complete the migration started Monday: one canonical field in JSON, SPA and tests updated, user-visible change recorded under
[Unreleased]inCHANGELOG.md.Recommended approach (atomic bundled deploy)
Because the SPA ships in the same repo as the API, this single PR should:
static/js/projects.jsto read onlylast_export_session_count.export_countfromapi/export_api.pyresponse body.export_count.docs/api-reference.md(remove alias row and example JSON key).CHANGELOG.mdentry under### Removed(stay in[Unreleased]untilv0.1.0tag — path B).Policy note:
docs/deprecation-policy.mdrequires two tagged releases for fields external integrators rely on. The bundled SPA is updated in the same merge, so removal is acceptable for this internal contract. If review asks to keep the alias on the wire longer, use Fallback below.Fallback (deprecate on wire only)
export_countin JSON; markdeprecatedin api-reference.last_export_session_count.### Deprecatedwith planned removal (e.g.0.2.0).Scope — files
api/export_api.py"export_count": nfromget_export_state()static/js/projects.js?? exportState.export_countfallbackdocs/api-reference.mdexport_countfrom field table + example JSONtests/test_api_routes.pylast_export_session_count; removeexport_countrequirementtests/test_export_api_bulk.pyCHANGELOG.md### Removed(or### Deprecatedif fallback)Acceptance Criteria
export_countCHANGELOG.mdentry under[Unreleased]docs/api-reference.mdmatches actual response shapepytest -qandnpm testgreen on PR (Ubuntu + Windows if matrix merged)