Draft: explore v1.2 return and reversal alignment in reference server - #2
Draft: explore v1.2 return and reversal alignment in reference server#2Raafet57 wants to merge 24 commits into
Conversation
|
Hi Raafet, |
|
Hi Tom, Thanks a lot, this is very helpful. I agree with the direction: keep the current exception-family machinery in the reference server for now, without trying to lock it into the spec too early. That gives us something concrete to test ideas against while the broader investigation/API design matures. One thing I would like to set up next is something more visual around the flows. Not just code and YAML, but a simple way to see the lifecycle:
My thinking is that a visual reference, maybe sequence diagrams or a lightweight interactive flow map, would make the design discussion much easier. It could show what is already implemented, what is intentionally draft, and what is still open for future spec work. What do you think? Would that be useful from your side, and is there a visual format you would prefer for this kind of spec/reference implementation discussion? Best, |
|
Hi Raafet. |
|
Hi Tom, thanks, that makes sense. I started turning this into a visual reference rather than adding more API shape into the PR. The direction I am testing is:
I also mocked up a short visual flow/video locally to test whether this helps reviewers orient before reading the YAML. I will keep this PR as draft and avoid expanding the normative surface here. If the visual direction is useful, I can tighten it into a narrower v1.2-oriented artifact next, especially around E&I and liquidity management once you have the direction you want there. |
|
Hi Tom, Small fix: GitHub was not displaying the first MP4 nicely in the file viewer, so I added a lightweight 720p review copy as the primary video link. For now, here are the two lightweight review assets:
I also kept If this visual direction is useful, I can keep the PR as draft and later make a small GitHub Pages preview from my fork, separate from any normative spec changes. |
|
Hi Tom, I tightened the visual/reference artifacts on this draft branch around the lifecycle boundary we discussed. What changed:
Review assets:
I am still treating these as non-normative discussion aids for the draft PR. They do not add API scope, and the E&I/investigation lane remains draft/TBD. If this visual direction works, the next pass can stay focused on E&I and liquidity-management framing. |

Draft note for Tom
Hi Tom,
I am keeping this as a draft PR, not a request for immediate merge.
I wanted to keep the work on a separate branch while giving you something concrete and executable to inspect. My goal is to test whether my reference-server and conformance work can line up with your upstream
instruction-api-v1.2.yamldirection, especially the return and reversal paths, without presenting it as a competing standard or forcing a merge decision before the semantics are agreed.Branch under test:
Raafet57:feat/demo-frontendWhat I tried to accomplish
My fork already had an executable reference stack around instruction submission, execution and finality evidence, reporting, webhooks, and an exception-family model for investigations and returns.
When I compared that with your upstream v1.2 instruction API, the main gap was that my fork still exposed its own exception-family surfaces while your spec now defines canonical instruction-level paths:
POST /instruction/{instructionId}/returnPOST /instruction/{instructionId}/reverseGET /instruction/{instructionId}/reversal-statusSo this draft PR tries to make my fork behave as an executable stress test of your v1.2 shape:
Adopt your paths as the public surface.
The reference server now implements the three v1.2 paths above so a reviewer can inspect behavior through your API shape, rather than through a separate return/reversal API.
Map those paths onto the existing exception-family runtime.
The existing
RETURN, investigation, and operator-audit machinery remains the backing model, but Tom v1.2 requests are marked and shaped so the public contract follows your API.Keep on-chain finality semantics honest.
The implementation does not mutate or rewrite the original final instruction. A final on-chain payment remains final. Any remediation happens through a new compensating instruction or a reversal-request workflow.
Create executable evidence instead of only documentation.
The tests exercise successful and negative cases against the reference server, including response shapes, validation, duplicate active return/reversal protection, and the rule that
REVERSALrequests do not leak through the legacy/exceptions/returnslist/detail routes.What changed in this branch
POST /instruction/{instructionId}/returnI implemented this as a compensating-return flow:
ReturnRequest;FINAL;RETURNcase in the existing exception-family store;CompensatingInstructionResponse-style body:compensating_instruction_idcompensating_uetroriginal_instruction_idreturn_identificationstatus: PENDINGaccepted_atPOST /instruction/{instructionId}/reverseI implemented this as a reversal request, not a literal chain undo:
ReversalRequest;FINAL;REVERSALexception-family case inREQUESTEDstate;REQUESTED;ReversalRequestResponse-style body.GET /instruction/{instructionId}/reversal-statusI implemented this as the polling fallback/status read:
ReversalRequestStatusfield set;REQUESTED.Legacy exception-family guardrail
/exceptions/returnslist/detail now filters outREVERSALcases so a reversal request does not appear as an ordinary return case in my existing fork-specific surfaces.Verification performed
Local verification on the branch:
cd reference-server && npm ci && npm testpassed during the reconciliation pass.cd reference-server && npm testreported56 passed / 0 failedafter final patches.git diff --checkpassed.APPROVED, with no blockers and no non-blocking notes.Things where I need your guidance
These are the points I wanted surfaced explicitly rather than hidden in implementation detail.
1. Does
reversemean the right thing for irreversible on-chain settlement?The draft implementation treats
reverseas a request/compensation workflow. It deliberately does not imply that the original on-chain transfer can be unwound.Questions for you:
reversethe term you want to keep in the public API, with this compensating-flow discipline explained in the spec?2. ISO 20022 alignment:
pacs.004,pacs.007,camt.056,camt.029This draft treats:
/returnas closest to apacs.004-like compensating return/remediation flow;/reverseas following your v1.2 reversal request/status framing;Questions for you:
pacs.007for/reverse?camt.056/camt.029style investigation and cancellation flows?3. Should
status-requestexist in this phase?My fork had ideas around status and investigation surfaces, but this PR intentionally does not add a
status-requestpath.Questions for you:
status-requestdisappear from this contribution entirely?4. Is the exception-family backing model useful or too fork-specific?
This branch keeps the exception-family model as the internal backing store because it gives the reference server auditability and operator workflow without changing the public Tom v1.2 path names.
Question for you:
5. Should this branch be split further before any merge consideration?
This draft branch also contains my earlier static demo frontend commit. If you want to review only the v1.2 reconciliation, I can keep this as a draft and split the work into a narrower branch/PR.
Questions for you:
Suggested review posture
Please treat this as a concrete proposal and discussion artifact:
If the direction is useful, I can tighten the branch based on your answers. If not, I can keep it separate as a draft branch and avoid merging it upstream.