Skip to content

Analyze persistent Workshop object lifecycle and fan-out #262

Description

@Teakowa

Goal

Make Wright surface persistent Workshop object lifetime and fan-out risks as structured analysis so creators can identify visual/object allocations that can accumulate, multiply across players, or lack an evident cleanup path.

Context

Wright already has a small evidence-classified stability rule set for loops, repeated evaluation, and expensive predicates, but it does not currently model persistent Workshop objects such as HUD text, in-world text, or effects as resources with creation scope, visibility/fan-out, and cleanup responsibilities.

This leaves an important Workshop-specific stability class to manual review. Community Workshop guidance repeatedly treats persistent visual objects as a distinct risk because one creation site may multiply by player count, remain live across state transitions, or be recreated without an evident destruction path. The useful product capability is not a universal "too many effects" threshold; it is structured static evidence about what is created, where, how broadly it can fan out, and whether its lifetime is evident.

Scope

  • Analyze canonical Workshop object-creation operations whose products persist until explicitly destroyed or otherwise have a meaningful lifetime contract.
  • Report creation sites with source provenance and the rule/event scope that can create them.
  • Expose statically knowable fan-out dimensions such as global vs per-player execution and broad visibility/target sets where canonical WIR makes them identifiable.
  • Distinguish exact structural facts from heuristic lifecycle risks.
  • Identify only defensible missing-lifetime cases, such as an object whose created identity is not evidently retained or whose relevant scope has no observable cleanup path; ambiguous aliasing/data-flow cases must remain explicit limitations rather than correctness claims.
  • Keep findings useful for both raw Workshop and provider-backed source languages through Wright's canonical Workshop analysis boundary.
  • Validate the feature against representative real-project object-lifecycle patterns in addition to focused positive/negative fixtures.

Non-goals

  • Defining a universal safe number of HUD texts, effects, or other objects.
  • Claiming precise runtime/server load from static object counts.
  • Treating every globally visible or per-player object as a defect.
  • Requiring full interprocedural lifetime proof before providing useful structural evidence.
  • Automatically rewriting object creation, visibility, or cleanup code.
  • Moving Workshop object semantics into Wright; canonical identities and lifetime facts remain owned by workshop-rs.
  • Adding source-language-specific OPY/DEL lifecycle logic.

Acceptance criteria

  • Wright can report supported persistent-object creation sites with stable machine-readable identity, source provenance, and event/execution scope.
  • The analysis exposes statically knowable fan-out information without presenting heuristic multiplicity as measured runtime load.
  • At least one stable finding/metric covers an evidenced lifecycle risk that the current rule set cannot detect, with explicit evidence classification and known limitations.
  • Safe examples with an evident bounded lifetime/cleanup path are distinguishishable from corresponding risky examples.
  • Per-player and broad-visibility cases are represented without assuming a fixed server population unless that population is part of explicit input/project evidence.
  • Each shipped lint finding has a stable Rule ID, rationale, limitations, and positive/negative fixtures; purely descriptive metrics need not be promoted to lint findings.
  • Representative real-project evidence demonstrates that the result is useful beyond synthetic fixtures.
  • Raw Workshop analysis remains regression-green, and provider-backed consumers can reuse the same canonical analysis without duplicating source-language semantics.
  • Independent implementation ablation removes the new lifecycle/fan-out logic and causes its dedicated regression evidence to fail again.

Dependencies / ownership

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions