revert(design-systems): drop the rulebook import — a migration, not a feature
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 9s
CI & Build / integration (push) Successful in 19s
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Python tests (push) Successful in 43s
CI & Build / Build & push image (push) Successful in 44s
CI & Build / Python lint (push) Successful in 3s
CI & Build / Plugin hooks (push) Successful in 9s
CI & Build / integration (push) Successful in 19s
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Python tests (push) Successful in 43s
CI & Build / Build & push image (push) Successful in 44s
Operator's call, and it corrects a scope error rather than a bug: "this is a path for a user to go from a rulebook to a design system. we don't need to build this path in the app itself ... you should be the one that does the import ... going forward no one else should have to do such a migration." Right. Nobody starting from a design system will ever go rulebook -> system, so the whole path was permanent product code serving a single act on one install. Rule #22: remove it, don't flag it off. Gone from the service, the REST route, the MCP tool, the UI panel, the API client and its tests. There is a second consequence I had missed, and it is the better argument. The parser was WORSE at this than doing it by hand. `propose_tokens` leaves radius steps and type sizes valueless because "Small 4px" is not a hex and nothing here parses it — a limitation I documented carefully and shipped anyway. But that limitation only exists because the importer had to run unattended. Done as work rather than as a feature, those values are just read and written, and the result is a complete design system instead of one with a dozen blanks and a count explaining them. Scaffolding built around my own absence from the loop, when I am the loop. KEPT: `extract_expectations` and `design_expectations` in services/design_rulebook_import.py. The live drift panel still reads them until it is repointed at a resolved design system (#2295), and removing them now would take the /design page's only content with it. They go with that change, not this one.
This commit is contained in:
@@ -156,30 +156,6 @@ async def check_snippets_against_system(design_system_id: int):
|
||||
return jsonify(result)
|
||||
|
||||
|
||||
@design_systems_bp.post("/design-systems/<int:design_system_id>/import")
|
||||
@login_required
|
||||
async def import_design_system(design_system_id: int):
|
||||
"""Seed a design system from a rulebook's prose.
|
||||
|
||||
`{"rulebook_id": N}` previews; add `"apply": true` to write. Preview is the
|
||||
default because an import is a PROPOSAL — rulebooks are written
|
||||
aspirationally and some of what they describe was never built.
|
||||
|
||||
Existing token names are never overwritten, so a second run fills gaps and
|
||||
reports the rest rather than undoing corrections.
|
||||
"""
|
||||
data = await request.get_json() or {}
|
||||
rulebook_id = data.get("rulebook_id")
|
||||
if not isinstance(rulebook_id, int) or rulebook_id <= 0:
|
||||
return jsonify({"error": "rulebook_id is required"}), 400
|
||||
report = await ds_svc.import_from_rulebook(
|
||||
_uid(), design_system_id, rulebook_id, apply=bool(data.get("apply")),
|
||||
)
|
||||
if report is None:
|
||||
return _not_found("design system or rulebook")
|
||||
return jsonify(report)
|
||||
|
||||
|
||||
# ── Tokens ──────────────────────────────────────────────────────────────
|
||||
|
||||
@design_systems_bp.get("/design-systems/<int:design_system_id>/tokens")
|
||||
|
||||
Reference in New Issue
Block a user