Skip to content
case-studyplanning

Case Study: Iterative Plan Refinement ​

Date: February-March 2026 Duration: Multiple sessions over several weeks Workflows Used: Iterative Planning, Requirements Elicitation, Code Review Loops Tools: Claude Code and Codex (both contributed to plan refinement)


In One Minute ​

This case shows what iterative planning is for: exposing the parts of a plan that look complete but would fail on contact with the real codebase.

The domain is specific. The transferable lesson is that review pressure improves plans only when the gaps are tracked explicitly.

Situation ​

Design a complete entitlement system to replace a legacy accreditation model in an entitlement management system for a festival/event platform. The legacy system was a single-purpose polymorphic model with binary collected/not-collected status. The replacement needed to handle zone access, consumable items (meals), returnable equipment (radios), one-time items (merch), and automated rule-based assignment.

Why This Was Hard ​

The feature looked conceptually straightforward at the requirements level but depended on a codebase with non-standard namespaces, misleading model shapes, and domain behavior that the first draft could not safely infer.

Method ​

1. First Draft from Research Outputs ​

The initial plan was drafted by cross-referencing three sources:

  • The competitive research findings (11 accreditation systems analyzed)
  • An audit of the existing accreditation system
  • A working HTML prototype of the target UX

This produced a first-pass implementation plan covering the major architectural decisions.

2. Gap Identification Through Code Review ​

The first draft was reviewed against the actual codebase. This is where the iterative planning workflow proved its value -- the agent read real model files, controllers, and pivot models, surfacing gaps that a plan written in isolation would have missed.

3. Clarification Rounds ​

Multiple rounds of requirements elicitation refined ambiguous areas:

  • Should expired/depleted/overdue be stored statuses or computed states?
  • How should the rule engine handle participants who no longer match a rule?
  • What happens when a revoked entitlement's participant matches a rule again?
  • Should the old and new systems coexist, or should there be a hard cutover?

Each round produced concrete decisions that hardened the plan.

4. Plan Hardening ​

The final plan was stress-tested against edge cases and test scenarios, resulting in explicit handling for situations like soft-deletion of pending entitlements when participants no longer match rules, and re-activation paths for revoked entitlements.

Key Decisions Made Through the Process ​

Rule Engine in v1, Not v2 ​

The competitive research showed that no competitor has a true rule engine. Combined with the prototype already designing the full rule-engine UX, the decision was made to ship the rule engine in v1 rather than deferring it. This was a scope decision that emerged from cross-referencing research findings with the prototype, not from the planning process alone.

Clean Cutover Per Event ​

Rather than building a data migration layer or sync mechanism, new events use the entitlement system while existing events stay on accreditations. Both systems coexist in the backend -- a feature flag determines which UI the frontend shows, but the backend does not gate on it. Existing boot callbacks in pivot models continue creating accreditations for old-system events.

Computed vs. Stored State ​

Expired, depleted, and overdue are computed at query time rather than stored as status values. The reasoning: these are time-dependent states that change based on the current moment. Storing them would require cron jobs to flip statuses, and for per-day entitlements, "depleted" resets every midnight. Keeping them computed eliminates an entire class of sync bugs.

Action-Driven Status Model ​

Each status value (pending_approval, active, collected, revoked, returned, suspended) is set by an explicit user or system action, never by time passage. This made the state machine deterministic and testable.

Gaps Found ​

The iterative code review process surfaced multiple issues that would have caused implementation failures:

GapImpact
Assumed model relationships didn't existThe primary entity had no direct users() method -- required traversing an intermediate invite model instead, a non-obvious indirection
Wrong column names in pivot modelsPivot tables used shortened column names (section_id) instead of the expected fully-qualified names (entity_section_id)
Non-standard namespace conventionsKey models lived outside the expected Models namespace; pivot models used a separate namespace
Standalone models mistaken for pivotsAn invite model appeared to be a pivot but was actually a standalone model with its own foreign keys -- no join table existed
Missing polymorphic traversalsRelated entities (performances, guest lists) were attached via polymorphic relationships that couldn't be navigated through the expected parent model

These gaps were documented directly in the implementation plan's "Codebase namespace notes" section, preventing downstream confusion.

Outcome ​

A 150+ line implementation plan covering:

  • Enums: 5 string-backed enums (item types, statuses, credential statuses, checkpoint types, rule modes)
  • Migrations: Tables for participants, entitlement categories, entitlement items, entitlements, credentials, checkpoints, checkpoint logs, and entitlement rules
  • Models: With computed state methods (isExpired(), isDepleted(), isOverdue(), isUsable())
  • Services: Rule engine, scanning service, entitlement lifecycle
  • Controllers: API endpoints for managing entitlements, rules, and checkpoints
  • Coexistence strategy: Old and new systems running in parallel

The plan was structured with explicit dependency ordering — migrations and enums could be built in parallel, while models depended on migrations and services depended on models.

Why This Workflow Worked ​

  • Iterative refinement caught gaps that a single-pass plan would have missed. The codebase had non-standard conventions (models outside expected namespaces, standalone models that look like pivots) that only surfaced through code review.
  • Cross-referencing multiple sources (competitive research, prototype, audit, actual code) produced a plan grounded in both aspirational design and implementation reality.
  • Explicit decision documentation for each ambiguous area (computed vs. stored, cutover strategy, rule engine timing) prevented revisiting settled decisions.
  • Multi-tool collaboration -- both Claude Code and Codex contributed to different refinement passes, with each tool's strengths complementing the other.

What to Reuse ​

  • Force a gap-identification pass after the first draft instead of treating the draft as progress enough.
  • Cross-check plans against the real codebase before anyone starts implementing from them.
  • Record decisions and gaps in the plan itself, not in chat history or side notes.
  • Use iterative planning when the codebase shape is risky, not just when the feature is large.