feat(tree): implement isAuditableFromOutcome#27263
Conversation
Adds a not-yet-implemented stub for `isAuditableFromOutcome` in `packages/dds/tree/src/shared-tree/` and a TDD test suite covering the three auditability rules from ADO 56693: more than one inner change, any schema change, or a data change with violated constraints. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Returns false when the change has more than one inner change, contains a schema change, or contains a data change with violated constraints. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hi! Thank you for opening this PR. Want me to review it? Based on the diff (319 lines, 3 files), I've queued these reviewers:
How this works
|
There was a problem hiding this comment.
Pull request overview
Adds a small SharedTree utility to decide whether a SharedTreeChange can be audited purely from post-apply outcome (HitL scenario), and introduces targeted unit tests for the new behavior. Also tightens ModularChangeset’s relationship to HasFieldChanges to align with readonly usage.
Changes:
- Added
isAuditableFromOutcome(change)helper to reject non-auditable change shapes (multiple inner changes, any schema change, or violated constraints). - Added a new spec file covering empty, single-data, multi-inner, schema, and constraint-violation cases.
- Updated
ModularChangesetto extendReadonly<HasFieldChanges>to resolve readonly compatibility aroundfieldChanges.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/dds/tree/src/test/shared-tree/isAuditableFromOutcome.spec.ts | Adds unit tests validating auditable vs non-auditable SharedTreeChange outcomes. |
| packages/dds/tree/src/shared-tree/isAuditableFromOutcome.ts | Introduces the new auditability predicate implementation. |
| packages/dds/tree/src/feature-libraries/modular-schema/modularChangeTypes.ts | Adjusts ModularChangeset inheritance to be readonly-compatible with HasFieldChanges. |
AB#56693
isAuditableFromOutcome - Returns false when the change has more than one inner change, contains a schema change, or contains a data change with violated constraints.
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com