Files
pad/cmd
xarmian 16edb94203 fix(mcp): free tools/list headroom: reflow and condense descriptions (TASK-3536) (#2004)
* fix(mcp): free tools/list headroom by reflowing and condensing descriptions (TASK-3536)

tools/list was 55,291 of its 55,296-byte budget (54 KiB, TestMCPPromptBudgets),
so the next parameter anyone added would fail it. TASK-3489's ruling holds: a
fixed ceiling, trimmed rather than raised. Now 50,010 bytes (9.6% headroom).

- U1, whitespace only (55,291 -> 52,748): tool descriptions are reflowed for
  the wire by compactToolDescription. Indented continuation lines join the
  line above; Required:/Optional: keep their own line at a 4-space indent;
  action headers and column-0 lines are untouched. The Go source keeps its
  hand-wrapped layout. A test pins that every word survives in order and
  every action keeps its header. The pad_meta tool-surface dump serves the
  same wire form.
- U2: the workspace param (the same 369 chars on 10 tools) is one sentence
  that keeps the operative rule (explicit wins; pass it on every call to a
  remote server; local falls back to pad_set_workspace, then .pad.toml).
- U3: pad_item update's content_outcome and expected_seq paragraphs are
  condensed to their rules: re-read later, never re-send; prefer
  expected_seq, whose conflict carries actual_seq.

The rules stay in the descriptions, not only in the server instructions,
because a client may never surface instructions to the model. The ChatGPT
mount has its own catalog and is unchanged. Wording only: no
ToolSurfaceVersion bump.

* test(mcp): regenerate the wire goldens for the reflowed descriptions (TASK-3536)

stdio and remote tools/list: 20 description strings change, nothing else
(compared with descriptions stripped: identical). The ChatGPT mount's
goldens do not move.

* fix(mcp): the reflow keeps lists, the dump keeps its source text (TASK-3536)

Codex round 1:
- A bullet, a numbered item or a one-word label ("Constraints:") now keeps
  its own line (a list item at a 6-space indent); only a true continuation
  joins the line above. pad_collection's delete constraints read as a list
  again. A test pins it for every catalog description, and the mutant
  dropping the list branch fails it.
- pad_meta's tool-surface dump serves the SOURCE text again: it is the input
  for generated docs, which want the structure. tools/list alone is reflowed.
- pad_item update keeps the read rule U3 had dropped: re-read with get or a
  full list, since a default list carries no content.

tools/list is 50,099 of 55,296 bytes (9.4% headroom). Goldens: stdio and
remote change descriptions only; the ChatGPT mount's are unchanged.

* docs(mcp): pad_item update keeps 'nothing guarantees the save' (TASK-3536)

Codex round 2: the condensed block dropped that the collab save is not
guaranteed, so an agent could wait on it. Restored as one sentence, with the
write-not-row qualifier on the warning.
2026-10-10 00:50:35 -04:00
..