Skip to content

MCP server: reload and staleness detection for the spawn-time snapshot #437

Description

@jimisola

Problem

reqstool mcp local -p <path> loads everything — the requirements/SVC YAML model and the generated annotation/test-result artifacts — once at spawn, then serves that snapshot indefinitely with no reload and no staleness signal.

Observed in a real project (skills-gateway), where the MCP server is spawned by an AI coding harness and stays alive for days:

  • Long-lived server (spawned days earlier): get_status returned 14 requirements, 0 implementations, 0 tests.
  • Reality at query time (CLI reqstool status local after mvn clean verify): 55/55 complete, PASS.
  • Freshly spawned server against the same tree + fresh build: 55 requirements, 55 completed, 54 with implementation, 59 tests — matching the CLI exactly.

So the join logic is fine; the failure mode is silent staleness. Dangerous because the stale answer is well-formed — an agent (or human) has no way to distinguish "0 implementations" from "snapshot predates the build".

Proposal

  1. Reload: re-read sources + artifacts per request, or watch files, or expose an explicit refresh tool. Per-request re-read is likely fine at these scales.
  2. Staleness detection: status-type responses should compare artifact/source mtimes against the loaded snapshot (and against each other) and either transparently reload or answer STALE — rebuild/reload required instead of confident numbers. Truncated/absent artifacts (the incremental-compilation trap) should be reported as such, never as zeros.
  3. (Optional) a verify tool with CLI-gate semantics: {complete, incomplete, failing: [ids+reasons], pass: bool} — the machine-readable equivalent of "N/N complete · PASS", usable by agents mid-loop once 1+2 make it trustworthy.

Interim guidance for consumers is in reqstool/reqstool-ai#36 (MCP to read, YAML to edit, CLI to verify).

🤖 Generated with Claude Code

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