Skip to content

Stable vs experimental response field boundary #139

Description

@jonathanMLDev

Problem

Tool response payloads include a mix of fields that are part of the stable contract (e.g., matches, total_count, namespace) and fields that are experimental or may change before 1.0 (e.g., decision_trace, degraded, degradation_reason, hybrid_leg_failed, rerank_skipped_reason). There is no explicit annotation, naming convention, or structural separation distinguishing stable fields from experimental ones. Consumers (both LLM agents and programmatic integrators) cannot know which fields are safe to depend on across minor version bumps. The deprecation policy document (PR #122) establishes a breaking-change process but does not define which current fields are in the stable set vs. the experimental set.

Acceptance Criteria

  • Each tool response type in src/types.ts clearly separates stable fields from experimental fields (via naming convention like experimental_* prefix, nested experimental: {} object, or JSDoc @experimental tags)
  • docs/TOOLS.md documents the stability classification for every response field
  • At least one mechanism prevents accidental promotion: either a lint rule, a type-level marker, or a documented review checklist item
  • The existing deprecation policy document references the stable/experimental boundary and defines the promotion process
  • Tests pass in CI
  • PR approved by at least 1 reviewer

Implementation Notes

The simplest approach is a nested experimental key in response objects: { namespace, matches, total_count, experimental: { decision_trace, degraded, ... } }. This is a breaking change to response shape — coordinate with the deprecation policy. An alternative non-breaking approach: add @experimental JSDoc annotations to fields in src/types.ts and document in TOOLS.md which fields are experimental, deferring the structural separation to v1.0. Given pre-1.0 status, the structural approach is preferred (consumers expect breaking changes). Update HybridQueryResult in src/types.ts and any response builder utilities. The format-query-result helper (item 1) is the code that constructs these responses — coordinate timing.

References

  • Eval finding: Test 34 (API Stability Discipline) — survived; cluster "stable-experimental-field-boundary"
  • Related files: src/types.ts, docs/TOOLS.md, src/core/server/tool-response.ts, docs/MIGRATION.md (deprecation policy)

Metadata

Metadata

Assignees

No one assigned

    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