Repository navigation
feat(platform): state the task rules in a spec that tests hold - #4351
Merged
Merged
Conversation
The rules a backend domain keeps lived in its code and tests alone: of 58 domains only governance had a written contract, and the manual suites, the user docs and the REST contract share no identifier. A domain spec (backend/domains/<domain>/spec.md) states those rules for a reader who has not opened the code. It takes the prefix of the feature's manual suite, groups its rules under topic headings, and gives each rule one card: a heading that is the rule as one plain sentence, a short body, and an example with a named person. A spec carries no status and no list of tests. A question nobody has decided goes under Not yet instead of becoming a rule. The test that holds a rule names it in its title ([TASK-R4]). tests/guards/domain-specs.guard.test.ts parses every spec and the titles of the workspace's tests, and fails on a shape it does not know, a rule without an example, a rule no running test names, and a title that names a rule no spec states. tasks is the first spec: 13 rules on who may create, change and delete a task, archived tasks and projects, size limits, automated agent starts and deletion. 26 existing test and describe titles gain their rule's ID. The 50-attachment cap had no test; one is added.
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The rules a backend domain keeps lived in its code and tests alone: of 58 domains only
governancehad a written contract, and the manual suites, the user docs and the REST contract share no identifier. This adds one checked format for those rules and trials it ontasks.backend/domains/<domain>/spec.md, shape inspec-template.md) states the rules for a reader who has not opened the code. It takes the prefix of the feature's manual suite (TASK-R4besideTASK-F63), groups its rules under topic headings, and gives each rule one card: a heading that is the rule as one plain sentence, a short body, and an example with a named person.it('… [TASK-R4]', …), or thedescribewhen the whole block does).tests/guards/domain-specs.guard.test.ts) parses every spec and the titles of the workspace's tests. It fails on a shape it does not know, a rule without an example, a rule no running test names, and a title that names a rule no spec states. A skipped test holds nothing.tasks/spec.mdis the first spec: 13 rules on who may create, change and delete a task, archived tasks and projects, size limits, automated agent starts and deletion.What else changes:
describetitles underbackend/core/tasksandbackend/domains/tasksgain their rule's ID. No assertion changes.TASK-R11) had none..agents/repo.mdandbackend/README.mddocument the format.Two things for the reviewer:
updateTaskvalidates a description only when the request sends one), while the user docs say Save stays unavailable until the description is shortened. One of the two is the intended rule.Checklist
bun run checkpasses (format, lint, typecheck, all tests): on CI, where Format, Lint, Type check, Unit (both platform shards executed, not replayed), UI, Browser, Knip and Backend integration are green onba0d3124a. Not run in full locally; run there on the rebased branch: the new guard,turbo-inputs.guardand the 11 tagged test files (191 tests), platformtypecheck,oxlint --type-awareandoxfmt --checkon every changed file,lint:manual,lint:links,lint:conflicts.bun run lint:sastpasses (Opengrep): 476 rules, 0 findings..agents/repo.md,backend/README.md) are updated.README.md/README.de.md/README.fr.md: N/A.Test plan
bun run --filter @tale/platform test -- tests/guards/domain-specs.guard.test.tspasses.[TASK-R13]from thedescribeinbackend/domains/tasks/retire.test.tsand run the guard: it fails withTASK-R13 is held by no test.[TASK-R99]to any test title and run the guard: it fails withthe title names TASK-R99, which no spec states.it(toit.skip(on the[TASK-R11]test inservice.attachments.test.ts: the guard fails withTASK-R11 is held by no test.normalizeAttachments(service.ts) to> TASK_ATTACHMENTS_MAX + 1: the new[TASK-R11]test fails.All four were observed locally and reverted.