Skip to content

ssljson (29th linter) graph-integrity gap: logic-step scene_id is parsed but never validated — orphan steps pass silently #39493

Closed as not planned

Description

@github-actions

Summary

ssljson (pkg/linters/ssljson/ssljson.go) validates .github/skills/*/ssl.json against the SSL Pass-4 enum and graph rules. The SSLStep struct decodes a scene_id field (ssljson.go:61, JSON tag "scene_id"), and every one of the 19 logic steps across the 4 production ssl.json files populates it (reporting, jqschema, error-messages, ssl). Yet ValidateDoc (ssljson.go:93-149) never references step.SceneID — so a logic step that names a non-existent scene (a typo, or a step orphaned after a scene rename) is accepted silently.

Every other cross-reference in the document IS validated: entry_scene→scenes (Rule 1), entry_logic_step→steps (Rule 3), next_scene_rules.target→scenes (Rule 4), step.next→steps (Rule 7). The step→scene back-reference is the only declared relationship left unchecked. The field is parsed-but-dead in validation.

The intent is the linter's own embedded spec

This is not an inferred requirement. The repo's own .github/skills/ssl/ssl.json:150 defines what Pass-4 validation must do, in the step_verify_validate step description:

"Run all Pass-4 validation rules against $draft_ssl: JSON syntax, required fields, enum membership, unique IDs, entry pointers, transition targets, graph integrity"

A logic step pointing at a scene that does not exist is precisely a graph-integrity violation. The analyzer's Doc string also advertises "graph rules" (ssljson.go:24). The implementation is narrower than its own declared spec.

Root cause

ValidateDoc builds sceneIDs (ssljson.go:96-99) but only consults it for entry_scene and transition targets. The per-step loop (ssljson.go:130-146) checks action_type, resource_scope, and next, but has no rule resolving step.SceneID against sceneIDs.

Evidence — production reliance

All 4 prod files bind each step to a scene, e.g. .github/skills/ssl/ssl.json:86-93:

{
  "id": "step_prepare_read",
  "scene_id": "scene_prepare",
  "action_type": "READ",
  "resource_scope": "LOCAL_FS",
  "next": "step_prepare_parse"
}

Change "scene_prepare" to "scene_prepar" and the document still passes ValidateDoc with zero diagnostics, even though the step is now orphaned from the scene graph. scene_id occurs 19 times across the 4 files — the field is load-bearing in production yet entirely unvalidated.

Recommendation

Add a Rule 8 to the per-step loop: when step.SceneID is non-empty and not present in sceneIDs, report logic step %q scene_id %q not found in scenes. (Mirror the existing entry_logic_step check shape at ssljson.go:116-118.) Consider also flagging an empty scene_id, since every prod step sets one and an unassigned step has no place in the graph — confirm against the spec's "required fields" rule before enforcing the empty case.

Validation checklist
  • Add a want testdata / ValidateDoc case: a step whose scene_id references no scene IS flagged.
  • Keep TestValidateDoc_Valid green (its single step's scene_id is empty today — set it to the scene's id, or decide empty is allowed).
  • Confirm all 4 production ssl.json files still validate clean after the rule is added (they should — every scene_id resolves).
  • go test ./pkg/linters/ssljson/... passes.

Effort: small — one new rule in the existing per-step loop plus one testdata case. Detection is pure map lookup against the already-built sceneIDs.

Generated by 🤖 Sergo - Serena Go Expert · 284.3 AIC · ⌖ 13.8 AIC · ⊞ 5.3K · ◷

  • expires on Jun 22, 2026, 9:39 PM UTC-08:00

Activity

  1. added
    cookie
    on Jun 16, 2026
  2. Copilot commented on Jun 16, 2026

    Copilot
    Contributor

    The agent encountered an error and was unable to start working on this issue: Please try again later, or contact support if the problem persists. (Request id: 0F40:2216D7:3265387:BC59C3C:6A312CC2)

  3. github-actions commented on Jun 16, 2026

    @github-actions
    ContributorAuthor

    🍪 Issue Monster selected this for Copilot

    I've identified this issue as a good candidate for automated resolution and requested assignment to the Copilot coding agent.

    If assignment succeeds, the Copilot coding agent will analyze the issue and create a pull request with the fix.

    Om nom nom! 🍪

    🍪 Om nom nom by Issue Monster · 27.3 AIC · ⌖ 14.3 AIC · ⊞ 23.7K · ◷

  4. github-actions commented on Jun 23, 2026

    @github-actions
    ContributorAuthor

    This issue was automatically closed because it expired on 2026-06-23T05:39:54.490Z.

    Closed by Workflow

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

Metadata

Metadata

Labels

cookiesergo

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions