Skip to content

scheduling fixes - #2

Open
gkennos wants to merge 6 commits into
mainfrom
feature/scheduling-rollout
Open

gkennos wants to merge 6 commits into
mainfrom
feature/scheduling-rollout

Conversation

@gkennos

@gkennos gkennos commented Sep 17, 2026

Copy link
Copy Markdown
Member

Summary

scheduling roll out fixes

Checklist

  • Applied exactly one label (breaking, feature, fix, dependencies, or chore)
  • Tests pass locally (uv run pytest -q)
  • Lint passes (uv run ruff check .)
  • Generated model changes were regenerated and reviewed, if applicable

@gkennos gkennos added the feature New backwards-compatible functionality. MINOR: x.y+1.z label Sep 17, 2026
@gkennos
gkennos requested a lite review from Copilot September 17, 2026 07:11

Copilot AI 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.

🟡 Changes recommended

Fix the rollout end calculation, fallback status prefixing, and shared network ownership behavior.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds deterministic treatment schedule rollout across cycles and phases, with elapsed timing and resolution metadata.

Changes:

  • Adds cycle/block anchoring and phase rollout logic.
  • Integrates timing metadata into administration frames.
  • Adds tests, exports, documentation, and shared devcontainer networking.
File summaries
File Summary
tests/test_schedule_properties.py Adds rollout and timing tests.
hemonc_alchemy/toolkit/analytics/treatment/scheduling/rollout.py Implements rollout logic; phase end calculation and fallback status handling require changes.
hemonc_alchemy/toolkit/analytics/treatment/scheduling/properties.py Integrates elapsed timing into administration frames.
hemonc_alchemy/toolkit/analytics/treatment/scheduling/__init__.py Exports rollout APIs.
docs/toolkit/scheduling.md Documents timeline behavior and APIs.
.devcontainer/compose.yaml Configures shared networking; network ownership must be corrected for sibling devcontainers.
Review details

Suppressed comments (3)

.devcontainer/compose.yaml:68

  • A fixed name without external: true leaves this network Compose-owned by the first project. Starting a second checkout/devcontainer with a different Compose project name can then fail on the existing com.docker.compose.project label instead of joining the network, so the stated sibling-devcontainer behavior is not reliable. Use a pre-created external network or keep the project-scoped default and document the setup.
    name: hemonc-alchemy_default

hemonc_alchemy/toolkit/analytics/treatment/scheduling/rollout.py:675

  • When _phase_order uses a documented fallback, it returns a non-None order_reason beginning with resolved_via_fallback:. This condition therefore prevents phase_start from advancing between fallback-ordered phases, so every phase is rolled out at the same offset even though the status says the ordering was resolved. Only unresolved ordering should suppress phase chaining.
        if phase_end is not None and order_reason is None:

hemonc_alchemy/toolkit/analytics/treatment/scheduling/rollout.py:710

  • order_reason also carries the resolved fallback status, but this branch unconditionally prefixes it with unresolved:. An empty result from a fallback-ordered variant therefore exposes a contradictory frame.attrs["timing_status"]; preserve already-prefixed statuses and only add unresolved: to a bare failure reason.
    if order_reason and frame.empty:
        frame.attrs["timing_status"] = f"unresolved: {order_reason}"
  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread hemonc_alchemy/toolkit/analytics/treatment/scheduling/rollout.py Outdated
Comment thread hemonc_alchemy/toolkit/analytics/treatment/scheduling/rollout.py
@brianna-argall

brianna-argall commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

I'm happy with this :)

My remaining suggestions are around indefinite handling:

  • Ideally (+1) indefinites would be handled and not appear as none in the indefinite column. Currently an appropriate warning is displayed
  • Given that indefinite can apply to either days within a cycle or cycle continuation ideally the column label would be more transparent about the nature of the indefinite

Additionally, there is currently no check on being systemic - rt sigs roll out with drug NaN

Edge case variants thought not to have been specifically examined in development were examined including:

  • Carboplatin and Paclitaxel (CP) and Tislelizumab var2 : A perioperative variant with a surgery phase and tislelizumab used both in neoadjuvant and adjuvant contexts
  • Carboplatin, Osimertinib, Pemetrexed var1: A variant with both PO and IV sigs, with the PO drug delivered on sequential days from compact notation
  • Carboplatin and Paclitaxel (CP) and Ipilimumab var3: A variant with a component delivered cycle 3 only whereas other components have cycle 1-6 deliveries.

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Critical startup and schedule-anchoring issues, along with additional unresolved rollout correctness issues, remain.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 High severity · 1 Medium severity

Open (3)
Resolved since last review (1)

Comment thread .devcontainer/compose.yaml
Comment thread hemonc_alchemy/toolkit/analytics/treatment/scheduling/rollout.py
Comment thread hemonc_alchemy/toolkit/analytics/treatment/scheduling/properties.py

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Four unresolved review findings include two critical rollout issues and two moderate scheduling/parser issues.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 3 High severity · 2 Medium severity

Open (5)
Resolved since last review (1)

Comment on lines +245 to +246
if overlaps:
prior = overlaps[-1]
Comment thread hemonc_alchemy/toolkit/analytics/treatment/scheduling/rollout.py Outdated
Comment thread hemonc_alchemy/toolkit/analytics/treatment/scheduling/handling.py Outdated

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Moderate correctness issues remain in status aggregation, overlap anchoring, and ambiguous timing choices.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity · 1 Medium severity

Open (2)
Resolved since last review (4)

Comment thread hemonc_alchemy/toolkit/analytics/treatment/scheduling/rollout.py

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

Unresolved rollout correctness issues remain in choice handling, phase consistency validation, and negative-day offsets.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 High severity

Open (2)
Resolved since last review (1)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Correct off-by-one conversion for negative cycle days

hemonc_alchemy/​toolkit/​analytics/​treatment/​scheduling/​rollout.py:529

The day - 1 conversion is off by one for the documented negative-day notation: -14 means 14 days before cycle day 1, but this produces offset -15 in both elapsed and calendar timelines. Apply the 1-based conversion only to positive cycle days and retain negative values as their stated lead-in offsets.

Comment on lines +132 to +138
resolved = resolve_all_days(value)
except (TypeError, ValueError):
return frozenset(), None, frozenset()
return (
frozenset(day.value for day in resolved.days),
resolved.indefinite,
frozenset(day.value for day in resolved.days if day.optional),

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New backwards-compatible functionality. MINOR: x.y+1.z

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants