Skip to content

createContributionProposal: one atomic, idempotent mutation - #5

Draft
phoebus-84 wants to merge 2 commits into
feat/atomic-accept-contributionfrom
feat/atomic-propose-contribution
Draft

phoebus-84 wants to merge 2 commits into
feat/atomic-accept-contributionfrom
feat/atomic-propose-contribution

Conversation

@phoebus-84

Copy link
Copy Markdown
Contributor

Workstream: interfacerproject/zenflows#74. Needs interfacerproject/zenflows#77 on the server. Stacked on #4 → #3 → #2. Draft.

What

  • resources.createContributionProposal({ resourceForkedId, resourceOriginId, name?, note? }) → { proposalId, processId, citeIntentId, acceptIntentId, modifyIntentId, created }.
  • One signed request. The SDK sends no process, intent, proposal or link requests and no unit lookup, and it sends no owner or proposer: the server uses the origin's controller and the signer.
  • created: false means the server returned an existing pending proposal for the same fork and origin, so a caller may retry after an uncertain outcome. The SDK itself never retries.
  • Structured FORBIDDEN / UNAUTHENTICATED / BAD_USER_INPUT errors are preserved. Invalid input (empty ids, fork = origin, non-string name/note) is rejected before any request. A malformed success is INVALID_RESPONSE.
  • The old four-request proposeContribution stays for older servers and is marked @deprecated. A new name avoids changing its signature.

Verification

  • src/__tests__/propose-contribution.test.ts: 12 tests.
  • All suites except real-backend: 132/132. typecheck, lint and build pass.
  • A real signed run against a local server with #77 comes with the GUI PR.

🤖 Generated with Claude Code

phoebus-84 and others added 2 commits October 14, 2026 11:50
createContributionProposal({resourceForkedId, resourceOriginId, name,
note}) sends zenflows' proposeContribution: one request, no owner or
proposer from the caller (the server uses the origin's controller and the
signer), no SDK retry, structured errors preserved, malformed success is
INVALID_RESPONSE. The four-request proposeContribution is deprecated.

Refs interfacerproject/zenflows#74

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…onProposal

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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