Skip to content

feat(tree): implement isAuditableFromOutcome#27263

Open
jason-ha wants to merge 5 commits into
mainfrom
tree/ado-56693-is-auditable-from-outcome
Open

feat(tree): implement isAuditableFromOutcome#27263
jason-ha wants to merge 5 commits into
mainfrom
tree/ado-56693-is-auditable-from-outcome

Conversation

@jason-ha
Copy link
Copy Markdown
Contributor

@jason-ha jason-ha commented May 7, 2026

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

jason-ha and others added 3 commits May 7, 2026 19:46
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>
@jason-ha jason-ha requested review from Copilot and yann-achard-MS May 7, 2026 21:59
@jason-ha jason-ha requested a review from a team as a code owner May 7, 2026 21:59
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

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:

  • Correctness — logic errors, race conditions, lifecycle issues
  • Security — vulnerabilities, secret exposure, injection
  • API Compatibility — breaking changes, release tags, type design
  • Performance — algorithmic regressions, memory leaks
  • Testing — coverage gaps, hollow tests

How this works

  • Adjust the reviewer set by ticking/unticking boxes above. Reviewer toggles alone don't trigger anything.

  • Tick Start review below to dispatch the review fleet.

  • After review finishes, tick Start review again to request another run — it auto-resets after each dispatch.

  • This comment updates as new commits land; your reviewer selections are preserved.

  • Start review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ModularChangeset to extend Readonly<HasFieldChanges> to resolve readonly compatibility around fieldChanges.

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.

Comment thread packages/dds/tree/src/test/shared-tree/isAuditableFromOutcome.spec.ts Outdated
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.

2 participants