Add better windows support - #9
Open
m-durana wants to merge 1 commit into
Open
Conversation
…indows 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
reviewed
Aug 19, 2026
ksred
left a comment
Owner
There was a problem hiding this comment.
Thanks — Windows browser open support is a clear win.
Keep
cmd /c start "" urlon Windows inopenBrowser— correct approach- Windows build / PATH notes in the README
Please fix before merge
- Port change looks unintentional — README/example config move
8877→7432. 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). - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added windows to openBrowser function and modified readme to add windows instructions.