Skip to content

Add better windows support - #9

Open
m-durana wants to merge 1 commit into
ksred:mainfrom
m-durana:main
Open

Add better windows support#9
m-durana wants to merge 1 commit into
ksred:mainfrom
m-durana:main

Conversation

@m-durana

@m-durana m-durana commented Apr 8, 2026

Copy link
Copy Markdown

Added windows to openBrowser function and modified readme to add windows instructions.

krsnaa pushed a commit to krsnaa/cctrack that referenced this pull request May 6, 2026
Final wiring commit for F2 S2.2 (item #643). cmd/serve now
constructs the auto-sync scheduler with production dependencies and
runs it as a background goroutine bound to the shutdown context.

Per F2 S2.2 EM ruling chat msg 20565 binding constraint #1:
cmd/serve owns scheduler lifecycle ordering. The scheduler package
itself does not import internal/api or internal/hub.

Wiring shape:

  - schedProvider := usageprovider.New() — production HTTP client.
  - schedLogger wraps log.Printf with a "usagescheduler: " prefix.
  - sched := usagescheduler.New(provider, credentials.Load, store,
    logger) — store satisfies usagescheduler.AnchorStore via
    SaveWindowAnchor + ObservedCostForWindow.
  - go func() { sched.Run(ctx); close(schedDone) }() — scheduler
    runs in its own goroutine, bound to the existing
    signal.NotifyContext.
  - On shutdown: ctx.Done() unblocks scheduler.Run from inside.
    Deferred bounded wait (5s) on schedDone so a hung scheduler
    cannot block process exit.

The scheduler's manual-sync coexistence is unchanged in this slice
per binding constraint ksred#9 (deferred): the existing POST
/api/v1/window-anchors handler continues to work; users retain
manual entry as fallback.

No new tests in this commit; the wiring is dependency injection
exercised by integration paths (cctrack serve). The unit-level
behaviors are pinned by the 17 fake-clock tests in C4.

Tests: full inner suite green; vet clean; build clean.

Per F2 plan #643 evidence_requirements + chat msg 20565.

@ksred ksred left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks — Windows browser open support is a clear win.

Keep

  • cmd /c start "" url on Windows in openBrowser — correct approach
  • Windows build / PATH notes in the README

Please fix before merge

  1. Port change looks unintentional — README/example config move 88777432. Unless that was a deliberate product decision, revert those lines so the PR stays focused on Windows support. If 7432 is intentional, call it out explicitly in the PR body and update any other references (default in code, docs elsewhere).
  2. Rebase on current main (pricing fix from #12 just landed) and re-check the Windows path still applies cleanly.

Once the port lines are sorted, this is good to merge.

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