Skip to content

_STYLE_DIMENSIONS_PATH points to a directory that doesn't exist — repair logic is dead #107

Description

@boogeyman-yf

What I Found

skills/sn-ppt-standard/scripts/run_stage.py:131 constructs the path that gates the style triple repair logic:

_STYLE_DIMENSIONS_PATH = SKILL_DIR.parent.parent / "reference" / "style_dimensions.json"

Resolving the parents:

  • SKILL_DIR = skills/sn-ppt-standard (from line 44).
  • SKILL_DIR.parent = skills.
  • SKILL_DIR.parent.parent = repository root.

So the expected file is <repo>/reference/style_dimensions.json. But there is no reference/ directory at repo root, and no style_dimensions.json anywhere in the repo. The directory that exists is skills/sn-ppt-standard/references/ (plural, scoped to the skill) — and even that directory does not contain a style_dimensions.json (only html_constraints.md and style_catalog.md).

Why This Matters

_load_style_dimensions() is designed to fail-open:

def _load_style_dimensions() -> dict | None:
    if not _STYLE_DIMENSIONS_PATH.exists():
        return None
    ...

It returns None, and cmd_style at run_stage.py:325 skips the entire _repair_style_triple pass:

dims = _load_style_dimensions()
if dims is not None:
    data, repair_notes = _repair_style_triple(data, dims)

_repair_style_triple validates the (design_style, color_tone, primary_color) triple against a curated catalog and auto-corrects incompatible picks — a non-trivial 100+ line function (lines 145-240). Because the file doesn't exist, that whole code path is never exercised in this repo. The downstream style_spec.json keeps whatever the LLM chose, even when the triple is incoherent (e.g., a color tone that the design style declares incompatible).

The docstring at line 134-136 hints this is intentional ("Returns None if the file is missing — e.g., external distributions that ship only the pre-rendered catalog.md"), but that explanation doesn't fit: this is the source distribution, and the file is missing here too.

Suggested Next Steps

Two possible resolutions:

  1. The file was supposed to be checked in. Add style_dimensions.json to the repo (probably under skills/sn-ppt-standard/references/ to match the singular-vs-plural convention used elsewhere) and fix the path:

    _STYLE_DIMENSIONS_PATH = SKILL_DIR / "references" / "style_dimensions.json"
  2. The validator was supposed to be removed. Delete _repair_style_triple and the conditional around it; the catalog markdown at references/style_catalog.md already constrains the LLM via prompt.

Either is fine, but the current state — 100 lines of unreachable repair code plus a misleading path — is a maintenance hazard.

References

  • skills/sn-ppt-standard/scripts/run_stage.py:131,134,323-328
  • skills/sn-ppt-standard/references/ (the directory that does exist)
  • The repair logic body: skills/sn-ppt-standard/scripts/run_stage.py:145-240

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions