Skip to content

refactor(parser): promote replicator SpecialClause variants to ClauseDisposition::ReplicatePerKeyword (U5-M2)#5565

Merged
matthewevans merged 1 commit into
mainfrom
ship/u5-m2-replicate
Jul 11, 2026
Merged

refactor(parser): promote replicator SpecialClause variants to ClauseDisposition::ReplicatePerKeyword (U5-M2)#5565
matthewevans merged 1 commit into
mainfrom
ship/u5-m2-replicate

Conversation

@matthewevans

Copy link
Copy Markdown
Member

Third U5-M2 increment. SameIsTrueFor + RepeatProcessForKeywords (CR 702 / CR
608.2c per-keyword template replication) fold into
ClauseDisposition::ReplicatePerKeyword { keywords, kind: ReplicateKind }, where
kind (StaticGrant | CounterPlacement) selects the replication helper — the two
handlers share the same call shape but distinct rules concepts, kept typed rather
than collapsed. Both SpecialClause variants are deleted.

Faithful-by-construction (ClauseDisposition never reaches a serialized snapshot).
Parity tests — Odric, Lunarch Marshal (StaticGrant, 12-keyword grant) and Kathril,
Aspect Warper (CounterPlacement) — exercise the multi-keyword replication loop with
zero snapshot drift.

…Disposition::ReplicatePerKeyword (U5-M2)

Third U5-M2 increment. SameIsTrueFor + RepeatProcessForKeywords (CR 702 / CR
608.2c per-keyword template replication) fold into
`ClauseDisposition::ReplicatePerKeyword { keywords, kind: ReplicateKind }`, where
`kind` (StaticGrant | CounterPlacement) selects the replication helper — the two
handlers share the same call shape but distinct rules concepts, kept typed rather
than collapsed. Both SpecialClause variants are deleted.

Faithful-by-construction (ClauseDisposition never reaches a serialized snapshot).
Parity tests — Odric, Lunarch Marshal (StaticGrant, 12-keyword grant) and Kathril,
Aspect Warper (CounterPlacement) — exercise the multi-keyword replication loop with
zero snapshot drift.
@matthewevans
matthewevans enabled auto-merge July 11, 2026 09:05

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors per-keyword replication logic by introducing ClauseDisposition::ReplicatePerKeyword and the ReplicateKind enum, replacing the previous SpecialClause variants for static grants and counter placements. It also adds corresponding snapshot tests. The review feedback highlights that several of the newly introduced CR annotations violate the strict formatting rule (R6) by combining multiple rules on a single line, and suggests splitting them into separate, single-rule annotations.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +1440 to +1442
// CR 702 / CR 608.2c: replicate the antecedent template clause once
// per listed keyword. `kind` selects which template shape (and thus
// helper); the keyword-swap logic lives unchanged in the helpers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

[MEDIUM] Non-compliant CR annotation format. Evidence: crates/engine/src/parser/oracle_effect/lower.rs:1440.
Why it matters: Every rules-touching line of engine code must carry a single, strictly formatted CR comment matching the regex CR \\d{3}(\\.\\d+[a-z]?)? to ensure automated verification against the Comprehensive Rules.
Suggested fix: Split the combined CR comment into separate, single-rule annotations.

Suggested change
// CR 702 / CR 608.2c: replicate the antecedent template clause once
// per listed keyword. `kind` selects which template shape (and thus
// helper); the keyword-swap logic lives unchanged in the helpers.
// CR 702: Replicate the antecedent template clause once per listed keyword for static grants.
// CR 608.2c: Replicate the antecedent template clause once per listed keyword for counter placement.
References
  1. Every rules-touching line of engine code must carry a comment of the form CR : (regex CR \d{3}(\.\d+[a-z]?)?). (link)

else_def: Box<AbilityDefinition>,
kind: OtherwiseKind,
},
/// CR 608.2c / CR 702: replicate an antecedent template clause once per listed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

[MEDIUM] Non-compliant CR annotation format. Evidence: crates/engine/src/parser/oracle_ir/effect_chain.rs:238.
Why it matters: Every rules-touching line of engine code must carry a single, strictly formatted CR comment matching the regex CR \\d{3}(\\.\\d+[a-z]?)? to ensure automated verification against the Comprehensive Rules.
Suggested fix: Split the combined CR comment into separate, single-rule annotations.

Suggested change
/// CR 608.2c / CR 702: replicate an antecedent template clause once per listed
/// CR 702: Replicate an antecedent template clause once per listed keyword for static grants.
/// CR 608.2c: Replicate an antecedent template clause once per listed keyword for counter placement.
References
  1. Every rules-touching line of engine code must carry a comment of the form CR : (regex CR \d{3}(\.\d+[a-z]?)?). (link)

Fallback,
}

/// CR 608.2c / CR 702: which per-keyword replication is performed. Both replicate

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

[MEDIUM] Non-compliant CR annotation format. Evidence: crates/engine/src/parser/oracle_ir/effect_chain.rs:289.
Why it matters: Every rules-touching line of engine code must carry a single, strictly formatted CR comment matching the regex CR \\d{3}(\\.\\d+[a-z]?)? to ensure automated verification against the Comprehensive Rules.
Suggested fix: Split the combined CR comment into separate, single-rule annotations.

Suggested change
/// CR 608.2c / CR 702: which per-keyword replication is performed. Both replicate
/// CR 702: Replicate an antecedent template clause once per listed keyword for static grants.
/// CR 608.2c: Replicate an antecedent template clause once per listed keyword for counter placement.
References
  1. Every rules-touching line of engine code must carry a comment of the form CR : (regex CR \d{3}(\.\d+[a-z]?)?). (link)

@matthewevans
matthewevans added this pull request to the merge queue Jul 11, 2026
@github-actions

Copy link
Copy Markdown

Parse changes introduced by this PR

✓ No card-parse changes detected.

Merged via the queue into main with commit 8a6806e Jul 11, 2026
13 checks passed
@matthewevans
matthewevans deleted the ship/u5-m2-replicate branch July 11, 2026 09:25
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