Skip to content

fix(platform): close the task-limits review round after #3689 - #3749

Merged
yannickmonney merged 17 commits into
mainfrom
fix/task-limits-review-follow-ups
Sep 28, 2026
Merged

yannickmonney merged 17 commits into
mainfrom
fix/task-limits-review-follow-ups

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #3689 (TALE-75), which merged before its first review round was addressed. This PR closes the findings that review raised.

What changes

The REST task door no longer repeats the slug the caller sent.
AUTOMATION_NOT_DEPLOYED on task intake, task start and a review's request for changes used to say "<slug>" has no deployed version — …. Each door now has its own fixed sentence. AUTOMATION_PROJECT_FORBIDDEN now reads "that project" at both throw sites (automations/store.ts, rest/v1-tasks.ts). The refusal guard (domains/tasks/errors.test.ts) had missed the slug because it read ProjectError/AutomationError only under domains/tasks/ and in the domain functions a door reaches. It now also reads every TASK_DOORS file, and it pins that the REST door's three automation refusals are read. With the old sentence restored, the guard fails. The EN/DE/FR API reference, error-codes.md and the integration journey are updated to match.

A description over the cap no longer re-announces on every keystroke.
The field's error is a live role="alert" region, and the Textarea shakes each time its text changes. Because that text held the running length, every keystroke past the cap triggered a new announcement. The error is now the cap sentence the server refusal toasts (tasks.errors.TASK_DESCRIPTION_INVALID), and it changes only when the draft crosses the cap. The length moves in the Textarea's own used / max counter (counterMax), which is not a live region. This applies to both the description editor and the create form. tasks.fields.descriptionTooLong is removed from every catalog. New tests check that the alert keeps the same node and the same text across keystrokes past the cap. A render test pins the inline title's maxLength at 200. TASK-B11 is updated.

Task docs state the caps. docs/{en,de,fr}/platform/projects/tasks.md now give the title limit (200) and the description limit (20,000; most emoji count as 2). They also say that a longer description holds Create task / Save until you shorten it.

The issue importers use the domain's own cut. Both importers used a local 50,000-unit .slice, a second copy of the cap that no longer matched it. They now call truncateImportedDescription, which cuts at 20,000 on a grapheme boundary. The source snapshot keeps its 100,000 limit.

Mock vs live blank-title refusal is now documented and tested. A mock body can only throw, so a test run reports the empty-title sentence under MOCK_BODY_FAILED, while a live run answers INPUT_INVALID. connector.yml and reference/automation.md now say this, and a dispatcher test checks it.

The ADMITTED reason for AUTOMATION_INPUT_INVALID is corrected. It used to say the sentence never quotes the stored schema. It now says it can: Ajv's rule may quote the inputs schema, for example a pattern or a bound. It also states why that may travel. A schema test checks that the pattern is quoted and the refused value is not.

Design token decision recorded. #3689 changed the light --destructive token from red-500 to red-700, which recolours every destructive button, badge and alert across @tale/ui consumers. The squash commit title did not mention it. design/docs/tokens.md now records the decision and flags that the design intent's button.danger.bg still reads red-500.

Not changed

  • The blank-title native refusal keeps its bare shared sentence. There is no task.<action>: prefix: refuse() adds one only to list zod issues, and the file's other refusals don't carry it either.
  • There is no source guard against local MAX_LABEL* constants: the pickers already import TASK_LABEL_CHARS_MAX.

Checks run locally

  • tsc --noEmit on the platform
  • oxlint on the changed files
  • The server suites for tasks, REST tasks, connectors, automations, validate, guards and i18n: 126 files, 1544 tests
  • All tasks UI tests: 47 files, 286 tests
  • Docs tests
  • lint:manual and check-guide.ts on the tasks suite
  • Proof that the new tests fail without their fix: the guard on the old REST sentence, three UI tests on the old hook, and the inline-title test without maxLength

Review round 1

  • OpenAPI. The start door's description no longer says the AUTOMATION_NOT_DEPLOYED sentence names the slug (scripts/openapi/spec.ts, regenerated public/openapi.json).
  • One AUTOMATION_PROJECT_FORBIDDEN sentence. AUTOMATION_NOT_BOUND_SENTENCE (domains/automations/store.ts) is used at both throw sites, and the REST intake test pins the 403 body.
  • The refusal guard reads more. It now also judges the RestRefusals and FolderErrors a door's own file builds, with task.status and the folder domain's static rethrows admitted and their reasons given.
  • The counter. @tale/ui Textarea formats used / max in the UI language, adds the counter to the field's aria-describedby (still not a live region), and takes a caller-measured counterValue. The task description editor and create form pass the trimmed length that the cap and the save use, so surrounding whitespace no longer inflates the count. The create-form test now checks that the alert keeps the same node and that no new shake starts on a keystroke past the cap. TASK-B11 is updated.
  • Docs guard. backend/core/tasks/limits_docs.test.ts checks that the EN/DE/FR task pages state both caps in their locale's number format. The pages are now @tale/platform#test turbo inputs, with the guard entry added.
  • Token record. design/docs/tokens.md now lists every intent token that is still lighter than the shipped red, says why red-700 was chosen over red-600, and corrects the contrast figures.

Each new test was checked to fail without its fix.

backend:integration

Run against a fresh tale-db container and a fresh MinIO:

  • Full run: 621 of 629 checks passed across 119 of 179 lanes. The run was truncated at checkConversationApi (500 !== 200). Seven REST lanes failed. Most of their requests got 429 RATE_LIMITED, round d of the journey included, and the rate-limit attribution lane itself failed (valid key from burned source → 400). This PR does not change rate limiting or the conversation API. I have not confirmed whether main fails the same way on this machine.
  • Filtered run, checkRestMachineJourney: REST task owner refusals + trigger health on the listing (round d) passes. It holds the edited assertions (no deployed version, and the slug is not repeated). The lane then threw later, in a step that depends on an earlier lane.
  • Filtered run, checkRestDoor,checkRestMachineJourney: round d passes again. The journey's upload and file steps fail without the object store that an earlier S3 lane seeds. checkRestDoor also fails in this filtered run, although no value in its summary reads false.

The REST task door answered a saved but undeployed automation with
`"<slug>" has no deployed version — …`, repeating the automationSlug or
workflowSlug the caller sent, and said AUTOMATION_PROJECT_FORBIDDEN as
"this project" where the automations store says "that project". The
refusal guard never saw it: it read ProjectError and AutomationError only
in domains/tasks/ and in the domain functions a door reaches, never in the
other door files themselves.

The guard now judges every refusal a TASK_DOORS file builds and pins that
it reads the REST door's three automation refusals. The not-deployed
sentences are static per door (intake, start, review), and both
forbidden sentences read alike. Docs, error-code register and the
integration journey follow.

Refs TALE-75, follow-up to #3689.
The description cap put the draft's running length into the field's error,
which the Textarea renders as a live role="alert" region and shakes on
every new sentence: past the cap each keystroke was announced again, so
TASK-B11's "a screen reader announces it once" could not hold.

The error is now the cap sentence a server refusal toasts
(tasks.errors.TASK_DESCRIPTION_INVALID) and changes only when the draft
crosses the cap; the length moves in the Textarea's own used / max
counter, outside the live region, in the description editor and the
create form alike. The retired tasks.fields.descriptionTooLong key leaves
every catalog. A test pins the inline title's 200 cap.

Refs TALE-75, follow-up to #3689.
The task pages said nothing about the board's caps: a title takes up to
200 characters, a description up to 20,000 (most emoji count as 2), and a
longer description, pasted or left by an earlier import, is not cut but
holds Create task and Save until it is shortened. EN, DE and FR.

Refs TALE-75, follow-up to #3689.
The GitHub and GlitchTip importers pre-cut a task's description at a local
50,000 code units with a raw slice, under a comment that called it the
limit the app's task API accepts. The board's cap is 20,000, so the local
bound was a divergent second copy that no longer held, and a code-unit
slice can end on half an emoji.

They now seed the description with truncateImportedDescription, the task
domain's own grapheme-safe cut, so a run carries what the task will hold.
The source snapshot keeps its 100,000 limit.

Refs TALE-75, follow-up to #3689.
A mock body can only throw, so a test run of task.upsert or
task.upsert_issues reports the domain's empty-title sentence under
MOCK_BODY_FAILED ("the task.upsert mock body failed: …"), while a live
run answers INPUT_INVALID with the sentence alone. The connector and the
automation reference said the mocks refuse alike; they now say how the
code differs, and a dispatcher test holds it.

Refs TALE-75, follow-up to #3689.
The refusal guard admits AUTOMATION_INPUT_INVALID's first problem as "a
path and a rule, never a value", yet the rule is Ajv's own reason and can
quote the stored inputs schema: `must match pattern "^[A-Z]"`, a bound.
The admission now says so and why it may travel (the automation author's
contract with whoever starts it, naming no person, no other task and
nothing the caller sent), and a schema test pins both halves: the pattern
is quoted, the refused value is not.

Refs TALE-75, follow-up to #3689.
#3689 moved the light --destructive token from red-500 to red-700 inside a
task-limits fix, and the squash hid it. Record the decision where the
token map lives: the one token colours error text and destructive fills,
red-500 stays under 4.5:1 as text on the page and under white button
text, and the design intent's button.danger.bg still reads red-500 until
the design sources follow.

Refs TALE-75, follow-up to #3689.
The counter printed raw digits (20005 / 20000) beside an error that names the cap in the reader's number format, and no field referenced it. It now formats both numbers in the UI language, joins the field's aria-describedby (read on focus, still no live region), and takes a caller-measured counterValue, so a caller that saves the value trimmed counts it trimmed.
The EN/DE/FR task pages state the title (200) and description (20,000) caps by hand. A guard now reads each page for both numbers in its locale's format, so a cap that moves without its page fails; the pages join the platform test task's turbo inputs.
The over-cap counter showed the raw textarea length while the cap and the save measure the trimmed draft, so surrounding whitespace overstated what was left to delete. The description editor and the create form now hand the Textarea the trimmed length. The create-form test also holds the alert to one node and no new shake across a keystroke past the cap, and TASK-B11 expects the grouped counter read on focus.
Red-500 is 3.67:1 on the page (3.76:1 was white), 3.60:1 under the button's 98% foreground; red-600 is 4.71:1 on the page and 4.39:1 on --muted.
@yannickmonney
yannickmonney merged commit c2c5d4a into main Sep 28, 2026
57 checks passed
@yannickmonney
yannickmonney deleted the fix/task-limits-review-follow-ups branch September 28, 2026 22:49
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.

1 participant