Skip to content

refactor(bayn): unify candidate lifecycle authority - #13477

Merged
gregkonush merged 2 commits into
mainfrom
codex/bayn-candidate-lifecycle
Aug 2, 2026
Merged

refactor(bayn): unify candidate lifecycle authority#13477
gregkonush merged 2 commits into
mainfrom
codex/bayn-candidate-lifecycle

Conversation

@gregkonush

Copy link
Copy Markdown
Member

Summary

  • Replaces competing normalized successor kinds with one explicit candidate trial lifecycle state algebra.
  • Enforces reviewed candidate -> one development attempt -> rejection or qualification eligibility -> one qualification attempt -> terminal.
  • Derives qualification dormancy from canonical state; a reviewed nextCandidatePreregistration alone is never ready.
  • Preserves frozen Candidate 20 PRECOMMIT_INVALID/UNATTEMPTED and next ordinal 21.

Related Issues

None

Testing

  • bun test services/bayn/src/candidate-development-trials/state-machine.test.ts services/bayn/src/candidate-development-trials/qualification-dormancy.test.ts — 13 passed.
  • bun run --filter @proompteng/bayn test — 1,224 passed, 153 skipped, 0 failed across 1,377 tests. PostgreSQL tests are unrelated to this pure domain-only patch and remained skipped by the suite.
  • bun run --filter @proompteng/bayn tsc — passed.
  • bun run --filter @proompteng/bayn lint — passed.
  • bun run --filter @proompteng/bayn lint:oxlint and lint:oxlint:type — passed with one pre-existing warning outside scope in candidate-development-domain/preflight.ts.
  • bunx oxfmt --check on all nine changed lifecycle files — passed.
  • bun run --filter @proompteng/bayn build — passed.
  • No PostgreSQL, candidate, holdout, broker, or deployment execution was performed.

Breaking Changes

None. Integration must pass the canonical CandidateDevelopmentTrialState produced/reduced by state-machine.ts to qualificationDormancyDecisionFromState; history normalization intentionally remains development-pending even when nextCandidatePreregistration is present.

Checklist

  • Testing section documents the exact validation performed.
  • Screenshots section is not applicable and was removed.
  • Breaking Changes section is filled.
  • Documentation, release notes, and follow-ups are not required for this pure internal lifecycle refactor.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aa75cfb2d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread services/bayn/src/candidate-development-trials/validation.ts
Comment thread services/bayn/src/candidate-development-trials/validation.ts Outdated
@gregkonush
gregkonush force-pushed the codex/bayn-candidate-lifecycle branch from aa75cfb to 8afa99d Compare August 2, 2026 08:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8afa99d071

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread services/bayn/src/candidate-development-trials/validation.ts Outdated
@gregkonush
gregkonush enabled auto-merge (squash) August 2, 2026 08:51
@gregkonush
gregkonush merged commit 3ae5fa0 into main Aug 2, 2026
16 checks passed
@gregkonush
gregkonush deleted the codex/bayn-candidate-lifecycle branch August 2, 2026 09:09
@gregkonush
gregkonush restored the codex/bayn-candidate-lifecycle branch August 2, 2026 09:11
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.

1 participant