Skip to content

Fix developing-story response budgets and request context - #108

Merged
R055LE merged 1 commit into
mainfrom
issue-106-story-output
Oct 3, 2026
Merged

R055LE merged 1 commit into
mainfrom
issue-106-story-output

Conversation

@R055LE

@R055LE R055LE commented Oct 3, 2026

Copy link
Copy Markdown
Owner

Why

The first live developing-story preview stopped halfway through JSON at the inherited 900-token output ceiling. It also exposed ambiguous citation/action instructions. Live acceptance of the first fix then found that realistic source metadata and the revision payload exceeded the existing input limit.

Closes #106.

Changes

  • Give story drafts and the one permitted revision a fixed 4,096-token ceiling. Legacy Curated and reviews remain at 900; all calls use the existing shared token/dollar gates.
  • Show the complete JSON response shape and explicit citation, claim and confirmed-history rules. Add model-only numeric source labels and omit storage identifiers from requests.
  • Report provider truncation explicitly and fail closed at any of the four completion stages.
  • Send independent review every exact cited span once plus source metadata. Revision keeps full excerpts for the selected/cited sources, their original numbers, and the exact rejected citation pool. Stored/returned evidence and parser indexing remain unchanged.
  • Keep the 18,000-character request gate, four-completion workflow bound, shared Roger tone, exact-quote checks and independent support review.

Validation

  • Final local full suite: 561 passed, 88.28% coverage (Python 3.14).
  • Ruff and git diff --check: passed.
  • Captured-size eight-source fixture: draft 17,899 characters; review 5,263; revision 5,951 with six distinct 180-character citations. Zero-ID skip retains all sources and fits at 17,253. Non-contiguous revision references preserve source numbers 3 and 8, and the parser rejects renumbering a source-8 quote to array position 2.
  • Independent read-only review: no code blockers; 11 focused checks passed against the final modules.

Live preview result

The final candidate modules were loaded only into a separate no-send preview process. Deployed files and the running bot were unchanged. The source bytes match this commit.

The draft completed normally (finish_reason=stop) at 1,638 output tokens under the 4,096 ceiling, with 5,040 prompt tokens. This resolves the observed truncation. However, the model omitted two required keys, emitted eleven claims, left change uncited, and mixed eight papers under one publish story ID. Strict parsing rejected it before independent review. This is not an accepted draft or editorial hold.

The preview spent 6,678 tokens and $0.0011592 through ordinary usage accounting. Before/after comparison confirmed unchanged story, decision, delivery, seen, observation, lease and Curated metadata state. No message was sent.

Issue #107 owns the remaining model-adherence and focused-reporting failure. Story activation remains blocked on a later complete, independently reviewed live result.

Rollout boundary

No merge, deployment, configuration change or Discord post is part of this PR preparation. Story mode remains disabled; the current Digest channel and daily settings remain configured. A merge releases an image to the existing deployment timer and requires explicit approval. Story-mode and stream activation remain separate decisions.

The larger output allowance is a ceiling, not a target. Budget checks still happen before each request, so a call can cross the daily threshold and prevent a later review/revision. Unusually large contexts still fail closed at the unchanged input limit. A revision is limited to evidence selected or cited by the rejected report and can hold when that evidence is insufficient.

@R055LE
R055LE merged commit 8f01ccc into main Oct 3, 2026
2 checks passed
@R055LE
R055LE deleted the issue-106-story-output branch October 3, 2026 12:10
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 developing-story output truncation and response contract guidance

1 participant