Conversation
| BATCH_MERGE_AUTHORITIES = %w[none ask auto].freeze | ||
| BATCH_MERGE_AUTHORITY_ALIASES = { | ||
| "auto_merge_when_gates_pass" => "auto" | ||
| }.freeze |
There was a problem hiding this comment.
Maintainability: duplicated enum/alias mapping with no sync check to the canonical schema
BATCH_MERGE_AUTHORITIES and BATCH_MERGE_AUTHORITY_ALIASES hand-duplicate the enum/alias mapping already published as the canonical contract in schema/state/v1/merge-authority/merge-authority.schema.json (see ADR 0011). There's no test tying the two together.
If a future PR bumps the merge-authority vocabulary in the schema file (allowed additively in v1, or via a v2 bump, per ADR 0011) but forgets to update this hardcoded Ruby list (or vice versa), register-batch will silently diverge from the published contract — e.g. rejecting a value the schema/dashboard consider valid, or persisting a value the schema's invalid fixtures say should never be stored. test/merge_authority_contract_test.rb only exercises the schema file directly, and the new CLI tests only exercise these hardcoded Ruby constants, so nothing currently catches this drift.
Consider adding a test that loads the schema's enum/alias values and asserts they match these Ruby constants, so the two stay in sync automatically.
Code review summaryReviewed the actual diff ( I cross-checked the implementation against the pre-existing published contract for this feature ( One finding (left inline): No security or performance concerns identified. |
Why
Batch manifests already declare merge authority, but
register-batchdid not persist it. That left status consumers unable to distinguish an undeclared policy from an explicitnone,ask, or automatic policy.What changed
merge_authorityon the existing batch record; no new record family or storage path is introduced.auto_merge_when_gates_passspelling to the canonical stored valueautowhile retaining canonicalnone,ask, andautounchanged.status --jsonprojection.Verification
.agents/bin/validate: 55 files inspected, no offenses.PR #319 currently overlaps
bin/agent-coord; this draft intentionally leaves final current-base integration for later reconciliation rather than modifying or duplicating that work.Closes #86
Agent details
Implemented by Codex in a dedicated issue worktree and independently reviewed by a separate Codex checker. Human merge authority: none.