Skip to content

Start from current ISO week by default; skip session-less weeks instead of stopping#736

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/start-implementation
Draft

Start from current ISO week by default; skip session-less weeks instead of stopping#736
Copilot wants to merge 2 commits intomasterfrom
copilot/start-implementation

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 10, 2026

The conference week crawler relied on hardcoded defaults (CONFERENCE_YEAR: 2025, CONFERENCE_WEEK: 46) that required manual updates to stay current. Additionally, if the starting week had no scheduled sessions (404), the crawler would stop immediately rather than continuing to future weeks.

Changes

config.ts — dynamic start week

  • Replaced static defaults with getISOWeekForDate(date?), an exported ISO 8601 week/year helper that defaults to today
  • No configuration needed to keep the crawler current

json-fetcher.ts — skip session-less weeks

  • Added getISOWeeksInYear(year) and getNextISOWeek(year, week) with correct year-boundary handling (52 vs 53-week years)
  • fetchConferenceWeeks() now advances to the next ISO week on 404 instead of aborting — the limit parameter still bounds total attempts
// Before: stops if current week has no sessions
log.info(`Stopping at ${currentYear}-${currentWeek}: Week not available`);
break;

// After: skips and continues forward
log.info(`Week ${currentYear}-${currentWeek} not available, trying next week`);
const next = getNextISOWeek(currentYear, currentWeek);
currentYear = next.year;
currentWeek = next.week;
continue;

Tests

  • New json-fetcher.test.ts: covers getISOWeeksInYear, getNextISOWeek (including year boundaries), and the skip-week behaviour of fetchConferenceWeeks
  • Extended config.test.ts: edge cases for getISOWeekForDate — mid-year, year-end (Dec 30 → ISO week 1 of next year), year-start (Jan 1 → ISO week 53 of prior year)
Original prompt

Start implementation

The user has attached the following file paths as relevant context:

  • .github/copilot-instructions.md
[Chronological Review: The conversation began with the user expressing confusion about concepts such as upstream, downstream, backfill, DB windows, and recovery processes. The user then inquired about the definition of the DB window in the code. Following this, the user suggested simplifying the logic around date handling and crawling, proposing to start from the current date and only specify a number of weeks or a date. The user also mentioned the need to always crawl future data without additional configuration for recovery. The conversation shifted to discussing the current week’s data retrieval from a JSON endpoint, highlighting issues with weeks without sessions and the absence of current week information. The user requested a plan for recommended changes based on this situation.]

[Intent Mapping:

  1. "ich verstehe dieses upstream downstream und den recoveryProzess noch nicht" - User seeks clarification on specific technical concepts.
  2. "wo ist in dem code das DB‑Fenster definiert?" - User wants to locate the DB window definition in the code.
  3. "ich hab das gefühl die logik mit den anzahl an wochen... könnte es nicht sinn machen, einfach nur immer heute anzufangen." - User proposes a simplification of the crawling logic.
  4. "plane die empfohlene änderung" - User requests a plan for implementing recommended changes.]

[Technical Inventory:

  • Concepts: upstream, downstream, backfill, DB windows, recovery process.
  • Technologies: JSON data retrieval from a URL (https://www.bundestag.de/apps/plenar/plenar/conferenceWeekJSON).
  • Proposed Logic: Simplification of crawling logic to start from the current date and specify either a number of weeks or a date.]

[Code Archaeology: No specific code files or functions were explicitly mentioned or modified in the conversation.]

[Progress Assessment:

  • Completed: User has articulated their understanding and confusion regarding several technical concepts.
  • Pending: User has requested a plan for recommended changes based on the current week’s data retrieval issues.]

[Context Validation: All critical information for continuation is captured, including user requests for clarification, simplification proposals, and the need for a plan regarding data retrieval.]

[Recent Commands Analysis:

  • Last Agent Commands: User requested a plan for recommended changes.
  • Tool Results Summary: User provided JSON data from a URL and highlighted issues with the current week’s data retrieval.
  • Pre-Summary State: The agent was actively discussing the need for a plan to address the issues with the current week’s data retrieval when the token budget was exceeded.
  • Operation Context: The user is focused on improving the data crawling logic and addressing the absence of current week information in the retrieved data.]
1. Conversation Overview: - Primary Objectives: User seeks to understand technical concepts related to data retrieval and proposes simplifications to the crawling logic. They also request a plan for recommended changes based on current data retrieval issues. - Session Context: The conversation has progressed from clarifying technical concepts to discussing specific data retrieval challenges and proposing a more straightforward approach to crawling. - User Intent Evolution: The user has moved from seeking clarification to actively proposing changes and requesting a plan for implementation.
  1. Technical Foundation:
  • JSON Data Retrieval: The user is working with data from a URL that provides information about parliamentary sessions.
  • Proposed Logic: Simplification of crawling to always start from the current date, with the ability to specify a number of weeks or a date.
  1. Codebase Status:
  • No specific files or code changes were discussed in detail.
  1. Problem Resolution:
  • Issues Encountered: The user identified problems with weeks without sessions and the absence of current week information in the retrieved JSON data.
  • Solutions Implemented: User proposed a simplified crawling logic.
  • Debugging Context: Ongoing discussions about how to handle the current week’s data retrieval.
  1. Progress Tracking:
  • Completed Tasks: User has articulated their confusion and proposed a simplification of the crawling logic.
  • Partially Complete Work: User has requested a plan for implementing recommended changes.
  1. Active Work State:
  • Current Focus: User is focused on planning recommended changes to the data retrieval logic.
  • Recent Context: User discussed issues with the current week’s data retrieval and proposed a new approach to crawling.
  • Immediate Context: User is looking for a plan to address the current week’s data retrieval issues.
  1. Recent Operations:
  • Last Agent Commands: User requested a plan for recommended changes.
  • Tool Results Summary: User provided JSON data from a URL and highlighted issues w...

Created from VS Code.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: ManAnRuck <2183135+ManAnRuck@users.noreply.github.com>
Copilot AI changed the title [WIP] Start implementation for date handling and crawling logic Start from current ISO week by default; skip session-less weeks instead of stopping Mar 10, 2026
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.

2 participants