Skip to content

refactor(entity): relocate analyzer/checker/pusher result types to entity#227

Draft
behinddwalls wants to merge 1 commit into
preetam/ext/conflict-target-overlapfrom
preetam/ext/result-entities
Draft

refactor(entity): relocate analyzer/checker/pusher result types to entity#227
behinddwalls wants to merge 1 commit into
preetam/ext/conflict-target-overlapfrom
preetam/ext/result-entities

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Move the domain-fact data types produced by the conflict, mergechecker, and pusher extensions into entity/submitqueue, leaving each extension with only its behavioral contract (interface, Config, Factory) and sentinels:

  • conflict.Conflict / ConflictType -> entity.Conflict / entity.ConflictType
  • mergechecker.Result -> entity.MergeResult
  • pusher.{Result,BatchOutcome,ChangeOutcome,OutcomeStatus} -> entity.{PushResult,BatchOutcome,ChangeOutcome,OutcomeStatus}

These are domain facts (a dependency-graph reason, a mergeability verdict, the commits a change produced) that the orchestrator may persist or surface. Placing them in entity/ — the universal dependency sink that storage, controllers, and extensions all already import — keeps the contract robust to future persistence without a layering inversion (storage importing a decision extension) or an import migration later. This matches what buildrunner and changeprovider already do with entity.BuildStatus / entity.ChangeInfo. The data shapes are unchanged; only their home is. pusher.ErrConflict stays in the extension (a sentinel error is part of the behavioral contract). The controllers were already type-inference-clean, so only their tests change.

Test Plan

Issues

Stack

  1. docs(rfc): extension contract — identity in, resolve internally #214
  2. feat(changeset): shared batch→changes resolver in core #216
  3. refactor(mergechecker): accept entity.Request, resolve change internally #217
  4. refactor(changeprovider): accept entity.Request, resolve change internally #218
  5. refactor(scorer): score entity.Batch, resolve changes internally #219
  6. refactor(buildrunner): trigger on batches, resolve changes internally #221
  7. refactor(pusher): push ordered batches, return per-batch outcomes #222
  8. feat(conflict): target-overlap analyzer using changeset resolver #223
  9. @ refactor(entity): relocate analyzer/checker/pusher result types to entity #227

…tity

Move the domain-fact data types produced by the conflict, mergechecker, and pusher extensions into entity/submitqueue, leaving each extension with only its behavioral contract (interface, Config, Factory) and sentinels:

- conflict.Conflict / ConflictType  -> entity.Conflict / entity.ConflictType
- mergechecker.Result               -> entity.MergeResult
- pusher.{Result,BatchOutcome,ChangeOutcome,OutcomeStatus} -> entity.{PushResult,BatchOutcome,ChangeOutcome,OutcomeStatus}

These are domain facts (a dependency-graph reason, a mergeability verdict, the commits a change produced) that the orchestrator may persist or surface. Placing them in entity/ — the universal dependency sink that storage, controllers, and extensions all already import — keeps the contract robust to future persistence without a layering inversion (storage importing a decision extension) or an import migration later. This matches what buildrunner and changeprovider already do with entity.BuildStatus / entity.ChangeInfo. The data shapes are unchanged; only their home is. pusher.ErrConflict stays in the extension (a sentinel error is part of the behavioral contract). The controllers were already type-inference-clean, so only their tests change.
behinddwalls added a commit that referenced this pull request Jun 9, 2026
## Summary
### Why?

Extension input granularity is inconsistent across the orchestrator
pipeline: `conflict.Analyzer` takes orchestrator identity
(`entity.Batch`), while `scorer` / `mergechecker` / `changeprovider` /
`buildrunner` / `pusher` take controller-resolved `entity.Change`. The
split caps what an extension can do — a real `target_overlap` conflict
analyzer and a diff-aware heuristic scorer both cannot be written today,
because the data they need is neither in the contract nor resolvable by
the extension.

### What?

Adds `doc/rfc/submitqueue/extension-contract.md` proposing that
decision/action extensions accept thin reference entities at their
pipeline-stage granularity (`entity.Request` for request-stage,
`entity.Batch` / `[]entity.Batch` for batch-stage) and resolve granular
content themselves via narrowly-injected `Factory` dependencies, while
`storage` / `changestore` / `queueconfig` stay key/value resolution
targets. `conflict.Analyzer` is the baseline. The RFC revises the
BuildRunner base/head contract (`build-runner.md`) to pass batches
rather than change lists.

Also encodes the rule in `CLAUDE.md` so new extensions and signature
changes follow it, and links the RFC from the RFC index. Documentation
only — no code changes.

## Test Plan


## Issues


## Stack
1. @ #214
1. #216
1. #217
1. #218
1. #219
1. #221
1. #222
1. #223
1. #227
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant