Skip to content

fix(roadmap): make the plan summary fit its title - #3267

Merged
dan-petty merged 6 commits into
mainfrom
fix/3249-staging-title-limit
Nov 2, 2026
Merged

dan-petty merged 6 commits into
mainfrom
fix/3249-staging-title-limit

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The plan summary allowed 60 characters, but the lead plan #<number> of the title takes up to 13. staging_title then cut the summary with ..., and title_problems refuses that. One constant, STAGE_SUMMARY_MAX_CHARS (47: 60 minus the lead for a 6-digit issue number), now sets the schema limit and the prompt limit. The schema also refuses a summary that grows past it when a handle gets a code span. Tests hold the schema, the prompt and the title room equal.

Closes #3249

Change: openspec/changes/archive/2026-11-02-3249-staging-title-limit/


Generated by Claude Code

The summary field allowed 60 characters, but the lead of the title takes up to 13,
so staging_title cut it with ... and title_problems refused it. One constant,
STAGE_SUMMARY_MAX_CHARS, now sets the schema limit and the prompt limit.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PeiMDoPafqUWqpk1WxhaYW
The fail-to-pass proof needs a failure in the call phase, not a collection error.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01PeiMDoPafqUWqpk1WxhaYW
@dan-petty
dan-petty marked this pull request as ready for review November 2, 2026 19:16
@dan-petty
dan-petty merged commit 758b7a8 into main Nov 2, 2026
20 checks passed
@dan-petty
dan-petty deleted the fix/3249-staging-title-limit branch November 2, 2026 19:16
dan-petty pushed a commit that referenced this pull request Nov 2, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.48.1](v0.48.0...v0.48.1)
(2026-11-02)


### Bug Fixes

* **roadmap:** make the plan summary fit its title
([#3267](#3267))
([758b7a8](758b7a8))
* **roadmap:** run a negative search verify in the step
([#3269](#3269))
([42bc835](42bc835))
* **roadmap:** write the Verification line under a staged task
([#3268](#3268))
([acaf455](acaf455))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>

Copy link
Copy Markdown
Owner Author

Adversarial review of #3267 (round 1).

Verdict: FIX (no blocker, no major; 8 minor findings). Head 39a65eb, base 3f3103a. The fix does what it says for issue numbers of up to 6 digits. I could not break the core claim.

Findings, most severe first:

  1. minor. A number of 7 digits or more still gives a cut title, with no signal, and the spec says the opposite. The requirement says "The job SHALL NOT cut a summary that the schema of the plan accepted", without the 6-digit condition. Nothing in _settle checks the title, so the draft would open with a title that ends in ....
    Repro: staging_title(1000000, "a"*47) gives ...plan #1000000 aaaaaaaaaaaaaaaaaaa... and title_problems refuses it (The summary ends with ...). Same for 12345678. Realistic risk is nil today (issue numbers are near 3300), so this is a wording and guard question.
    Fix: add "for an issue number of up to 6 digits" to the requirement and to the scenario, or run title_problems in _settle and send the problem back (this is what feat(roadmap): the jobs build pull request text with pull_form #3215 plans).

  2. minor. Scenario "A long summary" keeps its name but loses its old assertion. The base scenario said: a 60-character summary for item 2656 gives a title of at most 60 characters, "cut at a word". The delta puts the schema refusal under that name. The cut at a word is still code (staging_title) and still pinned by test_the_summary_of_a_staging_title_has_at_most_sixty_characters_and_is_cut_at_a_word[7|2656|123456], but no scenario describes it now. That is behavior that the spec no longer names. The "at most 60 characters" part still sits in the requirement text (402 characters, under 500), so nothing is lost silently, but a reader of the spec cannot find the cut.
    Fix: keep the old scenario under its own name (for example "A summary over the room is cut", for a number of 7 digits), or say in the design that the cut is a known remainder that feat(roadmap): the jobs build pull request text with pull_form #3215 removes.

  3. minor. Two measures for one limit: a summary with spare whitespace is refused though its title fits. max_length counts the raw string. The validator counts safe_text, which collapses whitespace.
    Repro with make_stage_proposal(summary=s): "a"*47 + " " is refused with "String should have at most 47 characters" while len(safe_text(s)) is 47; "a"*20 + " "*10 + "b"*17 (raw 47) is accepted; "a\t...\tb"*40 (raw 53, shown 42) is refused. A trailing newline is a common model habit, and it costs a retry.
    Fix: StringConstraints(strip_whitespace=True, max_length=...) on the field (keeps maxLength in the JSON schema, which the constrained-decoding providers read), and keep the validator.

  4. minor. A summary that ends with ... or … passes the schema and gives a title that the form check refuses, for every number. Repro: make_stage_proposal(summary="a"*40+"...") is accepted; title_problems(staging_title(1, ...)) returns "The summary ends with ...". Same title-refused symptom as fix(roadmap): staging_title cuts the plan title with ... and title_problems refuses it #3249, other cause. Not caused by this PR. The open plan docs(openspec): plan #3200 Refuse placeholder and cut plan text #3260 (feat(roadmap): refuse a plan with placeholder or cut text #3200) owns the refusal; say so in the proposal, or add the three-line check here.

  5. minor. The message text is not tested. Mutant: remove "and the limit is {limit}. " from stage_summary_long: 87 tests pass. The spec says the reply "goes back to the model with the limit". The test only matches characters in the title. Fix: assert str(limit) in the match. Also, no test refuses a plain 48-character summary directly (the scenario "48 characters"). It is covered only through the helper stage_summary_limit(), which reads the schema.

  6. minor. The prompt names the limit but not the code-span growth. The prompt says "at most 47 characters". The real limit is on the text as the title shows it, so a handle, link or <!-- costs extra ("a"*35+" @maintainer" is 47 raw, 49 shown, refused). Only the retry message tells the model. One sentence in roadmap_stage_change.md would cut retries. (Also <!-- becomes &lt;: 45 raw, 48 shown, refused.)

  7. minor, unverified for a live model: the retry rate. Reply path checked: chat_structured(max_retries=1) gives 2 attempts; the reflection message names the field and the 47 limit (I printed it for a 48-character reply); two failures give a StageFailure for that item and the run goes on (_plan_each), no hard fail. Estimate from what the repo shows (the prompt said 40 until now): of the 12 open plan PRs, 4 have a summary over 47 (docs(openspec): plan #3201 add a plan-check command for a plan pull request #3261 has exactly 48 characters; docs(openspec): plan #3199 post pr check evidence comment #3237, docs(openspec): plan #3218 dry-run config unset writes nothing #3234 and docs(openspec): plan #3106 point the harness manual at pydantic-ai #3211 are cut at 49 or more), 6 are over 40. Of 61 merged plan titles, max 46, 5 over 40, none over 47 (biased: cut titles were fixed by hand). The golden set plan.json (40 cases) has max 40, so it says nothing about 47. Expect a first-reply refusal rate of roughly 0 to 30 percent and a skipped item rate of a few percent at most. Fix: none needed; run devops roadmap eval stage with the live model once to measure.

  8. minor, pre-existing, out of scope. The Semantic PR title check counts UTF-16 units. ^.{1,60}$ in JS: 47 emoji have length 94 (node -e gives false), but Python len and the schema accept them (the title tail is 58 characters). Not a regression; note for feat(roadmap): the jobs build pull request text with pull_form #3215. Also: the commits put the fix (e1dee22) before the tests (bedbc16), against rule 4 order; Fail-to-Pass Check is green, so low weight. Open plan docs(openspec): plan #3200 Refuse placeholder and cut plan text #3260 assumes a 40-character bound and edits the same validator and staging_title; expect a rebase there.

Attacks tried that did not break it:

  • New tests on base src: the title tests fail for the stated reasons ((False, [...cut summary...]) for each of the 6 numbers, 60 == 47, DID NOT RAISE; one fails on ImportError: ISSUE_NUMBER_DIGITS, which is an import error but is the new name).
  • Mutants, each caught: constant +1; ISSUE_NUMBER_DIGITS 5; validator > to >=; validator on plain len; validator off; prompt 48; prompt 40; schema back to 60; max_length +1; max_length removed; staging_title room +3; whitespace-only measure.
  • Fuzz, 200000 strings from 40 hostile atoms (handles, backticks, tags, comment openers, images, links, o/r#12, [end-marker], tabs, newlines, CJK, emoji, …): 144844 accepted, none gives a tail over 60 or a new cut for numbers 1 and 999999.
  • Exact 47 and 48; wide, emoji and combining characters count one per code point in both places.
  • Schema, prompt and title room are one number: derived from stage_title_lead; tests fail if any of the three differs. The prompt in knowledge_base and docs names no other number.
  • delivery_title and the implement_run.py cuts: leaving them is right. They read the issue title, not the plan summary, so this PR does not widen them; feat(roadmap): the jobs build pull request text with pull_form #3215 owns them.
  • Checks: tests/roadmap, tests/invariants, tests/lang (3176 passed; 9 failed, all FileNotFoundError: kubectl, an environment gap); ruff, ruff format, mypy on the touched files; openspec validate --strict --specs (168 passed); devops openspec check; the 18 CI checks are green.
  • Rules: Conventional Commit title, Closes #3249, change folder complete and archived in the last commit, requirement text 402 characters, no private data, no secret or permission widened.

Not verified:

  • The retry rate with a live model.
  • deptry on the new annotated_types import in tests/support/builders.py (my environment made deptry unusable; CI Static Analysis is green).
  • Rendering of the generated docs (no doc is generated from the touched names).

Generated by Claude Code

dan-petty added a commit that referenced this pull request Nov 2, 2026
Follow-up of the review of #3267. `staging_title` no longer cuts: a
summary that does not fit (a number of 7 digits or more) stops that item
with an error instead of ending the title with `...`. The schema counts
one thing, the one-line text of the title, so spare whitespace costs no
retry, and every refusal names the count and the limit. The prompt says
that a handle or a link costs characters. The spec states the 6-digit
condition and replaces the cut-at-a-word scenario.

Refs #3249

Change: `openspec/changes/archive/2026-11-02-3249-title-limit-followup/`

---
_Generated by [Claude
Code](https://claude.ai/code/session_01PeiMDoPafqUWqpk1WxhaYW)_

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): staging_title cuts the plan title with ... and title_problems refuses it

2 participants