- 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-723
Formulation - Formulas - Operating procedures - Ticket 1 : free-text procedures (general, per phase, per line) and phase rename (frontend + db + backend)
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 1 hour.
- Jira
- Jira confirmed
- Jira read
- Lifecycle activity
- · Agent run
Database design to review
- Design document
- docs/superpowers/specs/2026-10-17-MP-723-operating-procedures-db-schema.md (opens in a new tab)
- Migrations
- Design only — no migration included
Why no schema change is needed (the DB Designer)
Agent-generated evidence — verify before acting
migrations is empty because no migration FILE belongs to this stage, not because no schema change is needed. This repository's lifecycle has the designer produce the design document, with illustrative SQL only; the canonical migration is authored by the Backend Builder AFTER a human approves it at DB Review. The stage plan makes it a hard limit ('Design document only - no Flyway file, no entity, no backend or frontend code'; 'Next free Flyway version is V035; name it, do not create it'). The schema change proposed, for that migration to carry: ONE file at V035 (V034 is the highest at the base; out-of-order is false, so re-check before merge) with three ADD COLUMN statements - formula.operating_procedure TEXT (AC1), formula_phase.operating_procedure TEXT (AC2), formula_phase_line.instruction TEXT (AC3). Each nullable, no default, no backfill, so it is metadata-only and cannot abort on populated tables. TEXT not VARCHAR(n) because AC13 forbids a length limit. No new table, index, constraint, FK, enum or reference-data row; no existing column changed. One String entity field per table lands in the same change, mapped columnDefinition = "TEXT" with no length. Four criteria need no schema, recorded so the Backend stage invents none: AC6/AC7 reuse formula_phase.label and its per-formula unique constraint on trimmed labels, AC9 the composition lock guard, AC11 formula_audit_event with its seeded ATTRIBUTE_MODIFIED type. AC4, AC5 and AC10 are client view state, persisted nowhere. Gate: four read-only critics, five rounds, one anonymous peer round. No BLOCKER and no schema error in any round. Round 5's three fixes landed after the bound was reached and are not themselves critic-verified; all three correct prose contradictions and are listed in section 12. context7 was down all run, so four version claims are marked unverified upstream and grounded in-repo instead. Five open questions are flagged for DB Review; only OQ2 and OQ1 could change V035.
- API impact
- 8 API impacts described
- Published commit
e4c9973a34fa
API impacts8
Agent-generated evidence — verify before acting
| Endpoint | Change | Reason |
|---|---|---|
GET /v1/formulas/{formulaId}/procedures | New endpoint. Returns { formulaId, general, byPhaseId, byLineId } read from the three new columns in one pass: formula.operating_procedure, plus the per-phase and per-line projections keyed by formula_phase.id and formula_phase_line.id. | The approved mock's getFormulaProcedures pins this signature. Served by the formula PK read plus the composition read that idx_formula_phase_line_formula_id and uq_formula_phase_formula_label's leading formula_id already serve, so no new index. |
PUT /v1/formulas/{formulaId}/procedures/general | New endpoint. Writes formula.operating_procedure. NULL means not set and the response serves ""; a blank or whitespace-only write is stored as NULL. | AC1. The empty convention follows FormulaCompositionService#normalizeLot so that 'not set' has one spelling in the database; this differs from formula.notes, which stores '' (disclosed as OQ3). |
PUT /v1/formulas/{formulaId}/phases/{phaseId}/procedure | New endpoint. Writes formula_phase.operating_procedure WHERE id = phaseId. Refused on a locked composition by the existing loadUnlockedFormula guard. | AC2 and AC9. Keyed on the phase id, not the label, so AC6's rename keeps the procedure; no new lock mechanism and no new column for the lock. |
PUT /v1/formulas/{formulaId}/lines/{lineId}/instruction | New endpoint. Writes formula_phase_line.instruction WHERE id = lineId. Must NOT be refused when the line holds no raw material. | AC3. The instruction rides the line row's identity, so a reorder, a phase-cell change, a drag and a phase rename all leave it on its line. rawmaterial_id is nullable (V032:67) and the approved mock renders an editable area for a material-less line. |
PATCH /v1/formulas/{formulaId}/phases/{phaseId} | New route. Updates formula_phase.label on one row, keeping its id and sort_order. Must apply normalizePhase's strip() and MAX_LABEL_LENGTH refusal before its uniqueness pre-check and before the UPDATE. | AC6 and AC7, with no schema change: uq_formula_phase_formula_label (formula_id, label) is already the 'already used' rule. The constraint compares raw strings, so without the same trimming a rename to "Phase A " would sit beside "Phase A" - the artefact V032:27-30 exists to prevent. |
POST /v1/formulas (duplicate modes) - FormulaService#create, FormulaPhaseRepository#copyPhases, FormulaPhaseLineRepository#copyLines | Both native INSERT ... SELECT statements must add the new column to their enumerated column list and SELECT (p.operating_procedure, l.instruction - NOT NULL, unlike lot and batch). FormulaService#create must set operatingProcedure from source.getOperatingProcedure() when duplicating. | AC12, and the one way this design fails silently: an unlisted column is not copied, with no error anywhere. copyComposition never touches the formula row and create builds the entity from request.notes(), so the general procedure is not copied by the composition path. Needs a duplication test. |
GET /v1/formulas/{id}/audit-events (existing read; new entries written on every procedure write and rename) | No schema change. Raise ATTRIBUTE_MODIFIED events through FormulaAuditService#recordAttributeModified, with a fixed field key in attribute, the texts in previous_value / new_value (both TEXT, so AC11 and AC13 compose), and the subject in detail (TEXT). | AC11 asks for how attribute changes are recorded today, so no event type is seeded and V035 stays pure DDL. attribute is VARCHAR(100) and a label can be 255 chars, so the identifier goes in detail, carrying the line's id as text (a name can be NULL, a position is rewritten by renumber()). See OQ2. |
All five procedure routes, on a locked composition | No schema change. Every procedure write and the rename go through the existing FormulaCompositionService#loadUnlockedFormula guard, which throws BusinessRuleException("exception.formula.composition.locked") when the formula's status row has locksComposition. | AC9 asks the server to refuse these writes the same way it refuses composition writes today. No new column, flag or constraint. Collapse, expand and show/hide-all never write, so the lock does not apply to them. |
ProvenanceTechnical
- Repository
cosmocomply/monorepo- Published commit
e4c9973a34fa- Push receipt
push-1343- Design document blob
feda0bfa8d4d- Design artifact
workflow-artifact-ee646aab73f213d94edd6466fa5291b05af30390·ee646aab73f2· 2026-10-17 11:00Z- Accepted by handoff
workflow-handoff-14c6836068a10c18260514067095a80c·CLEAN·76dcb6ea034b· 2026-10-17 11:00Z- Validated against contract
manifest.json·bc3106ab2915- Produced by
db-designer-mp-723-14c68360
Required action
- Step
- Human gate: Waiting (ready for review)
- Run
14c6836068a10c18260514067095a80c- Evidence source
gate jira:MP-723:db_review- Stop class
- No open stop
- Attempt
db|2026-10-17T11:52:37.508+0200 (run 14c6836068a10c18260514067095a80c)- Open requirements
- 0 open
Source freshness
- Jira
- Jira confirmed ·
fresh - Jira read
- Lifecycle activity
- · Agent run ·
agent-run - Jira updated
- Status entered
- Newest evidence
- · 0 d
- Stale after
- 30 days
- Projected
Runs and records timeline
- Artifact review-findings
workflow-artifact-7141d51ce0280a42082173f6a032a9ae1eda6dc5·7141d51ce028· run - Artifact fix-report
workflow-artifact-e7a3a54a8986ad5ea650cf75ec1d53cdc99c8c59·e7a3a54a8986· run - Artifact review-findings
workflow-artifact-af380fc60100098ab8af99f904171d42f2de7c0e·af380fc60100· run - Artifact build-report
workflow-artifact-e25f4f7d62f3f6012651d2f951233400a6dd5e74·e25f4f7d62f3· run - Run feature-planner ·
FAILED· RAG_SESSION_FAILED: rag-budget-refused: the gateway reported the session FAILEDfeature-planner-mp-723-b977184e·3830b223cba4· run - Stop plan (mock) ·
FAILED· rag-budget-refusedworkflow-failure-b977184e762c009fde441d28c4e49f8e·2dbb5b07cc77· run - Run feature-planner ·
FAILED· RAG_SESSION_FAILED: rag-budget-refused: the gateway reported the session FAILEDfeature-planner-mp-723-b411f510·3830b223cba4· run - Stop plan (mock) ·
FAILED· rag-budget-refusedworkflow-failure-b411f51057e5977a09afdf7f539092e2·ea6df44e6e96· run
Inputs, outputs and lineage
Output commits and push receipts
- Local (attempted) commit — diagnostic only
a79cef523105- Published commit (Broker receipt push-1343)
e4c9973a34fa- Verified PR head
e4c9973a34fa- Output record
workflow-artifact-ee646aab73f213d94edd6466fa5291b05af30390· db-design · 2026-10-17 11:00Z- Receipt id
push-1343- Audit id
1343- Branch
claude/mock-MP-723-operating-procedures- Expected parent
ed0ae3200407- Remote SHA (from GitHub, via the Broker)
e4c9973a34fa- PR head
e4c9973a34fa- Receipt count
- 1
- Lineage
ed0ae3200407→e4c9973a34fa- Validation result
- accepted ·
workflow-handoff-14c6836068a10c18260514067095a80c
| Role | Record | sha256 | Status |
|---|---|---|---|
| handoff | workflow-handoff-14c6836068a10c18260514067095a80c | 76dcb6ea034b3a8c | collected |
| input | workflow-artifact-c1567f9c26f39cd10467df7601c96663b12a62d9 | c1567f9c26f39cd1 | ok |
| artifact | workflow-artifact-ee646aab73f213d94edd6466fa5291b05af30390 | ee646aab73f213d9 | ok |
| handoff | workflow-handoff-14c6836068a10c18260514067095a80c | 76dcb6ea034b3a8c | ok |
Agent work requests and routing evidence
The agent work for your request has finished.
Resume work on PR #151 (branch claude/mock-MP-723-operating-procedures). Apply the PO test finding of 2026-10-16. # Composition grid, line instruction area (line-instruction-row.tsx) and phase procedure area (phase-procedure-row.tsx): the "Edit" link is right-aligned in a full-width row and is off-screen when the grid scrolls horizontally. Expected: the "Edit" link sits immediately after the area title on the left, visible without horizontal scrolling, in both areas. (AC2, AC3, PO decision 2026-10-16) Do not change the general "Operating procedure" panel, the edit/read-mode rules, or anything else in the PR.
Next: Nothing to do.
- Routing
FIX_WITHIN_SCOPE→ decisionFIX_WITHIN_SCOPE- Human finding
H1MAJORacceptance-criterionH2MAJORacceptance-criterion·workflow-artifact-c2ce39a8d229acf3c197b1754762bf25abcfc23d·c2ce39a8d229- Fix
- 2 applied (H1, H2), 0 unresolved ·
workflow-artifact-e7a3a54a8986ad5ea650cf75ec1d53cdc99c8c59·e7a3a54a8986 - Plan revision
sha256:8159c3f7c2feaca2be2a944830feaa58a6dd280a144e14b0acb15d22f0c39821· accepted planfeature-contract-c82c4c11c7f81001e5883484e719cefd·c89d0fd2da71- Bound PR / SHA
- #151 @
2bbc7d928c7b - Lifecycle
- Completed · 2026-10-16 15:03Z · Mock · request attempt (request event 17792)
- Triage RAG context
- revision
6ff9aee4994f· indexed3830b223cba4· freshnessEXACT· triage started 2026-10-16 14:47Z
Triage rationale
Agent-generated evidence — verify before acting
The request applies PO test decision C1 of 2026-10-16 (ticket comment 14074), which is already written into the ticket snapshot as an accepted criterion: AC2 states "The 'Edit' control of the phase procedure area and of the line instruction area (AC3) sits next to the area title, visible without horizontal scrolling of the grid. (PO decision 2026-10-16)". So this is an accepted criterion that is not met at head 2bbc7d92, not a new requirement. It needs no change to the accepted plan: the mock contract's frontend-plan already creates phase-procedure-row.tsx ("a sibling TableRow with COMPOSITION_COLUMN_COUNT colSpan ... shows the text and, in edit mode, the shared editor") and line-instruction-row.tsx ("a sibling colSpan TableRow ... editable in edit mode"), and nowhere fixes where the Edit control sits inside those rows. Placing it immediately after the area title is a layout detail inside two components the plan already owns, so a Fixer can satisfy it within the accepted plan. Two findings, one per named component, both acceptance-criterion (never MINOR). MAJOR rather than BLOCKER: editing still works, but only after horizontal scrolling of a grid wider than the screen, which AC2 now forbids. The request's fence (do not touch the general "Operating procedure" panel, the edit/read-mode rules, or anything else in the PR) is carried into each finding. Note on evidence: this run can read only the base at workSha 3830b223; the PR head is not mounted (no overlay, object 2bbc7d92 absent from /work), and neither row component exists at the base. The defect is taken from the PO's own test of the PR #151 preview, which is first-hand evidence at the bound head; the mock review of that same head was CLEAN and reported nothing on this placement, so no finding is withdrawn or superseded.
Human finding (as triaged)
Agent-generated evidence — verify before acting
H1: Phase procedure area: the "Edit" control is right-aligned in the full-width row and off-screen when the grid scrolls horizontally (AC2) H2: Line instruction area: the "Edit" control is right-aligned in the full-width row and off-screen when the grid scrolls horizontally (AC2/AC3)
- Event id
17792- Source
jira-changelog·customfield_10223· 2026-10-16 14:37Z- Request hash (textSha256)
32090c2ba3e905acd08a6304fef90a344896cfdabf08e93707135c09013c12da- Request record
workflow-artifact-human-request-mp-723-17792·19cf839a0372ef6e24462debcbe06d7a8d32bc67ee348df5cbb94213ae512b7d- State source
- Operator request-progress record
- Lifecycle record
workflow-artifact-request-progress-mp-723-17792-completed·0b55ae3c6affec1f4ee56c612247b40ffa5f053976fb77829955952dbe54956f·completed· nextnone· attemptmock|request:17792· runpr-reviewer-mp-723-532c67a6· 3 records- Triage run
11030ece72702d16adc50543164e856e- Routing artifact
workflow-artifact-545b05a2a18845ea1acda3a262fe923835a66710·545b05a2a18845ea1acda3a262fe923835a667101c36f2ff46467368b8b61626- Decision
workflow-artifact-human-request-decision-mp-723-17792·87b5cec2b198a6ad540450e9873ae7a4305ea9bc7f6bd573f8423487cded75af·FIX_WITHIN_SCOPE- Operator action
- transitioned to
Mock In Progress· dispatchedpr-fixer· comment none
| Id | Severity | Category | Fingerprint |
|---|---|---|---|
H1 | MAJOR | acceptance-criterion | fp-10d8853b3f3a378c |
H2 | MAJOR | acceptance-criterion | fp-8133f845c69a9f4f |
- 2026-10-16 14:37Z · Request recorded (Operator) ·
workflow-artifact-human-request-mp-723-17792·19cf839a0372 - 2026-10-16 14:37Z · Lifecycle: Accepted (Operator) ·
workflow-artifact-request-progress-mp-723-17792-accepted·55b3dbaa7286 - 2026-10-16 14:37Z · Lifecycle: Running (Operator) ·
workflow-artifact-request-progress-mp-723-17792-running·a1a4b96316c7 - 2026-10-16 14:48Z · Triage routing: FIX_WITHIN_SCOPE (Planner) ·
workflow-artifact-545b05a2a18845ea1acda3a262fe923835a66710·545b05a2a188 - 2026-10-16 14:49Z · Decision: FIX_WITHIN_SCOPE (Operator) ·
workflow-artifact-human-request-decision-mp-723-17792·87b5cec2b198 - 2026-10-16 14:49Z · Human finding (Operator) ·
workflow-artifact-c2ce39a8d229acf3c197b1754762bf25abcfc23d·c2ce39a8d229 - 2026-10-16 14:54Z · Fix report (Fixer) ·
workflow-artifact-e7a3a54a8986ad5ea650cf75ec1d53cdc99c8c59·e7a3a54a8986 - 2026-10-16 15:03Z · Lifecycle: Completed (Operator) ·
workflow-artifact-request-progress-mp-723-17792-completed·0b55ae3c6aff
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
- $80.5850
- GPU cost
- $0.3990
- Run spend (sum)
- $80.5850
Planner 91ca7a8a7fe6 · CLOSED · $0.1540
- State
- CLOSED
- GPU class
- A6000
- Provider
- lium
- Requested
- 2026-10-17T09:53:29Z
- Ready
- 2026-10-17T10:00:54Z
- Closed
- 2026-10-17T10:14:43Z
- Estimated GPU cost
- $0.1540
- Budget cap
- $10.00
- Cleanup
- VERIFIED
- Provisioning deadline
- 2026-10-17T10:23:29Z
- Session deadline
- 2026-10-17T11:13:29Z
- Session id (hash)
- 20741ce9b974
- Session binding
- ded873ff41b4
Planner c82c4c11c7f8 · CLOSED · $0.1680
- State
- CLOSED
- GPU class
- A6000
- Provider
- lium
- Requested
- 2026-10-15T19:01:18Z
- Ready
- 2026-10-15T19:08:40Z
- Closed
- 2026-10-15T19:25:07Z
- Estimated GPU cost
- $0.1680
- Budget cap
- $10.00
- Cleanup
- VERIFIED
- Provisioning deadline
- 2026-10-15T19:31:18Z
- Session deadline
- 2026-10-15T20:21:18Z
- Session id (hash)
- f20ec08535fa
- Session binding
- 9f67c087e79a
Planner b977184e762c · FAILED · $0.0000
- State
- FAILED
- Provider
- lium
- Requested
- 2026-10-15T17:52:00Z
- Closed
- 2026-10-15T17:52:06Z
- Estimated GPU cost
- $0.0000
- Budget cap
- $10.00
- Cleanup
- VERIFIED
- Rule
- rag-budget-refused
- Provisioning deadline
- 2026-10-15T18:22:00Z
- Session deadline
- 2026-10-15T19:12:00Z
- Session id (hash)
- 37f489900ca8
- Session binding
- 1fa1326507ab
Planner b411f51057e5 · FAILED · $0.0000
- State
- FAILED
- Provider
- lium
- Requested
- 2026-10-15T15:21:40Z
- Closed
- 2026-10-15T15:21:45Z
- Estimated GPU cost
- $0.0000
- Budget cap
- $10.00
- Cleanup
- VERIFIED
- Rule
- rag-budget-refused
- Provisioning deadline
- 2026-10-15T15:51:40Z
- Session deadline
- 2026-10-15T16:41:40Z
- Session id (hash)
- a187479f7444
- Session binding
- 5de008251cb2
Planner 11030ece7270 · CLOSED · $0.0770
- State
- CLOSED
- GPU class
- A6000
- Provider
- lium
- Requested
- 2026-10-16T14:38:01Z
- Ready
- 2026-10-16T14:47:02Z
- Closed
- 2026-10-16T14:49:08Z
- Estimated GPU cost
- $0.0770
- Budget cap
- $10.00
- Cleanup
- VERIFIED
- Provisioning deadline
- 2026-10-16T15:08:01Z
- Session deadline
- 2026-10-16T15:58:01Z
- Session id (hash)
- 92b8d9a8e1b1
- Session binding
- edf2e2068bb2
Resume status
Resume available: no open stop record
No Resume event recorded.
Historical attempts
- Earlier stage Fix: Complete · 2026-10-16 14:54Z ·
run a4263396fd5fd74539dc89ce3f798635 - Earlier stage Review: Complete · clean · 2026-10-16 15:03Z ·
run 532c67a6c56042a6d09c2907540ec7d4
- History Handoff: Technically validated · Database · 2026-10-17 11:00Z
- History Handoff: Technically validated · Plan · 2026-10-17 10:14Z
- History Handoff: Technically validated · Review · 2026-10-16 15:03Z
- History Handoff: Technically validated · Review · 2026-10-16 14:54Z
- History Handoff: Technically validated · Plan · 2026-10-16 14:48Z
- History Handoff: Technically validated · Review · 2026-10-15 20:20Z
- History Handoff: Technically validated · Mock · 2026-10-15 20:07Z
- History Handoff: Technically validated · Plan · 2026-10-15 19:24Z
- History Stop record: Technical failure, no work lost · Plan · 2026-10-15 17:52Z
- History Stop record: Technical failure, no work lost · Plan · 2026-10-15 15:21Z
Raw records and logs
Raw
Raw records and logs are never loaded on this page. Open them on the technical views: