fix(tasks): require field constraints from data-model.md in generated tasks - #4430
fix(tasks): require field constraints from data-model.md in generated tasks#4430chelsealong wants to merge 2 commits into
Conversation
… tasks /speckit.tasks mapped data-model.md entities to user stories but never told the agent to carry field-level constraints (max length, nullable, enum values, validation rules) into the task text. Left to discretion, the implementing agent can silently invent its own value instead of the one recorded in data-model.md. Fixes github#4383
There was a problem hiding this comment.
🟡 Changes recommended
The regression assertion is too broad to reliably detect removal of the required behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates /speckit.tasks to preserve field-level data-model constraints in generated task descriptions.
Changes:
- Requires constraints to be quoted verbatim.
- Adds a regression test for the prompt rule.
File summaries
| File | Description |
|---|---|
templates/commands/tasks.md |
Adds the constraint-preservation instruction. |
tests/test_tasks_template_constraints.py |
Tests the new instruction. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…m wording Addresses Copilot review feedback that the prior assertion only checked for the word 'constraint', so it would still pass if the rule's meaning were reversed (e.g. constraints permitted to be omitted).
|
Tightened the regression assertion per review: it now checks for the actual verbatim-quoting requirement ( |
Fixes #4383
Problem
/speckit.tasksmapsdata-model.mdentities to user stories (templates/commands/tasks.md, "From Data Model" section) but never instructed the agent to carry field-level constraints (max length, nullable/required, enum values, validation rules) into the generated task text. Left to the agent's discretion, a constraint present indata-model.mdcan be silently dropped fromtasks.md, and the implementing agent then invents its own value (e.g. the reporter'sdata-model.mdsaidSuspendReason nvarchar(200)but the generated code usedSuspendReasonMaxLength = 500becausetasks.mdnever repeated the200constraint for that field).Fix
Added one bullet to the "From Data Model" task-organization rule in
templates/commands/tasks.mdrequiring that field constraints fromdata-model.mdbe quoted verbatim in the corresponding task description, so the value isn't left to implementation-time discretion.This is a prompt-only change — no Python code, no breaking changes.
Testing
Added
tests/test_tasks_template_constraints.py, which asserts the "From Data Model" section oftemplates/commands/tasks.mdmentions carrying constraints forward.Verified the test fails without the fix and passes with it:
Full suite:
The 10 failures are pre-existing and unrelated to this change — they are all
*_python_paritytests exercising the "composed" preset variant (test_check_prerequisites_python_parity.py,test_create_new_feature_python_parity.py,test_resolve_template_python_parity.py,test_setup_plan_python_parity.py,test_setup_tasks_python_parity.py). I confirmed the identical 10 tests fail on a clean checkout ofupstream/mainwith no changes applied, in this sandbox (likely missing an environment prerequisite for the composed-preset fixtures, e.g. PowerShell). All tests in the affected files pass individually in isolation.AI Disclosure
I did use AI assistance (Claude, via Claude Code) to investigate the issue, write the template change, and write/verify the regression test.