feat(managed): add explicit experimental Googlevideo suffix policy
Keep operator-owned native circular extrapolation distinct from cold/adaptive qualification and playback readiness. Preserve qualified frontend/assets, use guarded journal transactions and rollback, and apply private startup requests before the owned monitor begins. Retain legacy rendering and qualification gates. Co-authored-by: GPT-6 <gpt-6@openai.com>
This commit is contained in:
1 parent
0398e6fe28
commit
371382c2c4
10 files changed
+386
-9
No files matched your search
@@ -69,10 +69,20 @@ func managedArguments(args []string) (string, []int64, error) {
|
||||
selected := map[string][]int64{}
|
||||
seen := map[int64]bool{}
|
||||
scopeSeen := false
|
||||
experiment := false
|
||||
var scope GooglevideoScope
|
||||
for i := 1; i < len(args); i += 2 {
|
||||
key := args[i]
|
||||
if key == "--googlevideo-experiment" {
|
||||
if experiment || args[i+1] != "native-circular" {
|
||||
return "", nil, invalid
|
||||
}
|
||||
experiment = true
|
||||
continue
|
||||
}
|
||||
if key == "--googlevideo-scope" {
|
||||
if scopeSeen || (args[i+1] != "exact" && args[i+1] != "suffix") {
|
||||
scope = GooglevideoScope(args[i+1])
|
||||
if scopeSeen || !scope.valid() || scope == "" {
|
||||
return "", nil, invalid
|
||||
}
|
||||
scopeSeen = true
|
||||
@@ -101,6 +111,12 @@ func managedArguments(args []string) (string, []int64, error) {
|
||||
}
|
||||
}
|
||||
var ids []int64
|
||||
if experiment {
|
||||
if !scopeSeen || scope != GooglevideoScopeExperimental || len(selected) != 0 {
|
||||
return "", nil, invalid
|
||||
}
|
||||
return "experiment", nil, nil
|
||||
}
|
||||
for _, key := range []string{"--frontend-candidate", "--googlevideo-candidate", "--asset-candidate"} {
|
||||
ids = append(ids, selected[key]...)
|
||||
}
|
||||
@@ -250,11 +266,14 @@ func managedReport(m *managedTransaction, out io.Writer, openDB func() (*sql.DB,
|
||||
known = true
|
||||
for _, id := range j.Candidates {
|
||||
c, err := readStrategyCandidatePolicy(db, id, false)
|
||||
if err != nil || !c.Qualified {
|
||||
if err != nil || (!c.Qualified && !experimentalGooglevideo(j.Scope, c)) {
|
||||
known = false
|
||||
break
|
||||
}
|
||||
groups[c.Group] = true
|
||||
if experimentalGooglevideo(j.Scope, c) {
|
||||
groups[c.Group] = false
|
||||
}
|
||||
if c.Group == "assets" {
|
||||
for _, host := range c.Endpoints {
|
||||
assetHosts[host] = true
|
||||
@@ -369,6 +388,8 @@ func managedCLI(args []string, stdout, stderr io.Writer, d managedDeps) int {
|
||||
err = managedPrestartReconcile(m, d)
|
||||
} else if command == "status" || command == "active-ids" {
|
||||
err = managedReport(m, stdout, d.openDB, command == "active-ids", len(args) == 2 && args[1] == "--assets")
|
||||
} else if command == "experiment" {
|
||||
err = managedExperimentalSuffix(m, d)
|
||||
} else {
|
||||
expected := map[int64]string{}
|
||||
var scopes []GooglevideoScope
|
||||
@@ -396,11 +417,11 @@ func managedCLI(args []string, stdout, stderr io.Writer, d managedDeps) int {
|
||||
}
|
||||
return 1
|
||||
}
|
||||
if command == "init" || command == "reconcile" || command == "apply" {
|
||||
if command == "init" || command == "reconcile" || command == "apply" || command == "experiment" {
|
||||
if _, err := fmt.Fprintln(stdout, "managed-test "+command+": OK"); err != nil {
|
||||
return 1
|
||||
}
|
||||
if command == "apply" {
|
||||
if command == "apply" || command == "experiment" {
|
||||
if _, err := fmt.Fprintln(stdout, "Player API only; not full-profile/GGC/playback health. Use managed status for unresolved groups."); err != nil {
|
||||
return 1
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user