Skip to content

Spec-driven change from a spec file - #25

Closed
dev-agentic-platform[bot] wants to merge 3 commits into
masterfrom
agent/86ea4717-7887-4217-8eba-43c70d8ad16b/implement
Closed

dev-agentic-platform[bot] wants to merge 3 commits into
masterfrom
agent/86ea4717-7887-4217-8eba-43c70d8ad16b/implement

Conversation

@dev-agentic-platform

Copy link
Copy Markdown

Agents specified, planned, built and reviewed this change from a spec file; the specification and the change were approved at gates before this pull request was opened. The specification, plan and tasks are under specs/. Review it as you would any change: agents can be wrong.

Spec file: gilded_rose_new_product_business_rules.md

Summary

Adds a Mature Cheese product to the proposed code only. The original code is untouched. It is matched by exact name only. Quality rises by 1 while sellIn > 0 and by 2 when sellIn <= 0, and it is capped at 50 and never goes below 0. sellIn drops by 1 per update.

Requirements met

  • FR-01 (BR-01): sellIn decreases by 1 per update.
  • FR-02 / FR-03 (BR-02, BR-03): +1 when sellIn > 0, +2 when sellIn <= 0. The check uses sellIn before the decrement.
  • FR-04 / FR-05 (BR-04, BR-05): Quality stays within 0–50. The rule calls the existing Quality.Increase(n), which does the clamping. I did not read Quality itself, so the clamping is taken from the engineer's report.
  • FR-06 (BR-06): Only the exact name Mature Cheese matches. Similar names fall back to the standard rule.
  • FR-07 (BR-07): The Aged Brie, Backstage, Conjured, Sulfuras and standard branches are unchanged.
  • FR-08 (BR-08): The sellIn and quality changes happen only inside the update.

Changes by file

  • src/Core/ProposedCode/Domain/ItemKind.cs: adds a MatureCheese kind and maps "Mature Cheese" to it in FromName.
  • src/Core/ProposedCode/Domain/ItemMaturingPolicy.cs: adds a MatureCheese case to the switch and a separate MatureMatureCheese method, so the rule is isolated and easy to test.
  • tests/Core.Tests/ProposedCode/Domain/ItemKindTests.cs: tests exact and similar-name mapping.
  • tests/Core.Tests/ProposedCode/Domain/ItemMaturingPolicyTests.cs: tests the sell-by cases, quality boundaries, invalid imported values, repeated updates, and regression of existing products.
  • tests/Core.Tests/ProposedCode/ItemMaturationServiceTests.cs: tests returned values, input immutability, mixed inventories over consecutive updates, and existing-product regressions.

How to check

Run dotnet test and confirm the new ProposedCode tests pass. The acceptance examples to look for are:

  • 5/10 → 4/11
  • 1/10 → 0/11
  • 0/10 → -1/12
  • -1/10 → -2/12
  • 0/49 → -1/50
  • 5/50 → 4/50

The engineer could not run the tests in their environment, so the tests have not been run.

agentic-dev agent and others added 3 commits November 22, 2026 19:36
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