-
Notifications
You must be signed in to change notification settings - Fork 1
Description
This enhancement is ON HOLD.
A very different alternate design is being considered.
1. Summary (Required)
What is the enhancement?
Refactor the commit() function to replace the SavedHolons and AbandonedHolons relationships in the CommitResponse holon with a unified CommitOutcomes relationship. This relationship will point to a set of CommitMap holons, each representing the outcome of a commit attempt for a single StagedHolon.
2. Problem Statement (Required)
Why is this needed?
The current structure splits committed holons into separate SavedHolons and AbandonedHolons relationships. This model is insufficient for capturing richer commit metadata, such as the originating TemporaryId, the specific outcome (e.g., previously committed or failed), and fine-grained tracking of what happened per holon.
Additionally, the current design includes an outdated behavior that misinterprets Abandoned as a system-derived failure rather than a user-declared state. In the latest implementation, commit() no longer receives abandoned holons—thus making Abandoned an invalid outcome. Retaining this logic introduces confusion and incorrect categorization of errors.
3. Dependencies (Required)
Does this depend on other issues or features?
- None immediately blocking this work, but:
- Future enhancements may include moving error tracking from
StagedHolontoCommitMap. - This change will require updates to any downstream logic or client interfaces that read from the old relationships (
SavedHolons,AbandonedHolons).
- Future enhancements may include moving error tracking from
4. Proposed Solution (Required)
How would you solve it?
-
Introduce a new
CommitMapholon type. -
Modify the
commit()function to build oneCommitMapholon perStagedReference, each with the following properties:StagedTemporaryId→ the holon's originalTemporaryId.CommitOutcome→ one of:"Saved": commit succeeded or was previously saved."Error": commit failed.
SavedHolonId→ the resultingHolonId(only if outcome was"Saved").
-
Attach all
CommitMapholons to theCommitResponsevia the newCommitOutcomesrelationship. -
Remove all references to
AbandonedHolonsandSavedHolonsrelationships in this context. -
Update logic to treat
NoActionas a successful save (i.e.,"Saved"outcome). -
If
commit_holon()returnsAbandoned, treat this as a developer error (HolonError) since no abandoned holons should be passed in anymore.
Supporting Type System Changes
To support this model, we also need to extend the core value and property types:
-
Extend the
BaseValueenum to include a new variant:MapBytesValue(MapBytes)
-
Implement
ToBaseValueforMapBytesValue:impl ToBaseValue for MapBytesValue { fn to_base_value(self) -> BaseValue { BaseValue::MapBytesValue(self) } }
-
Define Uuid as a ValueType that maps to MapBytesValue as its BaseValue.
-
Ensure Uuid is used as ValueType for
TemporaryIdandHolonIdwhen storing them as property values. -
Register new type names in the relevant core enums:
- CoreHolonTypeName:
CommitMap
- CorePropertyTypeName:
StagedTemporaryIdSavedHolonIdCommitOutcome
- CoreValueTypeName:
UuidCommitOutcomeEnum
- CoreHolonTypeName:
These changes ensure that UUIDs are stored and typed correctly, and that the resulting CommitMap holons are fully representable and queryable within the MAP holonic system.
5. Scope and Impact (Required)
What does this impact?
- Changes the schema and output structure of the
CommitResponseholon. - Affects guest modules and clients that previously consumed
SavedHolons/AbandonedHolons. - Requires updates to tests, UI logic, and any validation scripts relying on the old structure.
- Clarifies the semantics of
Abandonedby removing it from system-assigned commit outcomes.
6. Testing Considerations (Required)
How will this enhancement be tested?
-
Unit Tests
- Ensure that for every staged holon committed, a corresponding
CommitMapis created. - Validate that correct outcomes (
Saved,Error) andHolonIds are assigned.
- Ensure that for every staged holon committed, a corresponding
-
Integration Tests
- Validate full
commit()runs with mixed outcomes, ensuring theCommitResponseholon is populated correctly. - Confirm that no
Abandonedresponses are ever returned or processed.
- Validate full
-
Regression Testing
- Ensure that behavior for already committed holons (NoAction) continues to result in valid
Savedentries. - Ensure no logic depends on the old
SavedHolonsorAbandonedHolonsrelationships.
- Ensure that behavior for already committed holons (NoAction) continues to result in valid
7. Definition of Done (Required)
When is this enhancement complete?
-
CommitMapholon type is defined with appropriate properties. -
commit()returnsCommitResponseholon withCommitOutcomesrelationship populated. - Old
SavedHolonsandAbandonedHolonsrelationships are removed from theCommitResponse. -
commit_holon()returnsHolonErrorifAbandonedis encountered. - Test suite is updated to reflect and validate new behavior.
- Client or UI consumers are updated to consume
CommitOutcomesinstead of old relationships.
Optional Details (Expand if needed)
8. Alternatives Considered
What other solutions did you think about?
- Continuing to track saved and abandoned holons separately—but this would complicate tracking per-holon metadata (e.g., commit errors, original
TemporaryId). - Embedding the outcome data in properties of the
CommitResponseholon itself—rejected due to lack of granularity and difficult lookup.
9. Risks or Concerns
What could go wrong?
- Client code not updated in sync may break if it expects old relationships.
- Failing to properly identify and handle
NoActionor previous-commit states could cause incorrect or missing entries inCommitOutcomes. - Migration path for existing
CommitResponseholons (if persisted long-term) needs to be considered.
10. Additional Context
Any supporting material?
- Internal discussion of
Abandonedas a user-driven, not system-driven, state. - GitHub Issue 352: Align commit outcomes with MAP's new data model expectations.
- Longer-term consideration: Centralizing commit errors into
CommitMapinstead ofStagedHolon.