Repository navigation
Conversation
… one or more owners deferred_collection_minimum only deferred a minimum such as self.books->size() >= 1 when each Book needs exactly one Library. When each Book needs one or more (1..*), the agent seeded an "Enforce ... HTTP 400" task. The generated create only links records that already exist, so the first Library has no Book to link and no Book can exist before a Library: enforced, neither class can ever get a record. Found in a generated backend during the review of #877. The gate is now a mandatory opposite end whatever its upper bound, and the report task no longer says each Book belongs to one Library.
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.
Why
For a rule like
context Library inv books_at_least_1: self.books->size() >= 1, the Spec-Driven Agent decides whether to seed an "Enforce ... HTTP 400" task or a "Report ... never refuse creating" task.deferred_collection_minimumchose "report" only when each Book needs exactly one Library (1). When each Book needs one or more (1..*), it seeded the 400 task.That makes the app unusable:
This was reproduced live in a generated backend during the review of #877:
POST /library/andPOST /book/were both refused.What
besser/spec_driven_agent/planning/model_rules.py: the gate is now "the opposite end is mandatory" (min >= 1) whatever its upper bound. The docstring is updated to match.besser/spec_driven_agent/pipeline/orchestrator.py: the report task said "Each Book belongs to one Library", which is wrong for1..*. It now says "Each Book needs a Library first".nested_creations=False, so a create never makes new related records.Tests
tests/spec_driven_agent/test_ocl_rule_seed.py:test_a_minimum_on_records_that_need_one_or_more_owners_is_not_a_refusal. It fails before the fix and passes after.(book_needs_library=True, books_in_one_library=False)case is removed fromtest_every_other_collection_rule_is_still_enforced, because it asserted the deadlocking 400.tests/spec_driven_agent: 7208 passed. 2 failed, the same 2 that fail on unchangeddevelopmenton this machine (ruffnot on the test venv's PATH).ruff check besser/passes.Overlap with #877
#877 edits the same test file: it adds a
generator_usedargument and a commit-check test with the same model. Whichever merges second needs a small rebase of that file.