Skip to content

Add an orphan-code gate and remove ignored MCP parameters and duplicated harness helpers #1017

Closed

Description

@iamgp

This was generated by AI during triage.

Current reconciliation, 5 October 2026

Checked against current main. Owner approved this realignment.

Mark deleted-frontend items resolved; narrow the remaining work.

The nine cited old files are gone and prism-react-renderer is absent. The two TanStack table/virtualisation packages are used by the replacement. Knip is still absent from frontend scripts and CI. McpApiClient.__init__ still accepts ignored tracer_name; harness_utils.py and golden_path_common.py still contain parallel helper implementations. Preserve those independent cleanup tasks, with the standalone-script dependency constraint considered before sharing helpers. Remove this issue as a prerequisite for the new UI accessibility work.

Completed through replacement

Do not delete @tanstack/react-table or @tanstack/react-virtual: the replacement uses both.

Remaining scope

  • Configure an unused-file/dependency gate for the replacement, accounting for TanStack-generated routes and server entry points. Run it in CI.
  • Remove the ignored MCP tracer_name parameter or make its intended tracer selection real, preserving supported callers.
  • Remove duplicate command/HTTP-wait/directory-removal implementations across the installed test harness and release-script helpers. Preserve scripts that intentionally run on a bare interpreter; do not add an installed-package dependency without checking those consumers.

Acceptance criteria

  • The unused-code gate reports no unexplained orphans and fails for a deliberately introduced orphan.
  • MCP tests prove tracer construction follows the retained constructor contract.
  • The duplicated helper behaviours have one tested implementation or a documented necessary boundary; no unexplained clone remains.
  • Replacement lint, typecheck, tests, and build, plus script/harness tests, pass.

Maintainer deferral is preserved. This is not a prerequisite for the replacement accessibility programme. Out of scope: deleting dependencies used by current tables/logs or unrelated helper consolidation.

Historical issue brief, superseded by the current scope above

Evidence baseline: e9d796e9e4c4e966bc3dea478e7ec5349a1e2f5c (2026-09-24)

Parent

#980

Outcome

Orphaned files, unused dependencies, ignored parameters and duplicated implementations are removed, so readers only meet code that runs. knip runs in CI so orphans don't return.

Current behavior and root cause

Orphaned Observatory files. knip reports them, and rg confirms none has an importer. Paths are relative to packages/phlo-observatory/src/phlo_observatory/src/:

  • components/data/BranchSelector.tsx
  • components/data/QueryEditor.tsx
  • components/data/SavedQueriesPanel.tsx
  • components/data/TableBrowserVirtualized.tsx
  • components/GraphCanvas.tsx
  • components/hub/ServiceCard.tsx
  • components/NodeInfoPanel.tsx
  • utils/sqlIdentifiers.ts
  • utils/effectiveSettings.ts

Unused npm dependencies: @tanstack/react-table, @tanstack/react-virtual and prism-react-renderer. If #991 adopts react-virtual, keep that one and use it.

Ignored parameters (vulture): tracer_name in packages/phlo-mcp/src/phlo_mcp/api_client.py:27 is accepted but never used; get_tracer() is called without it. The break-glass denied_by and revoked_by parameters are handled in their own issue.

Duplicated implementations (jscpd). packages/phlo-testing/src/phlo_testing/harness_utils.py and scripts/golden_path_common.py share three clones, 349 lines in total: HTTP wait (:111 ↔ :191), command execution (:236 ↔ :346) and forced directory removal (:57 ↔ :62). Overall duplication is a modest 2.58%; this is the largest real duplicate.

Effect on other issues: #992 and #993 include accessibility items for TableBrowserVirtualized, SavedQueriesPanel and GraphCanvas. Deleting these files removes those items.

Implementation scope

  • Delete the nine files and three dependencies, confirming lint, tsc, tests and the build still pass.
  • Configure knip entries for TanStack routes and generated files so the report is clean, and run knip in CI with a zero-issue gate.
  • Remove tracer_name, or pass it through to the tracer if it's intended.
  • Give the harness helpers one home: the release scripts import phlo_testing.harness_utils, or both import a small shared module.

Acceptance criteria

  • npx knip reports no unused files or dependencies, and it runs in CI.
  • jscpd shows no clone between harness_utils.py and golden_path_common.py.
  • Observatory lint, tsc, tests and build pass; tests/scripts and phlo-testing tests pass.

Blocked by

None (can start immediately).

Activity

  1. added
    P3Priority 3 - Low
    auditAudit finding
    dead-codeDead or unused code
    ready-for-agentFully specified and ready for an agent to implement
    on Sep 24, 2026
  2. iamgp commented on Sep 25, 2026

    @iamgp
    CollaboratorAuthor

    Deferred at maintainer request while Wave 2 prioritizes #1014 (credential redaction). This issue remains open for a later planning cycle; no technical blocker or completion date is asserted. Revisit its cleanup before the dependent accessibility work in #992 and #993.

  3. added
    deferredPostponed by maintainers pending reprioritization
    on Sep 25, 2026
  4. changed the title [-]Delete orphaned Observatory files, unused dependencies and duplicated harness helpers[/-] [+]Add an orphan-code gate and remove ignored MCP parameters and duplicated harness helpers[/+] on Oct 5, 2026
  5. removed
    ready-for-agentFully specified and ready for an agent to implement
    on Oct 5, 2026
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

    P3Priority 3 - LowauditAudit findingdead-codeDead or unused codedeferredPostponed by maintainers pending reprioritizationqualityCode quality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions