Repository navigation
Atomic, idempotent proposeContribution (owner = origin controller) - #77
Draft
phoebus-84 wants to merge 2 commits into
Draft
phoebus-84 wants to merge 2 commits into
phoebus-84 wants to merge 2 commits into
Conversation
proposeContribution(resourceForkedId, resourceOriginId, name, note) creates the signer's process, the cite/accept/modify intents, the proposal and its three links in one transaction, through the existing domain functions and policy. The owner is the origin's controller (Person or Organization), not its primaryAccountable; the signer must control the fork. An existing pending proposal by the same signer for the same fork and origin is returned (created: false). Intent quantities follow each resource's on-hand quantity and unit, as acceptance requires. Refs #74 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 14, 2026
Draft
Draft
Collaborator
Author
|
Merged the #76 update (a31d216: acceptance finishes the intents) into this branch (1fcc687) rather than rebasing, to keep the published history. Targeted 28/28; real signed propose → accept re-run green. A proposal accepted this way is no longer pending, so the same fork → origin can be proposed again. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Workstream: #74 (non-closing reference). Stacked on #76 → #75 → #73 → #72 → #71. Draft: nothing to merge or deploy.
Why
The GUI's
propose_contribution.tsx(and the SDK'sproposeContribution) create a proposal in four non-transactional requests: process, proposal, three intents, three links. This causes three problems:primaryAccountable. When that isn't the controller, nobody can accept: the named party lacks control and the controller isn't named.What
proposeContribution(resourceForkedId, resourceOriginId, name, note)→{ proposal process citeIntent acceptIntent modifyIntent created }, in one transaction, through the existingProcess/Intent/Proposal/ProposedIntentdomain functions and their policy.resource.updateon it). Otherwise anyone could submit someone else's work, and acceptance would append it to the origin's relations.created: false. After a rejection or acceptance, a new one can be made.acceptContribution(Atomic, idempotent acceptContribution for contribution proposals #76) needs.BAD_USER_INPUT. A fork the signer doesn't control →FORBIDDEN. Any later failure rolls everything back.FOR UPDATE, ascending id, first (same order as Atomic, idempotent acceptContribution for contribution proposals #76), which serializes concurrent proposals for the same pair.Design:
docs/atomic-propose-contribution.md.Verification (local sandbox)
test/authz/propose_contribution.test.exs: 8 tests.primaryAccountableis someone else, end to end throughacceptContribution.FORBIDDEN, nothing written.test/authz/propose_contribution_concurrency.test.exs: 4 concurrent identical calls on separate connections → one proposal, every caller gets it,createdis true exactly once.classifications/1, a known failure;claimable_agents defaults to empty, from the local stack config;DB.Pagecursor test. It is pre-existing and now explained:ID.gen/0is a ULID with millisecond time + 10 random bytes, so people created in the same millisecond are not ordered, and the page test's tight insert loop assumes they are. This also explains the note on Atomic, idempotent acceptContribution for contribution proposals #76.Not in this PR
acceptevent rule; with an Organization owner, custody must be the Organization's.🤖 Generated with Claude Code