Skip to content

[Story] Simplify and de-duplicate the TypeScript analysis pipeline, export and settings code #35

Done

Description

@aMonteSl

As a developer extending the analysis pipeline,
I want the most complex TypeScript functions broken into named, tested steps and the copy-pasted helpers merged,
so that a change is made in one place and can be understood without reading 300-line functions.

Scope (ROADMAP W4-T, T01–T55, each with its behavioural net first)

  • executePython.ts: recovery branch that cannot recover, recoverXRResult, spawnAndCollect discriminated union, finishAnalysis, typed analysis result (T01–T06).
  • XR parsers: copy steps and guard list as data (T07–T09).
  • Export: buildExportManifest (CCN 61) and runGitRevisionExport in phases, failure classification table, validateExportPackage (T19–T28, T34, T35).
  • Analysis bridge and historical: hoisted sets, defaults table, shared broadcast helper (T29–T33).
  • Active analyses, validator, URI resolver, reanalyzer, refresh, dependencies (T10–T18).
  • Types and names: 14 de-exported type-only symbols, colliding VisualizationSettings, canonical ChartType/AnalysisMode (T36, T41–T43).
  • Duplicates: profile block, launcher closures, settings accessors, chart-type command factory, asset helpers, LAN URL, active-servers guards, getServerConfig, avatar ids derived from one table (T37–T53).
  • Explicit void for floating promises, by module (T56–T59).

Acceptance criteria

  • Every refactor has a characterization test landed in a previous commit, green against the unchanged code.
  • Worst TS CCN 61 → ≤ 25; functions with CCN > 30 → 0; floating promises → 0.
  • npm test (+ test:analysis when parsers/export/executePython are touched) green after each commit; ratchet updated.
  • No user-visible change (T54, the output-channel leak fix, stays for 1.3.0 as decided).

Activity

  1. self-assigned this
    on Nov 25, 2026
  2. added
    tfm
    user-story
    on Nov 25, 2026
  3. aMonteSl commented on Nov 25, 2026

    @aMonteSl
    CollaboratorAuthor

    Part B (T29–T33, T36–T59) is merged in #61. CI is green on Linux, macOS and Windows.

    • Floating promises: 284 → 0, and no-floating-promises is now an error.
    • ESLint warning budget: 553 → 261.

    Part A (T01–T28, T34, T35) is still in progress. This story closes when it lands.


    Generated by Claude Code

  4. added a commit that references this issue on Nov 25, 2026
  5. aMonteSl commented on Nov 25, 2026

    @aMonteSl
    CollaboratorAuthor

    Done. Part A merged via #63 and part B via #61, both into v1.2.1 with CI green on Linux, Windows and macOS.

    Acceptance, measured on the merged tree:

    • worst TypeScript function CCN 20 (target ≤ 25); functions over CCN 30: 0 (was 3);
    • complexity over10/15/20/30: 69/25/6/3 → 54/9/0/0;
    • floating promises: 0, now a lint error;
    • ESLint warning budget 553 → 204; functions over 80 lines 45 → 36; any 166 → 130;
    • npm test 1053/1053 and test:analysis passing.

    Every refactor landed after a characterization test that was green against the unchanged code. The behaviour quirks pinned for 1.3.0 and the F5 checklist are in .claude/docs/v1.2.1/sessions/35a-ts-pipeline.md; the F5 checks run in #43.


    Generated by Claude Code

  6. added a commit that references this issue on Nov 25, 2026
  7. added
    area: extension
    stream: cleanup-refactor
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: extensionstream: cleanup-refactortfmuser-story

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions