MCPcopy Index your code
hub / github.com/Codeplain-ai/codeplain / change_is_only_future_work

Function change_is_only_future_work

partial_rendering.py:147–173  ·  view source on GitHub ↗

Return True when a spec change only adds work *after* the last-rendered functionality. Appending a new functionality past the render frontier (e.g. a new functionality at the end of the last module) does not affect anything already rendered, so it needs no user decision. The normal "con

(
    plain_module: PlainModule,
    plain_module_render_state: PlainModuleRenderState,
    partial_start: "PartialRenderStart | None",
)

Source from the content-addressed store, hash-verified

145
146
147def change_is_only_future_work(
148 plain_module: PlainModule,
149 plain_module_render_state: PlainModuleRenderState,
150 partial_start: "PartialRenderStart | None",
151) -> bool:
152 """Return True when a spec change only adds work *after* the last-rendered functionality.
153
154 Appending a new functionality past the render frontier (e.g. a new functionality at the
155 end of the last module) does not affect anything already rendered, so it needs no user
156 decision. The normal "continue" path renders the outstanding functionalities, starting
157 from the first one that was never rendered.
158 """
159 if partial_start is None:
160 return False
161
162 all_modules = plain_module.all_required_modules + [plain_module]
163 order = {module.module_name: index for index, module in enumerate(all_modules)}
164 last_index = order[plain_module_render_state.last_render_module.module_name]
165 start_index = order[partial_start.module.module_name]
166
167 if start_index != last_index:
168 return start_index > last_index
169
170 if plain_module_render_state.last_render_frid is None:
171 return True
172
173 return int(partial_start.frid) > int(plain_module_render_state.last_render_frid)
174
175
176def _resume_render_choice(

Calls

no outgoing calls