- Plannerstate: Complete
- DB Designerstate: Complete
- Reviewstate: Not started · no automated review recorded for this stage
- Fixstate: Not started
- Human gatestate: Waiting · ready for review (current step)
MP-701
Raw Materials - Multisourcing - Ticket 1 : dedicated tab and group management
Ready for review · human_gate- Jira status
- DB Review
- Stage
- Human review
- Your move
- Ready for review — non-blocking recommendations are available.
Ready for your review in Jira (DB Review) since 3 days.
- Jira
- Jira confirmed
- Jira read
- Lifecycle activity
- · Agent run
Database design to review
- Migrations
- Design only — no migration included
- API impact
- 10 API impacts described
- Published commit
396b8b28f3fa
API impacts10
Agent-generated evidence — verify before acting
| Endpoint | Change | Reason |
|---|---|---|
GET /v1/raw-materials/{id}/multisourcing-group | Served by a lookup on multisourcing_group_member.rawmaterial_id (unique), joined to multisourcing_group, with memberCount as a COUNT projection. 404 means the material is in no group. | The mock's getGroupForRawMaterial swap marker; the unique key on rawmaterial_id is the at-most-one-group invariant and also the index this read uses (design Q1). |
GET /v1/raw-materials/{id}/multisourcing-group/candidates?search= | Set-equality query over the persisted identity rows (substance_id, percentage NUMERIC(10,6)), plus active = TRUE and not-already-a-member; search is literal containment over the joined code and name. Row cap undecided: Pageable or a stated hard cap. | AC4, enforced server-side on the substance id and never a name. The mock marker asks for a persisted, indexed identity so this is an equality probe, not a per-request re-derivation; the row cap is the one shape the mock leaves open (question 2). |
POST /v1/multisourcing-groups | One transaction: the group row, one member row, and N identity rows aggregated as SUM(percentage_used) GROUP BY substance_id over the founding material's ACTIVE composition. Duplicate-code pre-check on LOWER(code), backed by the unique index. | AC6 and AC-E2 need the refusal in any letter case across active and inactive groups; the identity rows are written once here and never recomputed (design section 5), and SUM hides a NULL percentage so the writer must assert completeness itself. |
PUT /v1/raw-materials/{id}/multisourcing-group | Re-checks the identity rule for the single target and that the target is active, then inserts one member row; the unique key on rawmaterial_id is the ALREADY_IN_GROUP backstop. | The candidate list is a read and can go stale; a retired group must never be rejoinable under its historical code, which is a service rule because active is a legal value of a legal row. |
DELETE /v1/raw-materials/{id}/multisourcing-group | Deletes one multisourcing_group_member row, counts the remaining members and sets active = FALSE when it reaches zero. Idempotent; touches no pricing table. | AC8: the group is never deleted, and no pricing table appears in either statement, which is what makes 'leaving touches no pricing data' structural rather than a promise. |
GET /v1/multisourcing-groups?search=&page=&size=&sort=code,asc,ignorecase | Paged read over every group, active and inactive, ordered by LOWER(code) (the same expression as the unique index), with totalElements from COUNT(*) and memberCount from a COUNT projection; search is literal containment over the space-joined code, name and comment, applied before the page is cut. | AC-E4 to AC-E6. No compatibility, activity or membership filter may be applied here; the emitted SQL must spell LOWER(code) for the index to serve the order. |
PATCH /v1/multisourcing-groups/{groupId} | Updates code, name and comment only, with the duplicate-code check excluding the edited row (id <> :groupId). Name and comment are clearable: plain nullable request components assigned unconditionally, never Optional<T>. | AC-E1 to AC-E3. The identity rows, the member list and active are never touched by this write, which is what makes editing from a catalog of retired groups safe; Jackson maps an omitted key and an explicit null alike to Optional.empty(), which would silently discard a clear. |
DELETE /v1/raw-materials/{id} (existing) | Must delete the raw material's multisourcing_group_member row and deactivate an emptied group before deleting the material; fk_multisourcing_group_member_rawmaterial is ON DELETE RESTRICT, so omitting the step aborts the delete. | RawMaterialService.delete removes children by explicit repository call, so a new table is not in that list; under ON DELETE CASCADE the member row would vanish with no service code running and AC8's deactivation would be skipped silently. |
DELETE /v1/substances/{id} (existing) | Needs a pre-check against multisourcing_group_composition producing a readable in-use refusal; fk_multisourcing_group_composition_substance is ON DELETE RESTRICT. | SubstanceService.delete carries no in-use guard today, so without the pre-check the new foreign key turns that endpoint into a raw constraint error rather than a refusal a user can act on. |
/v1/raw-materials/{rawMaterialId}/multi-sourcing (existing, removed) | All five endpoints are removed with the legacy stack (entity, DTOs, mapper, repository, service, controller) and the RawMaterialService call site, in the same change as DROP TABLE rawmaterial_multisourcing. | AC9's sweep. ddl-auto is validate, so the entity and the drop must land together; the ticket's description of the stack as unused is true of the frontend only, as the controller is mounted and the table is writable today. |
ProvenanceTechnical
- Repository
cosmocomply/monorepo- Published commit
396b8b28f3fa- Push receipt
push-1246- Design document blob
94819597258c- Design artifact
workflow-artifact-e0bd6af273adbee1f23548ff195061aa3bd9f1f3·e0bd6af273ad· 2026-10-14 06:36Z- Accepted by handoff
workflow-handoff-09c8980a9693f80c88f6953d90942988·CLEAN·e374194c6081· 2026-10-14 06:36Z- Validated against contract
feature-contract/v2.1·46f9da7f4aa4- Produced by
db-designer-mp-701-09c8980a
Required action
- Step
- Human gate: Waiting (ready for review)
- Run
09c8980a9693f80c88f6953d90942988- Evidence source
gate jira:MP-701:db_review- Stop class
- No open stop
Source freshness
- Jira
- Jira confirmed ·
fresh - Jira read
- Lifecycle activity
- · Agent run ·
agent-run - Jira updated
- Status entered
- Newest evidence
- · 3 d
- Stale after
- 30 days
- Projected
Runs and records timeline
- Resume resume ·
ACCEPTEDworkflow-artifact-resume-mp-701-17739·7e0899f08235 - Resume resume ·
REFUSEDworkflow-artifact-resume-mp-701-17738·22ddc04c6d09 - Stop plan (db) ·
FAILED· route-not-readyworkflow-failure-dd9ff9ab37aa59eae5305f431e888b44·c881239a7af9· run - Run feature-planner ·
FAILED· PLANNER_HANDOFF_REJECTED: handoff-pending-expiredfeature-planner-mp-701-41410954·5e62a467fa51· run - Stop plan (db) ·
FAILED· handoff-pending-expiredworkflow-failure-41410954a6f7a66aa75910f9750b6714·970fd4f5a00b· run - Artifact review-findings
workflow-artifact-7bb2e27e67462ee702d9ae24a24e986feedbefb6·7bb2e27e6746· run - Artifact fix-report
workflow-artifact-03963c4563c5583fb29f9cce4aa87c28525644c3·03963c4563c5· run - Artifact review-findings
workflow-artifact-08985601dec21dc730ab21f1d89b7dc54f87111d·08985601dec2· run - Handoff review (mock) ·
ISSUESworkflow-handoff-7a21c4091b7796f617939f1d10a90ddb·f26139a86f31· run - Artifact fix-report
workflow-artifact-0d45ce0a75477e08dd231b06f340a8b005c3369f·0d45ce0a7547· run - Artifact review-findings
workflow-artifact-7d9ce6a40d2f6f87e4a2f663b9e5c3640040d522·7d9ce6a40d2f· run - Handoff review (mock) ·
ISSUESworkflow-handoff-c1f07b83583251465fd14533600d8513·a2a3312ea6fd· run - Artifact fix-report
workflow-artifact-1c010a9c67fadd5bb658041f0a878d09cd298ed3·1c010a9c67fa· run - Artifact review-findings
workflow-artifact-9d6fd700c7b9d00f61519d691b83cffd34452e26·9d6fd700c7b9· run - Handoff review (mock) ·
ISSUESworkflow-handoff-bb8c5e8308c1a3ad3613e992c9cfc43b·fd35ef3ac441· run - Artifact fix-report
workflow-artifact-d73c0a433c2be750c62a18e63afc4a7a7fb271a8·d73c0a433c2b· run - Artifact review-findings
workflow-artifact-0c42773c7a368eafc8ede7acad89c9997b43bce4·0c42773c7a36· run - Handoff review (mock) ·
ISSUESworkflow-handoff-ff2c90c3ea495a3f6401477dcd1c5f85·086909ad91e4· run - Artifact fix-report
workflow-artifact-aaeecf5367b2a1fc93f1b1acb4c3c432ee8da83b·aaeecf5367b2· run - …66 older entries on the technical ticket view.
Inputs, outputs and lineage
Output commits and push receipts
- Local (attempted) commit — diagnostic only
3812a9930173- Published commit (Broker receipt push-1246)
396b8b28f3fa- Verified PR head
396b8b28f3fa- Output record
workflow-artifact-e0bd6af273adbee1f23548ff195061aa3bd9f1f3· db-design · 2026-10-14 06:36Z- Receipt id
push-1246- Audit id
1246- Branch
claude/mock-MP-701-multisourcing-groups- Expected parent
e07342b83f73- Remote SHA (from GitHub, via the Broker)
396b8b28f3fa- PR head
396b8b28f3fa- Receipt count
- 1
- Lineage
e07342b83f73→396b8b28f3fa- Validation result
- accepted ·
workflow-handoff-09c8980a9693f80c88f6953d90942988
| Role | Record | sha256 | Status |
|---|---|---|---|
| handoff | workflow-handoff-09c8980a9693f80c88f6953d90942988 | e374194c608103c5 | collected |
| artifact | workflow-artifact-e0bd6af273adbee1f23548ff195061aa3bd9f1f3 | e0bd6af273adbee1 | ok |
| handoff | workflow-handoff-09c8980a9693f80c88f6953d90942988 | e374194c608103c5 | ok |
Agent work requests and routing evidence
No agent work request for this ticket.
Review findings and routing
This gate concerns the database design: no automated review is recorded for it, and the human DB review is the check. Accepting the design establishes no implementation or testing outcome.
GPU / RAG sessions and spend
- Model cost
- $490.2033
- GPU cost
- $0.5460
- Run spend (sum)
- $950.6403
Planner cc1fb3c5c9d1 · CLOSED · $0.1750
- State
- CLOSED
- GPU class
- A6000
- Provider
- lium
- Requested
- 2026-10-14T05:08:56Z
- Ready
- 2026-10-14T05:14:01Z
- Closed
- 2026-10-14T05:33:14Z
- Estimated GPU cost
- $0.1750
- Budget cap
- $10.00
- Cleanup
- VERIFIED
- Provisioning deadline
- 2026-10-14T05:38:56Z
- Session deadline
- 2026-10-14T06:28:56Z
- Session id (hash)
- ceeae8c8cf61
- Session binding
- 9c50fc525ca1
Planner 0313a8472619 · CLOSED · $0.1470
- State
- CLOSED
- GPU class
- A6000
- Provider
- lium
- Requested
- 2026-10-07T22:12:49Z
- Ready
- 2026-10-07T22:19:58Z
- Closed
- 2026-10-07T22:33:01Z
- Estimated GPU cost
- $0.1470
- Budget cap
- $2.50
- Cleanup
- VERIFIED
- Provisioning deadline
- 2026-10-07T22:42:49Z
- Session deadline
- 2026-10-07T23:32:49Z
- Session id (hash)
- 718219602ace
- Session binding
- 54f21d5d826b
Resume status
Resume available: no open stop record
- 2026-10-14 05:08Z ·
ACCEPTED - 2026-10-13 23:25Z ·
REFUSED·resume-artifact-unverified· A record the continuation depends on no longer verifies. - 2026-10-10 21:47Z ·
ACCEPTED - 2026-10-10 19:03Z ·
ACCEPTED
Historical attempts
- Earlier stage Fix: Complete · 2026-10-11 03:21Z ·
run ea99c0abf10cbd1d8cabd430b2a4589f - Earlier stage Review: Complete · clean · 2026-10-11 03:51Z ·
run 6618083e441b230de021bd55903db8bd
- History Handoff: Technically validated · Database · 2026-10-14 06:36Z
- History Handoff: Technically validated · Plan · 2026-10-14 05:33Z
- History Handoff: Handoff not accepted · Plan · 2026-10-13 20:17Z
- History Stop record: Technical failure, no work lost · Plan · 2026-10-13 20:17Z
- History Stop record: Technical failure, no work lost · Plan · 2026-10-13 19:48Z
- History Handoff: Technically validated · Review · 2026-10-11 03:51Z
- History Handoff: Technically validated · Review · 2026-10-11 03:21Z
- History Handoff: Corrections requested · Review · 2026-10-11 03:11Z
- History Handoff: Technically validated · Review · 2026-10-11 02:45Z
- History Handoff: Corrections requested · Review · 2026-10-11 02:34Z
- History Handoff: Technically validated · Review · 2026-10-11 02:06Z
- History Handoff: Corrections requested · Review · 2026-10-11 01:48Z
- History Handoff: Corrections requested · Review · 2026-10-11 01:13Z
- History Handoff: Corrections requested · Review · 2026-10-11 00:50Z
- History Handoff: Technically validated · Review · 2026-10-11 00:22Z
- History Handoff: Corrections requested · Review · 2026-10-10 23:51Z
- History Handoff: Technically validated · Review · 2026-10-10 23:18Z
- History Handoff: Corrections requested · Review · 2026-10-10 23:03Z
- History Handoff: Technically validated · Review · 2026-10-10 22:25Z
- History Handoff: Corrections requested · Review · 2026-10-10 22:14Z
Raw records and logs
Raw
Raw records and logs are never loaded on this page. Open them on the technical views: