-
Notifications
You must be signed in to change notification settings - Fork 695
feat(lab): CL-08 bounded automation with trusted live-route dispatch #1447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
f4f69aa
docs(lab): freeze CL-08 automation contract
Wibias bb2c1c0
feat(lab): add bounded automation orchestration
Wibias 6b3d944
feat(lab): wire trusted live-route automation
Wibias 3d6b7f2
test(lab): harden automation authority and lifecycle
Wibias e4ba266
test(lab): capture CL-08 review regressions
Wibias a866f1d
fix(lab): close CL-08 automation policy schema
Wibias 05e052f
fix(lab): harden automation state persistence
Wibias baaedf0
fix(lab): make automation budgets rolling and attempt-safe
Wibias 16286a6
fix(lab): bound CL-08 queue and dispatch selection
Wibias 1b1eb79
fix(lab): scope automation freshness to exact evidence identity
Wibias 6713465
fix(lab): revalidate CL-08 dispatch contracts
Wibias 5227aa0
fix(lab): serialize automation scheduling state
Wibias 60921ef
fix(lab): reconcile automation queue on policy changes
Wibias b84fdd2
fix(lab): carry dispatch identity enforcement context
Wibias 02aa4f2
fix(lab): enforce queued identity without breaking low-level test seams
Wibias 1a14ec2
fix(lab): close scheduler lifecycle and stale-plan races
Wibias 17fb662
fix(lab): ignore non-authoritative automation update fields
Wibias 3110fd1
fix(lab): rebuild missing projection before scheduled planning
Wibias 247ec04
test(lab): use canonical queued live runs
Wibias ec51713
fix(lab): complete CL-08 CLI execution controls
Wibias 6706ac6
fix(lab): harden automation review bounds
Wibias a697421
fix(lab): reject zero concurrency limits
Wibias ab7e689
fix(lab): bound cooldown persistence
Wibias b8d9f87
fix(lab): retain rolling budget evidence
Wibias 2eea0a6
fix(lab): reject stale run cursors
Wibias 7ae55c6
fix(lab): harden OAuth live-route dispatch
Wibias 68c938f
fix(lab): fence automation state ownership
Wibias 32878f5
fix(lab): isolate scheduler ownership and cancellation
Wibias 271eabe
fix(lab): make freshness exact and bounded
Wibias 4f12978
fix(lab): harden automation management API
Wibias e250560
fix(lab): preserve CLI automation intent
Wibias f355104
test(lab): cover CodeRabbit automation regressions
Wibias 1ae9b4a
fix(lab): prune cooldowns during recovery
Wibias c441591
test(lab): make rolling budget regression deterministic
Wibias 7fbc18f
docs(lab): align CL-08 headings and budget reason
Wibias e04dce6
test(lab): strengthen automation authority regressions
Wibias 36bcc80
test(lab): cover automation management pagination and cancel routes
Wibias f13489a
test(lab): assert automation HTTP error codes
Wibias 4c4f8cf
fix(lab): guarantee cancellation backoff
Wibias 2390c20
test(lab): prove cancellation backoff with zero failure cooldown
Wibias 27e7394
fix(lab): reserve cooldown capacity before dispatch
Wibias 7c09d51
fix(lab): fence dispatch deps and cooldown reservations
Wibias 568f670
fix(lab): publish state locks atomically
Wibias 7cdb374
fix(lab): add bounded exact freshness query
Wibias b7990ae
test(lab): cover final CL-08 review blockers
Wibias 5cad25a
fix(lab): close final CL-08 review blockers
Wibias e991457
test(lab): prove bounded exact freshness lookup
Wibias e2bf73e
test(lab): initialize persisted-state fixture dirs
Wibias 253a109
test(lab): reproduce cancellation history persistence overflow
Wibias f7598f0
fix(lab): fail closed when cooldown persistence saturates
Wibias 7607cf6
fix(lab): keep persisted run history within hard ceiling
Wibias 82f7e57
test(lab): carry parent-owned fabric isolation budgets to child
Wibias 382b72d
test(lab): add guarded fabric isolation limit override
Wibias a806664
test(lab): scale synthetic producer timing to parent budgets
Wibias b2a9093
test(lab): shorten CL-07 isolation timing budgets
Wibias 9e5b6e3
test(lab): track current projection schema version
Wibias e533234
test(lab): assert fail-closed cooldown saturation
Wibias dd04b8a
test(lab): reproduce maintainer lifecycle blockers
Wibias 6220ea7
fix(lab): scope runtime resources to server owners
Wibias 1998e97
fix(lab): release server-owned runtime resources
Wibias 07a15cc
fix(lab): commit automation config atomically
Wibias 40b7539
fix(lab): publish policy and routes as one config
Wibias ba393fd
fix(lab): bind scheduler authority to runtime owner
Wibias 8a37c28
test(lab): exercise server-owned runtime cleanup
Wibias 23c8f9b
fix(lab): keep CLI policy writes on committed config
Wibias 1492c29
chore(lab): remove CL-08 plan trailing whitespace
Wibias bfaad5d
test(lab): read committed automation config generation
Wibias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1,019 changes: 1,019 additions & 0 deletions
1,019
devlog/_plan/260807_compatibility_lab/008_cl08_automation.md
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| import { LAB_AUTOMATION_HARD_MAX } from "./constants"; | ||
| import type { LabAutomationPolicyV1, LabAutomationStateV1 } from "./types"; | ||
|
|
||
| export function rollBudgetWindow(state: LabAutomationStateV1, now: number): LabAutomationStateV1 { | ||
| if (now - state.budgetWindowStartedAt < LAB_AUTOMATION_HARD_MAX.budgetWindowMs) return state; | ||
| return { | ||
| ...state, | ||
| budgetWindowStartedAt: now, | ||
| runsThisHour: 0, | ||
| liveRequestsThisHour: 0, | ||
| }; | ||
| } | ||
|
|
||
| function rollingStartedRuns(state: LabAutomationStateV1, now: number): number { | ||
| const cutoff = now - LAB_AUTOMATION_HARD_MAX.budgetWindowMs; | ||
| return state.runs.filter((run) => typeof run.startedAt === "number" && run.startedAt > cutoff && run.startedAt <= now).length; | ||
| } | ||
|
|
||
| function rollingStartedLiveRuns(state: LabAutomationStateV1, now: number): number { | ||
| const cutoff = now - LAB_AUTOMATION_HARD_MAX.budgetWindowMs; | ||
| return state.runs.filter((run) => | ||
| run.evidenceLayer === "live_route_compatibility" | ||
| && typeof run.startedAt === "number" | ||
| && run.startedAt > cutoff | ||
| && run.startedAt <= now | ||
| ).length; | ||
| } | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| function legacyCounterActive(state: LabAutomationStateV1, now: number): boolean { | ||
| return now - state.budgetWindowStartedAt < LAB_AUTOMATION_HARD_MAX.budgetWindowMs; | ||
| } | ||
|
|
||
| export function runBudgetRemaining( | ||
| policy: LabAutomationPolicyV1, | ||
| state: LabAutomationStateV1, | ||
| now = Date.now(), | ||
| ): number { | ||
| const rolling = rollingStartedRuns(state, now); | ||
| const legacy = legacyCounterActive(state, now) ? state.runsThisHour : 0; | ||
| return Math.max(0, policy.maxRunsPerHour - Math.max(rolling, legacy)); | ||
| } | ||
|
|
||
| export function liveRequestBudgetRemaining( | ||
| policy: LabAutomationPolicyV1, | ||
| state: LabAutomationStateV1, | ||
| now = Date.now(), | ||
| ): number { | ||
| const rolling = rollingStartedLiveRuns(state, now); | ||
| const legacy = legacyCounterActive(state, now) ? state.liveRequestsThisHour : 0; | ||
| return Math.max(0, policy.maxLiveRequestsPerHour - Math.max(rolling, legacy)); | ||
| } | ||
|
|
||
| export function isRunBudgetExhausted( | ||
| policy: LabAutomationPolicyV1, | ||
| state: LabAutomationStateV1, | ||
| now = Date.now(), | ||
| ): boolean { | ||
| return runBudgetRemaining(policy, state, now) <= 0; | ||
| } | ||
|
|
||
| export function isLiveRequestBudgetExhausted( | ||
| policy: LabAutomationPolicyV1, | ||
| state: LabAutomationStateV1, | ||
| now = Date.now(), | ||
| ): boolean { | ||
| return liveRequestBudgetRemaining(policy, state, now) <= 0; | ||
| } | ||
|
|
||
| /** Legacy persisted counters remain for schema compatibility; startedAt records are rolling authority. */ | ||
| export function recordRunBudgetUse(state: LabAutomationStateV1, liveRequest: boolean): LabAutomationStateV1 { | ||
| return { | ||
| ...state, | ||
| runsThisHour: Math.min(LAB_AUTOMATION_HARD_MAX.maxRunsPerHour, state.runsThisHour + 1), | ||
| liveRequestsThisHour: liveRequest | ||
| ? Math.min(LAB_AUTOMATION_HARD_MAX.maxLiveRequestsPerHour, state.liveRequestsThisHour + 1) | ||
| : state.liveRequestsThisHour, | ||
| }; | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.