Phase 6: simplify-pass policy, plugins listing, roadmap to 1.0
End-of-pipeline cleanup. No structural changes; documents what is done, what is left, and the discipline for future cleanup commits. Skill: - simplifying-python: end-of-session cleanup discipline. Inspired by Anthropic's open-sourced code-simplifier. Targets duplication, dead code, voodoo constants, stale comments, misnamed identifiers, unnecessary abstraction. Anti-targets: architecture, public API surface, schema, sweeping rewrites. Behavior preservation enforced by running pytest before and after. Simplify pass on shopdb/utils/responses.py: - error_response docstring claimed the error info lives at top level `error`. Implementation puts it under `data.error` (consistent with the success envelope). Implementation is correct; docstring updated. - paginated_response docstring used snake_case keys (`per_page`, `total_pages`, etc). Implementation uses lowercase concatenated per CONTRIBUTING.md. Docstring updated to match. Documentation: - docs/PLUGINS.md: bundled plugins (six, with what they track and caveats per ADR), planned plugins (measuringtools as the scaffold canary per ADR-005), distribution conventions for sister-site plugins per ADR-003, naming policy. - docs/ROADMAP.md: phase status table (0-5 done, 6 in progress), must-have work for 1.0 (Asset.mapx/mapy, equipment migration, printers retirement, frontend hook contract, per-plugin Alembic chains), nice-to-have (measuringtools plugin, frontend scaffolding, marketplace listing, surface-diff tooling), deferred (multi-tenancy, pip-installable plugins, event bus). Defines what 1.0.0 means as a contract. Test count unchanged: 101 passing. Naming/style check green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -80,16 +80,21 @@ def error_response(
|
||||
details: Dict = None,
|
||||
http_code: int = 400
|
||||
):
|
||||
"""
|
||||
Error response helper.
|
||||
"""Error response helper.
|
||||
|
||||
Response format:
|
||||
{
|
||||
"status": "error",
|
||||
"error": {
|
||||
"code": "VALIDATION_ERROR",
|
||||
"message": "Human-readable message",
|
||||
"details": {...}
|
||||
"data": {
|
||||
"error": {
|
||||
"code": "VALIDATION_ERROR",
|
||||
"message": "Human-readable message",
|
||||
"details": {...}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"timestamp": "...",
|
||||
"requestid": "..."
|
||||
}
|
||||
}
|
||||
"""
|
||||
@@ -132,8 +137,7 @@ def paginated_response(
|
||||
total: int,
|
||||
schema=None
|
||||
):
|
||||
"""
|
||||
Paginated list response.
|
||||
"""Paginated list response.
|
||||
|
||||
Response format:
|
||||
{
|
||||
@@ -142,11 +146,11 @@ def paginated_response(
|
||||
"meta": {
|
||||
"pagination": {
|
||||
"page": 1,
|
||||
"per_page": 20,
|
||||
"perpage": 20,
|
||||
"total": 150,
|
||||
"total_pages": 8,
|
||||
"has_next": true,
|
||||
"has_prev": false
|
||||
"totalpages": 8,
|
||||
"hasnext": true,
|
||||
"hasprev": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user