Compare commits

...
Author SHA1 Message Date
m a0b0b32f0a docs(evidence): record gpu qualification timeout
CI / test (push) Successful in 50s
CI / test (pull_request) Successful in 51s
2026-08-24 00:03:29 +03:00
m 1f2068512e Merge pull request 'DEV-000262 additional evaluation runtime live evidence' (#241) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 1m16s
2026-08-23 20:57:34 +00:00
m b97c910434 docs(evidence): record additional evaluation runtime
CI / test (push) Successful in 59s
CI / test (pull_request) Successful in 50s
2026-08-23 23:55:09 +03:00
m b789878d01 Merge pull request 'DEV-000261 expose additional evaluation scheduling endpoint' (#240) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 50s
2026-08-23 20:52:29 +00:00
m 705e4a8ed6 Merge remote-tracking branch 'origin/main' into codex/dev-000248-self-development-runtime-status
CI / test (push) Successful in 52s
CI / test (pull_request) Successful in 49s
2026-08-23 23:49:33 +03:00
m 531dfa85ad feat(work): expose additional evaluation scheduling
CI / test (push) Successful in 54s
CI / test (pull_request) Successful in 49s
2026-08-23 23:45:45 +03:00
m 6e215b5b57 Merge pull request 'DEV-000261 durable additional task evaluation scheduling' (#239) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 54s
2026-08-23 20:42:20 +00:00
m d46c0cf719 chore(governance): align additional evaluation task base
CI / test (push) Successful in 59s
CI / test (pull_request) Successful in 49s
2026-08-23 23:38:32 +03:00
m 3eecc710ed Merge remote-tracking branch 'origin/main' into codex/dev-000248-self-development-runtime-status 2026-08-23 23:37:57 +03:00
m 1b4284592b feat(work): schedule bounded additional evaluations 2026-08-23 23:37:56 +03:00
m d2dd38b9ae Merge pull request 'DEV-000260 deep authenticated acceptance evidence' (#238) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 49s
2026-08-23 19:45:54 +00:00
m fb6b5e9677 Merge remote-tracking branch 'origin/main' into codex/dev-000248-self-development-runtime-status
CI / test (push) Successful in 53s
CI / test (pull_request) Successful in 58s
2026-08-23 22:43:57 +03:00
m 40735ce9c1 docs(acceptance): record deep authenticated evidence
CI / test (push) Successful in 47s
CI / test (pull_request) Successful in 49s
2026-08-23 22:41:26 +03:00
m 9f40c6a793 Merge pull request 'docs(governance): refresh post-responsive evidence' (#237) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 1m0s
2026-08-23 19:18:35 +00:00
m a9dbc3b624 docs(governance): refresh post-responsive evidence
CI / test (push) Successful in 52s
CI / test (pull_request) Successful in 49s
2026-08-23 22:16:20 +03:00
m d4b5416126 Merge pull request 'test(creator-web): guard responsive console layout' (#236) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 59s
2026-08-23 19:12:44 +00:00
m 7c4981ea09 test(creator-web): guard responsive console layout
CI / test (push) Successful in 53s
CI / test (pull_request) Successful in 50s
2026-08-23 22:10:31 +03:00
m 5e8286695f Merge pull request 'docs(governance): record operations acceptance smoke' (#235) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 1m0s
2026-08-23 19:05:31 +00:00
m 2b11baa170 docs(governance): record operations acceptance smoke
CI / test (push) Successful in 54s
CI / test (pull_request) Successful in 51s
2026-08-23 22:03:12 +03:00
m 8868258afd Merge pull request 'feat(capability): expose reachability rating evidence' (#234) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 57s
2026-08-23 18:57:40 +00:00
m 90cb2b1590 feat(capability): expose reachability rating evidence
CI / test (push) Successful in 50s
CI / test (pull_request) Successful in 52s
2026-08-23 21:55:13 +03:00
m 3d97b348f7 Merge pull request 'docs(governance): refresh live audit status' (#233) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 58s
2026-08-23 18:50:58 +00:00
m 3eea9e58cd docs(governance): refresh live audit status
CI / test (push) Successful in 49s
CI / test (pull_request) Successful in 49s
2026-08-23 21:48:43 +03:00
m 12ab124411 Merge pull request 'feat(governance): add development gate evidence transitions' (#232) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 1m0s
2026-08-23 18:40:44 +00:00
m 0886342031 feat(governance): add development gate evidence transitions
CI / test (push) Successful in 47s
CI / test (pull_request) Successful in 47s
2026-08-23 21:38:46 +03:00
m 3bfe76278b Merge pull request 'feat(governance): connect verifier to DevelopmentGate' (#231) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 56s
2026-08-23 18:32:28 +00:00
m 067facdfa4 feat(governance): connect verifier to development gate
CI / test (push) Successful in 47s
CI / test (pull_request) Successful in 52s
2026-08-23 21:29:53 +03:00
m f2e520e31e Merge pull request 'feat(governance): add local bounded verification executor' (#230) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 1m1s
2026-08-23 18:23:18 +00:00
m cf91807fab feat(governance): add local bounded verification executor
CI / test (push) Successful in 48s
CI / test (pull_request) Successful in 50s
2026-08-23 21:21:06 +03:00
m c925089fd2 Merge pull request 'fix(reflection): preserve cognition-required candidates' (#229) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 57s
2026-08-23 18:09:09 +00:00
m a2d0a3bf19 fix(reflection): preserve cognition-required candidates
CI / test (push) Successful in 51s
CI / test (pull_request) Successful in 48s
2026-08-23 21:07:02 +03:00
m c1cde67bcf Merge pull request 'fix(work-graph): preserve scheduled task evaluation revision' (#228) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 56s
2026-08-23 18:01:18 +00:00
m aeafc6e0ac fix(work-graph): preserve scheduled task evaluation revision
CI / test (push) Successful in 50s
CI / test (pull_request) Successful in 49s
2026-08-23 20:58:50 +03:00
m 1f5569db15 chore(governance): activate task evaluation callback repair 2026-08-23 20:57:52 +03:00
m 2b8cea5aa8 Merge pull request 'fix(cognitive): fail over task evaluation candidates' (#227) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 55s
2026-08-23 17:54:12 +00:00
m 7b09b3b2ec fix(cognitive): fail over task evaluation candidates
CI / test (push) Successful in 45s
CI / test (pull_request) Successful in 46s
2026-08-23 20:52:09 +03:00
m 9cc5101a30 Merge pull request 'test(work-graph): lock task evaluation wire contract' (#226) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 1m6s
2026-08-23 17:37:45 +00:00
m f90ed7af35 test(work-graph): lock task evaluation wire contract
CI / test (push) Successful in 50s
CI / test (pull_request) Successful in 50s
2026-08-23 20:35:27 +03:00
m 6f61601d77 Merge pull request 'fix(work-graph): diagnose task evaluation scheduling' (#225) from codex/dev-000248-self-development-runtime-status into main
CI / test (push) Successful in 54s
2026-08-23 17:19:14 +00:00
m 259e7343e3 fix(work-graph): log task evaluation scheduling rejection
CI / test (push) Successful in 50s
CI / test (pull_request) Successful in 51s
2026-08-23 20:17:08 +03:00
m cdc72e17be Merge pull request 'feat(research): expose truth runtime status' (#224) from codex/dev-000247-research-runtime-status into main
CI / test (push) Successful in 58s
2026-08-23 17:05:32 +00:00
42 changed files with 1386 additions and 41 deletions
+197
View File
@@ -0,0 +1,197 @@
// Package developmentexecutor contains the local, read-only verification
// adapter for governed development candidates. It is deliberately not a
// source mutator, promotion authority, secret resolver, or deployment tool.
package developmentexecutor
import (
"context"
"crypto/sha256"
"encoding/hex"
"errors"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"strings"
"time"
)
type CheckKind string
const (
CheckGoTest CheckKind = "GO_TEST"
CheckGoVet CheckKind = "GO_VET"
CheckGitDiffCheck CheckKind = "GIT_DIFF_CHECK"
)
type Check struct {
Kind CheckKind
Packages []string
}
type Plan struct {
Worktree string
WorktreeID string
BaseRepoRevision string
ProtectedMainAccess string
ProductionAccess string
SecretAccess string
Checks []Check
}
type CheckResult struct {
Kind CheckKind `json:"kind"`
Passed bool `json:"passed"`
ExitCode int `json:"exit_code"`
DurationMillis int64 `json:"duration_millis"`
}
type Result struct {
WorktreeID string `json:"worktree_id"`
BaseRepoRevision string `json:"base_repo_revision"`
Passed bool `json:"passed"`
Checks []CheckResult `json:"checks"`
EvidenceRef string `json:"evidence_ref"`
}
var (
ErrInvalidPlan = errors.New("invalid governed verification plan")
ErrUnsupportedCheck = errors.New("unsupported governed verification check")
ErrProtectedWorktree = errors.New("protected worktree is not executable")
)
type CommandRunner interface {
Run(context.Context, string, string, []string) int
}
type OSCommandRunner struct{}
func (OSCommandRunner) Run(ctx context.Context, dir, name string, args []string) int {
command := exec.CommandContext(ctx, name, args...)
command.Dir = dir
command.Stdin = nil
command.Stdout = io.Discard
command.Stderr = io.Discard
command.Env = safeEnvironment()
if err := command.Run(); err != nil {
if exitErr, ok := err.(*exec.ExitError); ok {
return exitErr.ExitCode()
}
return -1
}
return 0
}
func ValidatePlan(plan Plan) error {
if strings.TrimSpace(plan.Worktree) == "" || strings.TrimSpace(plan.WorktreeID) == "" || strings.TrimSpace(plan.BaseRepoRevision) == "" || len(plan.Checks) == 0 {
return ErrInvalidPlan
}
if !filepath.IsAbs(plan.Worktree) {
return ErrInvalidPlan
}
if plan.ProtectedMainAccess != "DENIED" || plan.ProductionAccess != "DENIED" || plan.SecretAccess != "DENIED" {
return ErrProtectedWorktree
}
switch strings.ToLower(filepath.Base(filepath.Clean(plan.WorktreeID))) {
case "main", "protected-main", "production":
return ErrProtectedWorktree
}
for _, check := range plan.Checks {
if err := validateCheck(check); err != nil {
return err
}
}
return nil
}
func validateCheck(check Check) error {
switch check.Kind {
case CheckGoTest, CheckGoVet:
if len(check.Packages) == 0 {
return ErrInvalidPlan
}
for _, packagePath := range check.Packages {
if strings.TrimSpace(packagePath) == "" || strings.ContainsAny(packagePath, ";&|`$()<>\r\n") || unsafePackagePath(packagePath) {
return ErrInvalidPlan
}
}
case CheckGitDiffCheck:
if len(check.Packages) != 0 {
return ErrInvalidPlan
}
default:
return ErrUnsupportedCheck
}
return nil
}
func unsafePackagePath(value string) bool {
value = strings.ReplaceAll(value, "\\", "/")
for _, part := range strings.Split(value, "/") {
if part == ".." {
return true
}
}
return strings.HasPrefix(value, "../") || strings.HasPrefix(value, "/") || (len(value) > 1 && value[1] == ':')
}
func Execute(ctx context.Context, plan Plan, runner CommandRunner) (Result, error) {
if err := ValidatePlan(plan); err != nil {
return Result{}, err
}
if runner == nil {
runner = OSCommandRunner{}
}
if _, err := os.Stat(plan.Worktree); err != nil {
return Result{}, fmt.Errorf("worktree unavailable: %w", err)
}
result := Result{WorktreeID: plan.WorktreeID, BaseRepoRevision: plan.BaseRepoRevision, Passed: true, Checks: make([]CheckResult, 0, len(plan.Checks))}
for _, check := range plan.Checks {
started := time.Now()
name, args := commandFor(check)
exitCode := runner.Run(ctx, plan.Worktree, name, args)
passed := exitCode == 0
result.Checks = append(result.Checks, CheckResult{Kind: check.Kind, Passed: passed, ExitCode: exitCode, DurationMillis: time.Since(started).Milliseconds()})
if !passed {
result.Passed = false
}
if ctx.Err() != nil {
result.Passed = false
break
}
}
result.EvidenceRef = evidenceRef(result)
return result, nil
}
func commandFor(check Check) (string, []string) {
switch check.Kind {
case CheckGoTest:
return "go", append([]string{"test"}, check.Packages...)
case CheckGoVet:
return "go", append([]string{"vet"}, check.Packages...)
default:
return "git", []string{"diff", "--check"}
}
}
func evidenceRef(result Result) string {
hash := sha256.New()
_, _ = fmt.Fprintf(hash, "%s|%s|%t|", result.WorktreeID, result.BaseRepoRevision, result.Passed)
for _, check := range result.Checks {
_, _ = fmt.Fprintf(hash, "%s|%t|%d|", check.Kind, check.Passed, check.ExitCode)
}
return "verification:" + hex.EncodeToString(hash.Sum(nil))
}
func safeEnvironment() []string {
allowed := []string{"PATH", "SystemRoot", "TEMP", "TMP", "GOROOT", "GOPATH", "GOMODCACHE"}
result := make([]string, 0, len(allowed))
for _, name := range allowed {
if value, ok := os.LookupEnv(name); ok && value != "" {
result = append(result, name+"="+value)
}
}
return result
}
@@ -0,0 +1,70 @@
package developmentexecutor
import (
"context"
"errors"
"path/filepath"
"testing"
)
type fakeRunner struct {
calls []string
exits []int
}
func (r *fakeRunner) Run(_ context.Context, _ string, name string, args []string) int {
call := name
for _, arg := range args {
call += " " + arg
}
r.calls = append(r.calls, call)
if len(r.exits) == 0 {
return 0
}
exit := r.exits[0]
r.exits = r.exits[1:]
return exit
}
func validPlan(t *testing.T) Plan {
t.Helper()
worktree, err := filepath.Abs(".")
if err != nil {
t.Fatal(err)
}
return Plan{Worktree: worktree, WorktreeID: "sandbox-1", BaseRepoRevision: "revision-1", ProtectedMainAccess: "DENIED", ProductionAccess: "DENIED", SecretAccess: "DENIED", Checks: []Check{{Kind: CheckGoTest, Packages: []string{"./modules/work/..."}}, {Kind: CheckGoVet, Packages: []string{"./modules/work/..."}}, {Kind: CheckGitDiffCheck}}}
}
func TestExecuteRunsOnlyTypedChecksAndReturnsEvidence(t *testing.T) {
runner := &fakeRunner{}
result, err := Execute(context.Background(), validPlan(t), runner)
if err != nil || !result.Passed || len(result.Checks) != 3 || result.EvidenceRef == "" {
t.Fatalf("result=%+v err=%v", result, err)
}
if len(runner.calls) != 3 || runner.calls[0] != "go test ./modules/work/..." || runner.calls[2] != "git diff --check" {
t.Fatalf("calls=%v", runner.calls)
}
}
func TestExecuteFailureCannotBecomeVerificationSuccess(t *testing.T) {
runner := &fakeRunner{exits: []int{1, 0}}
plan := validPlan(t)
plan.Checks = []Check{{Kind: CheckGoTest, Packages: []string{"./..."}}, {Kind: CheckGitDiffCheck}}
result, err := Execute(context.Background(), plan, runner)
if err != nil || result.Passed || result.Checks[0].Passed || result.EvidenceRef == "" {
t.Fatalf("failed result was overclaimed: %+v err=%v", result, err)
}
}
func TestValidatePlanRejectsProtectedAndShellLikeInputs(t *testing.T) {
protected := validPlan(t)
protected.WorktreeID = "production"
if !errors.Is(ValidatePlan(protected), ErrProtectedWorktree) {
t.Fatal("protected worktree accepted")
}
injection := validPlan(t)
injection.Checks = []Check{{Kind: CheckGoTest, Packages: []string{"./...; echo leaked"}}}
if !errors.Is(ValidatePlan(injection), ErrInvalidPlan) {
t.Fatal("shell-like package accepted")
}
}
+1 -1
View File
@@ -150,7 +150,7 @@ func (r *EpistemicsRepository) ClaimReflectionCandidate(ctx context.Context, wor
var value epistemics.ReflectionCandidate var value epistemics.ReflectionCandidate
err = tx.QueryRow(ctx, `SELECT reflection_candidate_id,trigger,state,source_experience_id,original_intent_id,source_utterance_id,summary,evidence_refs,requires_cognition,recorded_at_unix_millis,revision,claimed_by,claim_expires_at_unix_millis err = tx.QueryRow(ctx, `SELECT reflection_candidate_id,trigger,state,source_experience_id,original_intent_id,source_utterance_id,summary,evidence_refs,requires_cognition,recorded_at_unix_millis,revision,claimed_by,claim_expires_at_unix_millis
FROM epistemics.reflection_candidates FROM epistemics.reflection_candidates
WHERE state='OPEN' AND (claim_expires_at_unix_millis=0 OR claim_expires_at_unix_millis < $1) WHERE state='OPEN' AND requires_cognition=false AND (claim_expires_at_unix_millis=0 OR claim_expires_at_unix_millis < $1)
ORDER BY recorded_at_unix_millis,reflection_candidate_id ORDER BY recorded_at_unix_millis,reflection_candidate_id
FOR UPDATE SKIP LOCKED LIMIT 1`, nowUnixMillis).Scan(&value.ID, &value.Trigger, &value.State, &value.SourceExperienceID, &value.OriginalIntentID, &value.SourceUtteranceID, &value.Summary, &value.EvidenceRefs, &value.RequiresCognition, &value.RecordedAtUnixMillis, &value.Revision, &value.ClaimedBy, &value.ClaimExpiresAtUnixMillis) FOR UPDATE SKIP LOCKED LIMIT 1`, nowUnixMillis).Scan(&value.ID, &value.Trigger, &value.State, &value.SourceExperienceID, &value.OriginalIntentID, &value.SourceUtteranceID, &value.Summary, &value.EvidenceRefs, &value.RequiresCognition, &value.RecordedAtUnixMillis, &value.Revision, &value.ClaimedBy, &value.ClaimExpiresAtUnixMillis)
if err != nil { if err != nil {
@@ -50,6 +50,17 @@ func (e taskEvaluationExecutor) Execute(ctx context.Context, request work.AgentE
if len(response.Responses) == 0 || response.ObservedAtUnixMillis < 1 { if len(response.Responses) == 0 || response.ObservedAtUnixMillis < 1 {
return work.AgentExecutionResult{}, fmt.Errorf("task evaluation returned no observations") return work.AgentExecutionResult{}, fmt.Errorf("task evaluation returned no observations")
} }
if len(response.Observations) == len(intent.TaskEvaluationCases) && taskEvaluationHasCriticalFailure(response.Observations) {
evaluation, err := capabilitydomain.BuildTaskEvaluation(*intent.TaskEvaluationProfile, capability.TaskEvaluationID("evaluation:"+intent.DispatchID), response.BindingID, response.BindingRevision, intent.TaskEvaluationProfile.CapabilityID, response.Observations, artifact.ArtifactID(intent.TaskEvaluationCases[0].EvidenceArtifactRef), response.ObservedAtUnixMillis)
if err != nil {
return work.AgentExecutionResult{}, err
}
callback := work.TaskEvaluationEvidenceCallback{GraphID: execution.GraphID, Revision: execution.GraphRevision, NodeID: execution.NodeID, Evaluation: evaluation, Succeeded: true}
if _, err := postJSON[json.RawMessage](ctx, e.client, e.callbackURL+"/v1/work-graphs/task-evaluations/callback", callback); err != nil {
return work.AgentExecutionResult{}, err
}
return work.AgentExecutionResult{State: work.AgentExecutionCompleted, Summary: "task evaluation recorded as UNKNOWN after bounded provider recovery", OutcomeRef: string(evaluation.ID), ArtifactRefs: []string{string(evaluation.ArtifactID)}, ObservedAtUnixMillis: time.Now().UnixMilli()}, nil
}
if len(intent.TaskEvaluationCases) == 0 { if len(intent.TaskEvaluationCases) == 0 {
return work.AgentExecutionResult{}, fmt.Errorf("task evaluation cases are missing") return work.AgentExecutionResult{}, fmt.Errorf("task evaluation cases are missing")
} }
@@ -80,6 +91,15 @@ func (e taskEvaluationExecutor) Execute(ctx context.Context, request work.AgentE
return work.AgentExecutionResult{State: work.AgentExecutionCompleted, Summary: "task evaluation executed, aggregated and accepted by Work Graph callback", OutcomeRef: string(evaluation.ID), ArtifactRefs: []string{string(evaluation.ArtifactID)}, ObservedAtUnixMillis: time.Now().UnixMilli()}, nil return work.AgentExecutionResult{State: work.AgentExecutionCompleted, Summary: "task evaluation executed, aggregated and accepted by Work Graph callback", OutcomeRef: string(evaluation.ID), ArtifactRefs: []string{string(evaluation.ArtifactID)}, ObservedAtUnixMillis: time.Now().UnixMilli()}, nil
} }
func taskEvaluationHasCriticalFailure(observations []capability.TaskCaseObservation) bool {
for _, observation := range observations {
if observation.CriticalFailure {
return true
}
}
return false
}
func postJSON[T any](ctx context.Context, client *http.Client, url string, payload any) (T, error) { func postJSON[T any](ctx context.Context, client *http.Client, url string, payload any) (T, error) {
var result T var result T
body, err := json.Marshal(payload) body, err := json.Marshal(payload)
@@ -41,3 +41,32 @@ func TestTaskEvaluationExecutorInvokesAggregatesAndCallbacks(t *testing.T) {
t.Fatalf("result=%+v err=%v", result, err) t.Fatalf("result=%+v err=%v", result, err)
} }
} }
func TestTaskEvaluationExecutorPersistsUnknownAfterProviderFailure(t *testing.T) {
profile := capability.TaskEvaluationProfile{ID: "profile-unknown", Revision: 1, CapabilityID: "capability-1", Stage: capability.TaskEvaluationGeneral, BenchmarkVersion: "unknown-v1", RequiredCaseIDs: []string{"case-1"}, QualityWeightMillis: 600, ReliabilityWeightMillis: 300, LatencyWeightMillis: 100}
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/v1/task-evaluations/execute" {
_ = json.NewEncoder(w).Encode(capability.TaskEvaluationExecutionResponse{ProfileID: profile.ID, BindingID: "binding-1", BindingRevision: 3, Observations: []capability.TaskCaseObservation{{CaseID: "case-1", Result: capability.EvaluationUnknown, CriticalFailure: true, EvidenceArtifactRef: "artifact-1"}}, Responses: []capability.TaskCaseResponse{{CaseID: "case-1", EvidenceArtifactRef: "artifact-1"}}, ObservedAtUnixMillis: 10})
return
}
if r.URL.Path == "/v1/work-graphs/task-evaluations/callback" {
var callback work.TaskEvaluationEvidenceCallback
if err := json.NewDecoder(r.Body).Decode(&callback); err != nil || callback.Evaluation.Result != capability.EvaluationUnknown || !callback.Succeeded {
http.Error(w, "invalid unknown callback", http.StatusBadRequest)
return
}
w.WriteHeader(http.StatusNoContent)
return
}
if r.URL.Path == "/v1/task-evaluations/verify" {
t.Errorf("verifier must not be called for a provider failure")
}
http.NotFound(w, r)
}))
defer server.Close()
executor := newTaskEvaluationExecutor(server.URL, server.URL, server.URL, server.Client())
result, err := executor.Execute(context.Background(), work.AgentExecutionRequest{Intent: work.AgentDispatchIntent{DispatchID: "dispatch-unknown", TaskEvaluationBindingID: "binding-1", TaskEvaluationProfile: &profile, TaskEvaluationCases: []capability.TaskEvaluationCase{{CaseID: "case-1", Prompt: "answer", EvidenceArtifactRef: "artifact-1"}}, TaskEvaluationExecution: &work.TaskEvaluationDispatchContext{GraphID: "graph-1", GraphRevision: 1, NodeID: "node-1", BindingRevision: 3, ActorID: "actor-1", PrincipalID: "principal-1", ScopeID: "scope-1"}}})
if err != nil || result.State != work.AgentExecutionCompleted || result.OutcomeRef == "" {
t.Fatalf("result=%+v err=%v", result, err)
}
}
+74 -31
View File
@@ -1,9 +1,11 @@
package main package main
import ( import (
"context"
"encoding/json" "encoding/json"
"fmt" "fmt"
"net/http" "net/http"
"strings"
"sync" "sync"
"time" "time"
@@ -34,20 +36,13 @@ func (g cognitiveGateway) taskEvaluationHandler(w http.ResponseWriter, r *http.R
http.Error(w, "external egress acknowledgement required", http.StatusBadRequest) http.Error(w, "external egress acknowledgement required", http.StatusBadRequest)
return return
} }
provider := g.provider(selected)
if provider == nil {
http.Error(w, "cognitive provider unavailable", http.StatusServiceUnavailable)
return
}
caseSet := make(map[string]struct{}, len(request.Profile.RequiredCaseIDs)) caseSet := make(map[string]struct{}, len(request.Profile.RequiredCaseIDs))
seenCases := make(map[string]struct{}, len(request.Cases))
for _, id := range request.Profile.RequiredCaseIDs { for _, id := range request.Profile.RequiredCaseIDs {
caseSet[id] = struct{}{} caseSet[id] = struct{}{}
} }
observations := make([]capability.TaskCaseObservation, len(request.Cases)) for _, item := range request.Cases {
responses := make([]capability.TaskCaseResponse, len(request.Cases))
var wg sync.WaitGroup
seenCases := make(map[string]struct{}, len(request.Cases))
for i, item := range request.Cases {
if item.CaseID == "" || item.Prompt == "" || item.EvidenceArtifactRef == "" { if item.CaseID == "" || item.Prompt == "" || item.EvidenceArtifactRef == "" {
http.Error(w, "invalid task evaluation case", http.StatusBadRequest) http.Error(w, "invalid task evaluation case", http.StatusBadRequest)
return return
@@ -61,35 +56,83 @@ func (g cognitiveGateway) taskEvaluationHandler(w http.ResponseWriter, r *http.R
return return
} }
seenCases[item.CaseID] = struct{}{} seenCases[item.CaseID] = struct{}{}
wg.Add(1)
go func(index int, item capability.TaskEvaluationCase) {
defer wg.Done()
started := time.Now()
invocation := cognitive.AdvisoryRequest{Version: cognitive.CreatorAdvisoryV1, RequestID: cognitive.RequestID(fmt.Sprintf("task-evaluation:%s:%s", request.Profile.ID, item.CaseID)), ActorID: request.ActorID, PrincipalID: request.PrincipalID, ScopeID: request.ScopeID, Message: item.Prompt, MaxOutputBytes: int(request.MaxOutputBytes), ProviderBindingID: selected.Binding.ID, ProviderBindingRevision: selected.Binding.Revision, ProviderInstanceID: selected.Provider.ID, ModelDescriptorID: selected.Model.ID, ProviderModelID: selected.Model.ProviderModelID}
response, invokeErr := g.invokeAdmitted(r.Context(), string(invocation.RequestID), provider, invocation, int(request.MaxOutputBytes))
observation := capability.TaskCaseObservation{CaseID: item.CaseID, LatencyMicros: time.Since(started).Microseconds(), EvidenceArtifactRef: item.EvidenceArtifactRef}
responses[index] = capability.TaskCaseResponse{CaseID: item.CaseID, ResponseText: response.AdvisoryText, LatencyMicros: observation.LatencyMicros, EvidenceArtifactRef: item.EvidenceArtifactRef}
if invokeErr == nil && response.FinishReason == cognitive.FinishCompleted && response.AdvisoryText != "" {
// Invocation success proves reachability only. Without an
// independent verifier and answer evidence, semantic support and
// quality must remain UNKNOWN rather than becoming false evidence.
observation.Result = capability.EvaluationUnknown
observation.QualityScoreMillis = 0
} else {
observation.Result = capability.EvaluationUnknown
observation.CriticalFailure = invokeErr != nil
}
observations[index] = observation
}(i, item)
} }
if len(seenCases) != len(caseSet) { if len(seenCases) != len(caseSet) {
http.Error(w, "task evaluation case set is incomplete", http.StatusBadRequest) http.Error(w, "task evaluation case set is incomplete", http.StatusBadRequest)
return return
} }
wg.Wait()
// One bounded fan-out wave uses one binding snapshot. If that candidate is
// unavailable, only this binding is excluded and the existing resolver
// chooses the next eligible candidate. Provider output remains untrusted
// until the independent verifier accepts it downstream.
requirement := capability.CognitiveRequirement{CapabilityID: request.CapabilityID, OwnerPrincipalID: request.PrincipalID, DataPolicy: selected.Binding.DataPolicy, RequiredModalities: []capability.ModelModality{capability.ModalityText}, RequiredCapabilities: []capability.ModelCapability{capability.CapabilityAdvisory}, AllowCanary: g.allowCanary, MaxOutputBytes: request.MaxOutputBytes}
var observations []capability.TaskCaseObservation
var responses []capability.TaskCaseResponse
for attempt := 0; attempt < 3; attempt++ {
provider := g.provider(selected)
if provider == nil {
observations, responses = taskEvaluationUnavailable(request.Cases)
} else {
observations, responses = g.executeTaskEvaluationCases(r.Context(), request, selected, provider)
}
if taskEvaluationResponsesUsable(responses) {
break
}
requirement.ExcludedBindingIDs = append(requirement.ExcludedBindingIDs, selected.Binding.ID)
fallback, resolveErr := g.resolver.Resolve(r.Context(), requirement)
fallbackProvider := g.provider(fallback)
if resolveErr != nil || fallbackProvider == nil || fallback.Binding.ID == selected.Binding.ID || (fallback.Binding.DataPolicy != capability.DataPolicyLocalOnly && !request.EgressAcknowledged) {
break
}
selected = fallback
}
writeTaskEvaluationJSON(w, capability.TaskEvaluationExecutionResponse{ProfileID: request.Profile.ID, BindingID: selected.Binding.ID, BindingRevision: selected.Binding.Revision, Observations: observations, Responses: responses, ObservedAtUnixMillis: time.Now().UnixMilli()}) writeTaskEvaluationJSON(w, capability.TaskEvaluationExecutionResponse{ProfileID: request.Profile.ID, BindingID: selected.Binding.ID, BindingRevision: selected.Binding.Revision, Observations: observations, Responses: responses, ObservedAtUnixMillis: time.Now().UnixMilli()})
} }
func (g cognitiveGateway) executeTaskEvaluationCases(ctx context.Context, request capability.TaskEvaluationExecutionRequest, selected capability.ResolvedCognitiveBinding, provider advisoryProvider) ([]capability.TaskCaseObservation, []capability.TaskCaseResponse) {
observations := make([]capability.TaskCaseObservation, len(request.Cases))
responses := make([]capability.TaskCaseResponse, len(request.Cases))
var wg sync.WaitGroup
for i, item := range request.Cases {
wg.Add(1)
go func(index int, item capability.TaskEvaluationCase) {
defer wg.Done()
started := time.Now()
invocation := cognitive.AdvisoryRequest{Version: cognitive.CreatorAdvisoryV1, RequestID: cognitive.RequestID(fmt.Sprintf("task-evaluation:%s:%s", request.Profile.ID, item.CaseID)), ActorID: request.ActorID, PrincipalID: request.PrincipalID, ScopeID: request.ScopeID, Message: item.Prompt, MaxOutputBytes: int(request.MaxOutputBytes), ProviderBindingID: selected.Binding.ID, ProviderBindingRevision: selected.Binding.Revision, ProviderInstanceID: selected.Provider.ID, ModelDescriptorID: selected.Model.ID, ProviderModelID: selected.Model.ProviderModelID}
response, invokeErr := g.invokeAdmitted(ctx, string(invocation.RequestID), provider, invocation, int(request.MaxOutputBytes))
latency := time.Since(started).Microseconds()
observations[index] = capability.TaskCaseObservation{CaseID: item.CaseID, Result: capability.EvaluationUnknown, CriticalFailure: invokeErr != nil || response.FinishReason != cognitive.FinishCompleted || strings.TrimSpace(response.AdvisoryText) == "", EvidenceArtifactRef: item.EvidenceArtifactRef, LatencyMicros: latency}
responses[index] = capability.TaskCaseResponse{CaseID: item.CaseID, ResponseText: response.AdvisoryText, LatencyMicros: latency, EvidenceArtifactRef: item.EvidenceArtifactRef}
}(i, item)
}
wg.Wait()
return observations, responses
}
func taskEvaluationUnavailable(cases []capability.TaskEvaluationCase) ([]capability.TaskCaseObservation, []capability.TaskCaseResponse) {
observations := make([]capability.TaskCaseObservation, len(cases))
responses := make([]capability.TaskCaseResponse, len(cases))
for i, item := range cases {
observations[i] = capability.TaskCaseObservation{CaseID: item.CaseID, Result: capability.EvaluationUnknown, CriticalFailure: true, EvidenceArtifactRef: item.EvidenceArtifactRef}
responses[i] = capability.TaskCaseResponse{CaseID: item.CaseID, EvidenceArtifactRef: item.EvidenceArtifactRef}
}
return observations, responses
}
func taskEvaluationResponsesUsable(responses []capability.TaskCaseResponse) bool {
if len(responses) == 0 {
return false
}
for _, response := range responses {
if strings.TrimSpace(response.ResponseText) == "" {
return false
}
}
return true
}
func writeTaskEvaluationJSON(w http.ResponseWriter, value any) { func writeTaskEvaluationJSON(w http.ResponseWriter, value any) {
w.Header().Set("Content-Type", "application/json") w.Header().Set("Content-Type", "application/json")
_ = json.NewEncoder(w).Encode(value) _ = json.NewEncoder(w).Encode(value)
@@ -56,3 +56,90 @@ func TestTaskEvaluationHandlerInvokesEveryBoundedCase(t *testing.T) {
} }
} }
} }
type taskEvaluationFailoverRegistry struct {
primary, fallback capability.ResolvedCognitiveBinding
resolveCalls int
}
func (s *taskEvaluationFailoverRegistry) ResolveCandidate(context.Context, capability.CapabilityBindingID, int64) (capability.ResolvedCognitiveBinding, error) {
return s.primary, nil
}
func (s *taskEvaluationFailoverRegistry) Resolve(_ context.Context, requirement capability.CognitiveRequirement) (capability.ResolvedCognitiveBinding, error) {
s.resolveCalls++
if len(requirement.ExcludedBindingIDs) == 0 {
return s.primary, nil
}
return s.fallback, nil
}
func (s *taskEvaluationFailoverRegistry) Observe(context.Context, capability.CognitiveUsageObservation) error {
return nil
}
func (s *taskEvaluationFailoverRegistry) RegisterDiscovery(context.Context, capability.CognitiveDiscoverySnapshot) (capability.CognitiveDiscoveryRegistration, error) {
return capability.CognitiveDiscoveryRegistration{}, nil
}
func TestTaskEvaluationExcludesUnavailableCandidateAndUsesFallback(t *testing.T) {
primary := gatewaySelection()
fallback := primary
fallback.Binding.ID = "binding-fallback"
fallback.Binding.Revision = 7
fallback.Binding.ProviderInstanceID = "provider-fallback"
fallback.Provider.ID = "provider-fallback"
fallback.Provider.Kind = "provider-fallback-kind"
fallback.Provider.EndpointRef = "fallback-endpoint"
fallback.Provider.CredentialRef = "fallback-credential"
fallback.Model.ProviderInstanceID = "provider-fallback"
registry := &taskEvaluationFailoverRegistry{primary: primary, fallback: fallback}
primaryProvider := &stubAdvisoryProvider{response: cognitive.AdvisoryResponse{Version: cognitive.CreatorAdvisoryV1, FinishReason: cognitive.FinishProviderUnavailable}}
fallbackProvider := &stubAdvisoryProvider{response: cognitive.AdvisoryResponse{Version: cognitive.CreatorAdvisoryV1, FinishReason: cognitive.FinishCompleted, AdvisoryText: "fallback response"}}
gateway := cognitiveGateway{resolver: registry, providers: map[capability.ProviderKind][]providerRegistration{
primary.Provider.Kind: {{ProviderInstanceID: primary.Provider.ID, Kind: primary.Provider.Kind, EndpointRef: primary.Provider.EndpointRef, CredentialRef: primary.Provider.CredentialRef, Provider: primaryProvider}},
fallback.Provider.Kind: {{ProviderInstanceID: fallback.Provider.ID, Kind: fallback.Provider.Kind, EndpointRef: fallback.Provider.EndpointRef, CredentialRef: fallback.Provider.CredentialRef, Provider: fallbackProvider}},
}, now: func() time.Time { return time.UnixMilli(1000) }}
profile := capability.TaskEvaluationProfile{ID: "profile-failover", Revision: 1, CapabilityID: primary.Binding.CapabilityID, Stage: capability.TaskEvaluationGeneral, BenchmarkVersion: "failover-v1", RequiredCaseIDs: []string{"case-a"}, QualityWeightMillis: 600, ReliabilityWeightMillis: 300, LatencyWeightMillis: 100}
request := capability.TaskEvaluationExecutionRequest{Profile: profile, CapabilityID: profile.CapabilityID, BindingID: primary.Binding.ID, BindingRevision: primary.Binding.Revision, ActorID: identity.ActorID("actor-1"), PrincipalID: primary.Binding.OwnerPrincipalID, ScopeID: authority.ScopeID("scope-1"), MaxOutputBytes: 512, EgressAcknowledged: true, Cases: []capability.TaskEvaluationCase{{CaseID: "case-a", Prompt: "one", EvidenceArtifactRef: "artifact:a"}}}
payload, _ := json.Marshal(request)
recorder := httptest.NewRecorder()
gateway.taskEvaluationHandler(recorder, httptest.NewRequest(http.MethodPost, "/v1/task-evaluations/execute", bytes.NewReader(payload)))
if recorder.Code != http.StatusOK {
t.Fatalf("status=%d body=%s", recorder.Code, recorder.Body.String())
}
var response capability.TaskEvaluationExecutionResponse
if err := json.Unmarshal(recorder.Body.Bytes(), &response); err != nil {
t.Fatal(err)
}
if response.BindingID != fallback.Binding.ID || !primaryProvider.called || !fallbackProvider.called || registry.resolveCalls != 1 {
t.Fatalf("failover binding=%s primary_called=%t fallback_called=%t resolve_calls=%d", response.BindingID, primaryProvider.called, fallbackProvider.called, registry.resolveCalls)
}
if response.Observations[0].CriticalFailure || response.Responses[0].ResponseText != "fallback response" {
t.Fatalf("fallback response was not usable: %+v %+v", response.Observations, response.Responses)
}
}
func TestTaskEvaluationUnavailableResponseIsMarkedCriticalUnknown(t *testing.T) {
selected := gatewaySelection()
registry := &taskEvaluationFailoverRegistry{primary: selected, fallback: selected}
provider := &stubAdvisoryProvider{response: cognitive.AdvisoryResponse{Version: cognitive.CreatorAdvisoryV1, FinishReason: cognitive.FinishTimeout}}
gateway := cognitiveGateway{resolver: registry, providers: map[capability.ProviderKind][]providerRegistration{
selected.Provider.Kind: {{ProviderInstanceID: selected.Provider.ID, Kind: selected.Provider.Kind, EndpointRef: selected.Provider.EndpointRef, CredentialRef: selected.Provider.CredentialRef, Provider: provider}},
}, now: func() time.Time { return time.UnixMilli(1000) }}
profile := capability.TaskEvaluationProfile{ID: "profile-unknown", Revision: 1, CapabilityID: selected.Binding.CapabilityID, Stage: capability.TaskEvaluationGeneral, BenchmarkVersion: "unknown-v1", RequiredCaseIDs: []string{"case-a"}, QualityWeightMillis: 600, ReliabilityWeightMillis: 300, LatencyWeightMillis: 100}
request := capability.TaskEvaluationExecutionRequest{Profile: profile, CapabilityID: profile.CapabilityID, BindingID: selected.Binding.ID, BindingRevision: selected.Binding.Revision, ActorID: identity.ActorID("actor-1"), PrincipalID: selected.Binding.OwnerPrincipalID, ScopeID: authority.ScopeID("scope-1"), MaxOutputBytes: 512, EgressAcknowledged: true, Cases: []capability.TaskEvaluationCase{{CaseID: "case-a", Prompt: "one", EvidenceArtifactRef: "artifact:a"}}}
payload, _ := json.Marshal(request)
recorder := httptest.NewRecorder()
gateway.taskEvaluationHandler(recorder, httptest.NewRequest(http.MethodPost, "/v1/task-evaluations/execute", bytes.NewReader(payload)))
if recorder.Code != http.StatusOK {
t.Fatalf("status=%d body=%s", recorder.Code, recorder.Body.String())
}
var response capability.TaskEvaluationExecutionResponse
if err := json.Unmarshal(recorder.Body.Bytes(), &response); err != nil {
t.Fatal(err)
}
if len(response.Observations) != 1 || response.Observations[0].Result != capability.EvaluationUnknown || !response.Observations[0].CriticalFailure {
t.Fatalf("unavailable response was overclaimed: %+v", response.Observations)
}
}
+97
View File
@@ -1,14 +1,111 @@
package main package main
import ( import (
"context"
"errors" "errors"
"strings"
"time" "time"
"git.cin.su/m/Assistant/adapters/developmentexecutor"
"git.cin.su/m/Assistant/contracts/work" "git.cin.su/m/Assistant/contracts/work"
workdomain "git.cin.su/m/Assistant/modules/work/domain" workdomain "git.cin.su/m/Assistant/modules/work/domain"
"git.cin.su/m/Assistant/modules/work/ports"
) )
var errDevelopmentGateCreate = errors.New("development gate must start at evidence collected with revision one") var errDevelopmentGateCreate = errors.New("development gate must start at evidence collected with revision one")
var errDevelopmentGateNotIsolated = errors.New("development gate is not isolated")
var errDevelopmentVerifierNotIndependent = errors.New("development verifier is not independent")
var errDevelopmentWorktreeMismatch = errors.New("verification worktree does not match gate")
var errDevelopmentChecksFailed = errors.New("development verification checks failed")
var errDevelopmentEvidenceRequired = errors.New("development transition evidence is required")
var errDevelopmentEvidenceStage = errors.New("development transition evidence does not match stage")
type developmentGateVerificationRequest struct {
GateID string
ExpectedRevision int64
VerifierRunID work.AgentRunID
Plan developmentexecutor.Plan
}
type developmentGateEvidenceRequest struct {
GateID string
ExpectedRevision int64
NextStage work.DevelopmentStage
EvidenceRef string
}
func recordDevelopmentGateEvidence(ctx context.Context, store ports.DevelopmentGateStore, request developmentGateEvidenceRequest, now time.Time) (work.DevelopmentGate, error) {
gate, err := store.LoadDevelopmentGate(ctx, request.GateID)
if err != nil {
return work.DevelopmentGate{}, err
}
if request.ExpectedRevision < 1 || gate.Revision != request.ExpectedRevision {
return gate, errDevelopmentGateNotIsolated
}
if strings.TrimSpace(request.EvidenceRef) == "" {
return gate, errDevelopmentEvidenceRequired
}
switch request.NextStage {
case work.DevelopmentCanary:
gate.CanaryEvidence = strings.TrimSpace(request.EvidenceRef)
case work.DevelopmentPromoted:
gate.PromotionRef = strings.TrimSpace(request.EvidenceRef)
case work.DevelopmentRolledBack:
gate.RollbackRef = strings.TrimSpace(request.EvidenceRef)
default:
return gate, errDevelopmentEvidenceStage
}
advanced, err := advanceDevelopmentGate(gate, request.NextStage, now)
if err != nil {
return gate, err
}
if err := store.SaveDevelopmentGate(ctx, advanced, request.ExpectedRevision); err != nil {
return gate, err
}
return advanced, nil
}
func verifyDevelopmentGate(ctx context.Context, store ports.DevelopmentGateStore, request developmentGateVerificationRequest, now time.Time, runner developmentexecutor.CommandRunner) (work.DevelopmentGate, developmentexecutor.Result, error) {
gate, err := store.LoadDevelopmentGate(ctx, request.GateID)
if err != nil {
return work.DevelopmentGate{}, developmentexecutor.Result{}, err
}
if request.ExpectedRevision < 1 || gate.Revision != request.ExpectedRevision || gate.Stage != work.DevelopmentIsolated {
return gate, developmentexecutor.Result{}, errDevelopmentGateNotIsolated
}
if request.VerifierRunID == "" || sameRun(request.VerifierRunID, gate.ProducerRunRefs) {
return gate, developmentexecutor.Result{}, errDevelopmentVerifierNotIndependent
}
if request.Plan.WorktreeID != gate.WorktreeRef {
return gate, developmentexecutor.Result{}, errDevelopmentWorktreeMismatch
}
result, err := developmentexecutor.Execute(ctx, request.Plan, runner)
if err != nil {
return gate, result, err
}
if !result.Passed {
return gate, result, errDevelopmentChecksFailed
}
gate.VerifierRunRefs = append(append([]work.AgentRunID(nil), gate.VerifierRunRefs...), request.VerifierRunID)
gate.VerificationEvidence = result.EvidenceRef
advanced, err := advanceDevelopmentGate(gate, work.DevelopmentVerified, now)
if err != nil {
return gate, result, err
}
if err := store.SaveDevelopmentGate(ctx, advanced, request.ExpectedRevision); err != nil {
return gate, result, err
}
return advanced, result, nil
}
func sameRun(value work.AgentRunID, runs []work.AgentRunID) bool {
for _, run := range runs {
if run == value {
return true
}
}
return false
}
func prepareDevelopmentGate(value work.DevelopmentGate, now time.Time) (work.DevelopmentGate, error) { func prepareDevelopmentGate(value work.DevelopmentGate, now time.Time) (work.DevelopmentGate, error) {
if value.Stage != work.DevelopmentEvidenceCollected || value.Revision != 1 { if value.Stage != work.DevelopmentEvidenceCollected || value.Revision != 1 {
+141
View File
@@ -1,12 +1,153 @@
package main package main
import ( import (
"context"
"path/filepath"
"testing" "testing"
"time" "time"
"git.cin.su/m/Assistant/adapters/developmentexecutor"
"git.cin.su/m/Assistant/contracts/work" "git.cin.su/m/Assistant/contracts/work"
) )
type developmentGateStoreStub struct {
gate work.DevelopmentGate
saved bool
expected int64
}
func (s *developmentGateStoreStub) LoadDevelopmentGate(context.Context, string) (work.DevelopmentGate, error) {
return s.gate, nil
}
func (s *developmentGateStoreStub) SaveDevelopmentGate(_ context.Context, gate work.DevelopmentGate, expected int64) error {
s.gate = gate
s.saved = true
s.expected = expected
return nil
}
type developmentCommandRunnerStub struct {
exitCodes []int
commands int
}
func (r *developmentCommandRunnerStub) Run(context.Context, string, string, []string) int {
code := 0
if r.commands < len(r.exitCodes) {
code = r.exitCodes[r.commands]
}
r.commands++
return code
}
func validDevelopmentVerificationPlan(t *testing.T, worktreeID string) developmentexecutor.Plan {
t.Helper()
worktree, err := filepath.Abs(".")
if err != nil {
t.Fatal(err)
}
return developmentexecutor.Plan{
Worktree: worktree,
WorktreeID: worktreeID,
BaseRepoRevision: "base-revision",
ProtectedMainAccess: "DENIED",
ProductionAccess: "DENIED",
SecretAccess: "DENIED",
Checks: []developmentexecutor.Check{{Kind: developmentexecutor.CheckGitDiffCheck}},
}
}
func isolatedDevelopmentGate() work.DevelopmentGate {
return work.DevelopmentGate{
ID: "gate-1",
Revision: 4,
Stage: work.DevelopmentIsolated,
EvidenceRefs: []string{"evidence-1"},
ProposalRef: "proposal-1",
TaskPacketRef: "task-1",
WorktreeRef: "sandbox-1",
ProducerRunRefs: []work.AgentRunID{"producer-1"},
VerifierRunRefs: nil,
VerificationEvidence: "",
}
}
func TestVerifyDevelopmentGatePersistsVerifiedWithIndependentEvidence(t *testing.T) {
store := &developmentGateStoreStub{gate: isolatedDevelopmentGate()}
runner := &developmentCommandRunnerStub{exitCodes: []int{0}}
gate, result, err := verifyDevelopmentGate(context.Background(), store, developmentGateVerificationRequest{
GateID: "gate-1",
ExpectedRevision: 4,
VerifierRunID: "verifier-1",
Plan: validDevelopmentVerificationPlan(t, "sandbox-1"),
}, time.UnixMilli(20), runner)
if err != nil {
t.Fatal(err)
}
if !result.Passed || gate.Stage != work.DevelopmentVerified || gate.Revision != 5 {
t.Fatalf("verification did not advance gate: gate=%#v result=%#v", gate, result)
}
if !store.saved || store.expected != 4 || gate.VerificationEvidence == "" {
t.Fatalf("verification was not durably persisted: store=%#v gate=%#v", store, gate)
}
}
func TestVerifyDevelopmentGateLeavesIsolatedOnFailedChecks(t *testing.T) {
store := &developmentGateStoreStub{gate: isolatedDevelopmentGate()}
gate, result, err := verifyDevelopmentGate(context.Background(), store, developmentGateVerificationRequest{
GateID: "gate-1",
ExpectedRevision: 4,
VerifierRunID: "verifier-1",
Plan: validDevelopmentVerificationPlan(t, "sandbox-1"),
}, time.UnixMilli(20), &developmentCommandRunnerStub{exitCodes: []int{1}})
if err != errDevelopmentChecksFailed || result.Passed || gate.Stage != work.DevelopmentIsolated || store.saved {
t.Fatalf("failed checks changed gate unexpectedly: gate=%#v result=%#v err=%v store=%#v", gate, result, err, store)
}
}
func TestVerifyDevelopmentGateRejectsProducerAsVerifier(t *testing.T) {
store := &developmentGateStoreStub{gate: isolatedDevelopmentGate()}
_, _, err := verifyDevelopmentGate(context.Background(), store, developmentGateVerificationRequest{
GateID: "gate-1",
ExpectedRevision: 4,
VerifierRunID: "producer-1",
Plan: validDevelopmentVerificationPlan(t, "sandbox-1"),
}, time.UnixMilli(20), &developmentCommandRunnerStub{exitCodes: []int{0}})
if err != errDevelopmentVerifierNotIndependent {
t.Fatalf("producer was accepted as verifier: %v", err)
}
}
func TestRecordDevelopmentGateEvidenceAdvancesCanaryAndPromotion(t *testing.T) {
store := &developmentGateStoreStub{gate: work.DevelopmentGate{
ID: "gate-1", Revision: 6, Stage: work.DevelopmentVerified,
EvidenceRefs: []string{"evidence-1"}, ProposalRef: "proposal-1", TaskPacketRef: "task-1", WorktreeRef: "sandbox-1",
ProducerRunRefs: []work.AgentRunID{"producer-1"}, VerifierRunRefs: []work.AgentRunID{"verifier-1"}, VerificationEvidence: "verification-1",
}}
gate, err := recordDevelopmentGateEvidence(context.Background(), store, developmentGateEvidenceRequest{GateID: "gate-1", ExpectedRevision: 6, NextStage: work.DevelopmentCanary, EvidenceRef: "canary-1"}, time.UnixMilli(30))
if err != nil || gate.Stage != work.DevelopmentCanary || gate.Revision != 7 || gate.CanaryEvidence != "canary-1" {
t.Fatalf("canary transition failed: gate=%#v err=%v", gate, err)
}
gate, err = recordDevelopmentGateEvidence(context.Background(), store, developmentGateEvidenceRequest{GateID: "gate-1", ExpectedRevision: 7, NextStage: work.DevelopmentPromoted, EvidenceRef: "promotion-1"}, time.UnixMilli(31))
if err != nil || gate.Stage != work.DevelopmentPromoted || gate.Revision != 8 || gate.PromotionRef != "promotion-1" {
t.Fatalf("promotion transition failed: gate=%#v err=%v", gate, err)
}
}
func TestRecordDevelopmentGateEvidenceSupportsCanaryRollbackAndRejectsMissingEvidence(t *testing.T) {
store := &developmentGateStoreStub{gate: work.DevelopmentGate{ID: "gate-1", Revision: 2, Stage: work.DevelopmentCanary, EvidenceRefs: []string{"evidence-1"}, CanaryEvidence: "canary-1"}}
gate, err := recordDevelopmentGateEvidence(context.Background(), store, developmentGateEvidenceRequest{GateID: "gate-1", ExpectedRevision: 2, NextStage: work.DevelopmentRolledBack, EvidenceRef: "rollback-1"}, time.UnixMilli(40))
if err != nil || gate.Stage != work.DevelopmentRolledBack || gate.RollbackRef != "rollback-1" {
t.Fatalf("rollback transition failed: gate=%#v err=%v", gate, err)
}
store = &developmentGateStoreStub{gate: work.DevelopmentGate{ID: "gate-2", Revision: 2, Stage: work.DevelopmentCanary, EvidenceRefs: []string{"evidence-1"}, CanaryEvidence: "canary-1"}}
gate, err = recordDevelopmentGateEvidence(context.Background(), store, developmentGateEvidenceRequest{GateID: "gate-2", ExpectedRevision: 2, NextStage: work.DevelopmentRolledBack}, time.UnixMilli(40))
if err != errDevelopmentEvidenceRequired || gate.Stage != work.DevelopmentCanary || store.saved {
t.Fatalf("missing rollback evidence changed gate: gate=%#v err=%v store=%#v", gate, err, store)
}
}
func TestDevelopmentGateControllerRequiresSequentialVerifiedEvidence(t *testing.T) { func TestDevelopmentGateControllerRequiresSequentialVerifiedEvidence(t *testing.T) {
now := time.UnixMilli(10) now := time.UnixMilli(10)
gate, err := prepareDevelopmentGate(work.DevelopmentGate{ID: "gate-1", Revision: 1, Stage: work.DevelopmentEvidenceCollected, EvidenceRefs: []string{"evidence-1"}}, now) gate, err := prepareDevelopmentGate(work.DevelopmentGate{ID: "gate-1", Revision: 1, Stage: work.DevelopmentEvidenceCollected, EvidenceRefs: []string{"evidence-1"}}, now)
+51
View File
@@ -5,6 +5,7 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"git.cin.su/m/Assistant/adapters/developmentexecutor"
"git.cin.su/m/Assistant/adapters/postgres" "git.cin.su/m/Assistant/adapters/postgres"
"git.cin.su/m/Assistant/contracts/authority" "git.cin.su/m/Assistant/contracts/authority"
"git.cin.su/m/Assistant/contracts/capability" "git.cin.su/m/Assistant/contracts/capability"
@@ -311,6 +312,56 @@ func main() {
w.Header().Set("Content-Type", "application/json") w.Header().Set("Content-Type", "application/json")
_ = json.NewEncoder(w).Encode(gate) _ = json.NewEncoder(w).Encode(gate)
}) })
mux.HandleFunc("POST /v1/creator/development/gates/{id}/verify", func(w http.ResponseWriter, r *http.Request) {
if _, ok := authenticateCreator(w, r); !ok {
return
}
var request struct {
ExpectedRevision int64 `json:"expected_revision"`
VerifierRunID work.AgentRunID `json:"verifier_run_id"`
Plan developmentexecutor.Plan `json:"plan"`
}
decoder := json.NewDecoder(http.MaxBytesReader(w, r.Body, 64<<10))
decoder.DisallowUnknownFields()
if err := decoder.Decode(&request); err != nil || request.ExpectedRevision < 1 || request.VerifierRunID == "" {
http.Error(w, "invalid development verification request", http.StatusBadRequest)
return
}
gate, result, err := verifyDevelopmentGate(r.Context(), workRepository, developmentGateVerificationRequest{GateID: r.PathValue("id"), ExpectedRevision: request.ExpectedRevision, VerifierRunID: request.VerifierRunID, Plan: request.Plan}, time.Now(), developmentexecutor.OSCommandRunner{})
if err != nil {
http.Error(w, err.Error(), http.StatusUnprocessableEntity)
return
}
w.Header().Set("Content-Type", "application/json")
_ = json.NewEncoder(w).Encode(map[string]any{"gate": gate, "verification": result})
})
registerDevelopmentGateEvidenceRoute := func(path string, next work.DevelopmentStage, fieldName string) {
mux.HandleFunc("POST /v1/creator/development/gates/{id}/"+path, func(w http.ResponseWriter, r *http.Request) {
if _, ok := authenticateCreator(w, r); !ok {
return
}
var request struct {
ExpectedRevision int64 `json:"expected_revision"`
EvidenceRef string `json:"evidence_ref"`
}
decoder := json.NewDecoder(http.MaxBytesReader(w, r.Body, 16<<10))
decoder.DisallowUnknownFields()
if err := decoder.Decode(&request); err != nil || request.ExpectedRevision < 1 || request.EvidenceRef == "" {
http.Error(w, "invalid development transition evidence", http.StatusBadRequest)
return
}
gate, err := recordDevelopmentGateEvidence(r.Context(), workRepository, developmentGateEvidenceRequest{GateID: r.PathValue("id"), ExpectedRevision: request.ExpectedRevision, NextStage: next, EvidenceRef: request.EvidenceRef}, time.Now())
if err != nil {
http.Error(w, "development "+fieldName+" transition rejected", http.StatusUnprocessableEntity)
return
}
w.Header().Set("Content-Type", "application/json")
_ = json.NewEncoder(w).Encode(gate)
})
}
registerDevelopmentGateEvidenceRoute("canary", work.DevelopmentCanary, "canary")
registerDevelopmentGateEvidenceRoute("promote", work.DevelopmentPromoted, "promotion")
registerDevelopmentGateEvidenceRoute("rollback", work.DevelopmentRolledBack, "rollback")
mux.HandleFunc("GET /v1/creator/focus", func(w http.ResponseWriter, r *http.Request) { mux.HandleFunc("GET /v1/creator/focus", func(w http.ResponseWriter, r *http.Request) {
session, ok := authenticateCreator(w, r) session, ok := authenticateCreator(w, r)
if !ok { if !ok {
+34
View File
@@ -0,0 +1,34 @@
package main
import (
"strings"
"testing"
)
func TestCreatorConsoleResponsiveGuardrails(t *testing.T) {
html, err := staticFiles.ReadFile("static/index.html")
if err != nil {
t.Fatal(err)
}
if !strings.Contains(string(html), `<meta name="viewport" content="width=device-width, initial-scale=1">`) {
t.Fatal("creator console is missing responsive viewport metadata")
}
css, err := staticFiles.ReadFile("static/assets/console.css")
if err != nil {
t.Fatal(err)
}
stylesheet := string(css)
for _, guard := range []string{
"@media (max-width: 680px)",
".console { display: block; }",
".diagnostic-list { grid-template-columns: 1fr; }",
".agent-details { grid-template-columns: 1fr; gap: 14px; }",
".fleet-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }",
".section-nav { display: flex;",
"overflow-x: auto",
} {
if !strings.Contains(stylesheet, guard) {
t.Fatalf("responsive guardrail missing: %s", guard)
}
}
}
+16
View File
@@ -44,6 +44,7 @@ func main() {
} }
graph, ready, err := application.AdmitAndSchedule(r.Context(), repository, request) graph, ready, err := application.AdmitAndSchedule(r.Context(), repository, request)
if err != nil { if err != nil {
log.Printf("work graph schedule rejected: %v", err)
http.Error(w, err.Error(), http.StatusUnprocessableEntity) http.Error(w, err.Error(), http.StatusUnprocessableEntity)
return return
} }
@@ -57,6 +58,21 @@ func main() {
} }
graph, ready, err := application.AdmitAndScheduleTaskEvaluation(r.Context(), repository, request) graph, ready, err := application.AdmitAndScheduleTaskEvaluation(r.Context(), repository, request)
if err != nil { if err != nil {
log.Printf("task evaluation graph schedule rejected: %v", err)
http.Error(w, err.Error(), http.StatusUnprocessableEntity)
return
}
writeJSON(w, map[string]any{"graph": graph, "scheduled_nodes": ready})
})
mux.HandleFunc("POST /v1/work-graphs/task-evaluations/additional/schedule", func(w http.ResponseWriter, r *http.Request) {
var request application.TaskEvaluationExpansionScheduleRequest
if err := json.NewDecoder(http.MaxBytesReader(w, r.Body, 4<<20)).Decode(&request); err != nil {
http.Error(w, "invalid additional task evaluation request", http.StatusBadRequest)
return
}
graph, ready, err := application.ScheduleAdditionalTaskEvaluation(r.Context(), repository, request)
if err != nil {
log.Printf("additional task evaluation schedule rejected: %v", err)
http.Error(w, err.Error(), http.StatusUnprocessableEntity) http.Error(w, err.Error(), http.StatusUnprocessableEntity)
return return
} }
+2 -2
View File
@@ -1,5 +1,5 @@
{ {
"task_file": "dev/tasks/DEV-000247-research-runtime-status.json", "task_file": "dev/tasks/DEV-000263-gpu-qualification-runtime-evidence.json",
"task_id": "DEV-000247", "task_id": "DEV-000263",
"task_revision": 1 "task_revision": 1
} }
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000248",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "cdc72e17be46c843737eabcd654cb69ae32d6268",
"risk_tier": "E",
"intent": "Diagnose and repair the live Work Graph task-evaluation scheduling path exposed by the production canary, preserving durable fan-out and callback semantics.",
"requirement_ids": ["live task evaluation", "model quality qualification", "Work Graph integration"],
"allowed_change_scope": {"modules": ["work", "capability"], "paths": ["cmd/work-graph-runtime/**", "adapters/postgres/work_repository.go", "modules/work/application/**", "modules/work/domain/**", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000248-live-task-evaluation-scheduling.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "modules/work/secrets/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["existing TaskEvaluationGraphRequest", "existing AgentDispatchIntent", "existing Work Graph repository"], "may_change": ["diagnostic logging and local integration behavior"]},
"semantic_owner": "Work Graph task-evaluation scheduling",
"canonical_state": ["existing graph, dispatch and evaluation records only"],
"state_transitions": ["schedule -> queue -> evaluator -> verifier -> evidence callback"],
"side_effects_and_privileges": ["existing work/capability owner writes; no new privileges"],
"persistence_and_migrations": ["none unless current schema mismatch is proven"],
"failure_retry_restart": ["failed scheduling leaves no partial graph or dispatch mutation; durable retries remain existing worker behavior"],
"assumptions": ["production canary payload is provider-neutral and contains no secret"],
"acceptance_scenarios": ["live general evaluation graph schedules", "worker executes and verifier accepts one case", "TaskEvaluation persists", "graph callback reaches terminal state"],
"required_tests": ["go test ./cmd/work-graph-runtime ./modules/work/application ./modules/work/domain ./adapters/postgres", "go vet ./cmd/work-graph-runtime ./modules/work/application ./modules/work/domain ./adapters/postgres", "go run ./cmd/devctl preflight -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-diff -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-architecture", "git diff --check", "independent", "CI", "production health smoke", "live task-evaluation canary"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000249",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "f90ed7af35f9f19c72039812272640ae1d63635b",
"risk_tier": "E",
"intent": "Make task-evaluation execution use the existing cognitive model resolution and local fallback path without recording unsupported output as qualification evidence.",
"requirement_ids": ["model fleet/failover", "live task evaluation", "local recovery"],
"allowed_change_scope": {"modules": ["capability", "work"], "paths": ["cmd/cognitive-worker/**", "cmd/agent-worker/**", "modules/capability/domain/**", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000249-task-evaluation-model-failover.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "modules/work/**", "modules/work/secrets/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["existing CognitiveRequirement", "existing ResolvedCognitiveBinding", "existing TaskEvaluationExecutionRequest/Response"], "may_change": []},
"semantic_owner": "capability cognitive execution adapter",
"canonical_state": ["existing cognitive usage observations and task evaluation records only"],
"state_transitions": ["candidate invocation -> bounded fallback candidate -> verified evaluation or UNKNOWN"],
"side_effects_and_privileges": ["existing cognitive provider calls and capability observations; no new privileges"],
"persistence_and_migrations": ["none"],
"failure_retry_restart": ["provider failure excludes the failed binding for the current bounded execution; all candidates unavailable returns UNKNOWN without qualification"],
"assumptions": ["fallback resolution remains governed by the existing capability resolver and data-policy checks"],
"acceptance_scenarios": ["task evaluation invokes active candidate", "provider-unavailable candidate is excluded and local candidate is attempted", "empty/non-completed provider response never becomes supported evidence", "all candidates unavailable produces durable UNKNOWN evaluation and terminal graph callback"],
"required_tests": ["go test ./cmd/cognitive-worker ./modules/capability/domain", "go vet ./cmd/cognitive-worker ./modules/capability/domain", "go run ./cmd/devctl preflight -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-diff -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-architecture", "git diff --check", "independent", "CI", "production health smoke", "live task-evaluation canary"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000250",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "2b8cea5aa8f43f597b2af7d92c2eaa305d68256e",
"risk_tier": "E",
"intent": "Preserve the scheduled Work Graph revision in task-evaluation dispatch context so verifier callbacks complete the current immutable graph revision and reach terminal state.",
"requirement_ids": ["live task evaluation", "Work Graph integration", "durable callback lineage"],
"allowed_change_scope": {"modules": ["work"], "paths": ["modules/work/application/**", "modules/work/domain/**", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000250-task-evaluation-terminal-callback.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "cmd/cognitive-worker/**", "cmd/agent-worker/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["existing WorkGraph scheduler", "existing TaskEvaluationDispatchContext", "existing callback contract"], "may_change": []},
"semantic_owner": "Work Graph task-evaluation scheduling",
"canonical_state": ["existing immutable graph revisions and node states only"],
"state_transitions": ["scheduled revision -> evaluator callback -> completed revision -> terminal graph"],
"side_effects_and_privileges": ["existing work and capability owner writes; no new privileges"],
"persistence_and_migrations": ["none"],
"failure_retry_restart": ["callback uses the revision that contains the leased node; duplicate callback remains protected by existing immutable revision/idempotency behavior"],
"assumptions": ["scheduler increments the draft graph revision exactly once before enqueueing dispatches"],
"acceptance_scenarios": ["live task-evaluation callback updates scheduled revision", "unknown evaluation reaches graph terminal state", "successful verified evaluation reaches graph terminal state", "callback lineage remains serializable"],
"required_tests": ["go test ./modules/work/application ./modules/work/domain", "go vet ./modules/work/application ./modules/work/domain", "go run ./cmd/devctl preflight -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-diff -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-architecture", "git diff --check", "independent", "CI", "production health smoke", "live task-evaluation canary"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000251",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "c1cde67bcfff8e0e80553ce0562f9841f6c00b30",
"risk_tier": "E",
"intent": "Prevent the reflection worker from resolving cognition-required candidates before a governed reflection path evaluates them.",
"requirement_ids": ["learning reflection loop", "durable candidate routing", "no false resolution"],
"allowed_change_scope": {"modules": ["epistemics"], "paths": ["adapters/postgres/epistemics_repository.go", "cmd/reflection-worker/**", "modules/epistemics/domain/**", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000251-reflection-cognition-routing.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "modules/work/**", "cmd/cognitive-worker/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["existing ReflectionCandidate state and requires_cognition field", "existing Epistemics repository"], "may_change": []},
"semantic_owner": "Epistemics reflection candidate lifecycle",
"canonical_state": ["existing epistemics.reflection_candidates rows only"],
"state_transitions": ["OPEN deterministic -> EVALUATING -> RESOLVED", "OPEN cognition-required remains OPEN until governed evaluator"],
"side_effects_and_privileges": ["existing epistemics owner updates only; no cognition call or proposal promotion"],
"persistence_and_migrations": ["none"],
"failure_retry_restart": ["cognition-required candidates remain durable and claimable only by a future cognition evaluator; stale deterministic claims recover"],
"assumptions": ["reflection worker is the deterministic close loop and must not impersonate a cognitive evaluator"],
"acceptance_scenarios": ["worker resolves deterministic candidate", "worker does not claim cognition-required candidate", "OPEN cognition candidate survives restart", "status remains healthy when only cognition candidates are pending"],
"required_tests": ["go test ./cmd/reflection-worker ./adapters/postgres ./modules/epistemics/domain", "go vet ./cmd/reflection-worker ./adapters/postgres ./modules/epistemics/domain", "go run ./cmd/devctl preflight -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-diff -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-architecture", "git diff --check", "independent", "CI", "production health smoke", "live reflection-worker status"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000252",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "c925089fd2304213758d2721a0592ca73d765047",
"risk_tier": "E",
"intent": "Add a local governed verification executor that runs only typed, bounded checks inside an isolated worktree and returns evidence without source, secret, production or promotion authority.",
"requirement_ids": ["governed self-development", "isolated verification", "independent test evidence"],
"allowed_change_scope": {"modules": ["governed-development"], "paths": ["adapters/developmentexecutor/**", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000252-local-governed-verification-executor.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "modules/work/**", "cmd/core-runtime/**", "cmd/agent-worker/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["existing DevelopmentScaffold semantics", "typed local check plan"], "may_change": []},
"semantic_owner": "governed development verification adapter",
"canonical_state": ["none; executor returns evidence to a future gate owner"],
"state_transitions": ["typed plan -> validated sandbox checks -> immutable result summary"],
"side_effects_and_privileges": ["read-only source/test execution in supplied isolated worktree; no secrets, production, protected main or promotion access"],
"persistence_and_migrations": ["none"],
"failure_retry_restart": ["each check has an explicit result; failed or cancelled checks never become verification success; rerun creates a new result"],
"assumptions": ["worktree isolation and gate persistence are supplied by the surrounding governed control plane"],
"acceptance_scenarios": ["allowed go test/vet and git diff check plans validate", "shell injection and unsupported commands reject", "protected or production worktree rejects", "failed check returns non-success evidence", "result contains no command output or secret material"],
"required_tests": ["go test ./adapters/developmentexecutor", "go vet ./adapters/developmentexecutor", "go run ./cmd/devctl preflight -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-diff -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-architecture", "git diff --check", "independent", "CI"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000253",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "f2e520e31e27563a17f66c73ff68b35bc93963a0",
"risk_tier": "E",
"intent": "Connect the local bounded verification executor to the authenticated durable DevelopmentGate ISOLATED-to-VERIFIED transition with optimistic revision and independent verifier checks.",
"requirement_ids": ["governed self-development", "independent verification", "durable gate progression"],
"allowed_change_scope": {"modules": ["governed-development"], "paths": ["cmd/core-runtime/development_gate.go", "cmd/core-runtime/main.go", "cmd/core-runtime/development_gate_test.go", "adapters/developmentexecutor/**", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000253-development-gate-verifier-integration.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "modules/work/**", "cmd/agent-worker/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["existing authenticated Creator session", "existing DevelopmentGate CAS store", "local developmentexecutor"], "may_change": ["internal authenticated verifier route" ]},
"semantic_owner": "Work-owned DevelopmentGate controller",
"canonical_state": ["existing work.development_gates row only"],
"state_transitions": ["ISOLATED -> VERIFIED only after bounded checks pass and verifier run differs from producer runs"],
"side_effects_and_privileges": ["read-only checks in isolated worktree; one existing Work-owner CAS update; no source mutation, secrets, production or promotion authority"],
"persistence_and_migrations": ["none"],
"failure_retry_restart": ["stale gate revision conflicts; failed checks leave gate ISOLATED; rerun uses a new verifier run/evidence reference"],
"assumptions": ["worktree has already been created by the governed isolation step"],
"acceptance_scenarios": ["unauthenticated verifier request denied", "non-ISOLATED gate denied", "same producer/verifier run denied", "failed check leaves gate unchanged", "passing checks persist VERIFIED with evidence and CAS"],
"required_tests": ["go test ./cmd/core-runtime ./adapters/developmentexecutor", "go vet ./cmd/core-runtime ./adapters/developmentexecutor", "go run ./cmd/devctl preflight -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-diff -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-architecture", "git diff --check", "independent", "CI", "production health smoke", "authenticated gate verifier live smoke"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000254",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "3bfe76278b7e44965cbb0e3b4ac2911ad4a4bbae",
"risk_tier": "E",
"intent": "Expose typed authenticated transitions for durable governed self-development canary, promotion and rollback evidence with optimistic revision checks.",
"requirement_ids": ["governed self-development", "durable canary evidence", "promotion and rollback lineage"],
"allowed_change_scope": {"modules": ["governed-development"], "paths": ["cmd/core-runtime/development_gate.go", "cmd/core-runtime/main.go", "cmd/core-runtime/development_gate_test.go", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000254-development-gate-canary-promotion-rollback.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "modules/work/**", "cmd/agent-worker/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["existing authenticated Creator session", "existing DevelopmentGate CAS store", "existing governed stage machine"], "may_change": ["internal authenticated canary/promotion/rollback routes"]},
"semantic_owner": "Work-owned DevelopmentGate controller",
"canonical_state": ["existing work.development_gates row only"],
"state_transitions": ["VERIFIED -> CANARY", "CANARY -> PROMOTED", "CANARY -> ROLLED_BACK"],
"side_effects_and_privileges": ["one existing Work-owner CAS update per transition; no source mutation, secrets, external mutation or deployment authority"],
"persistence_and_migrations": ["none"],
"failure_retry_restart": ["stale revisions conflict; missing evidence is rejected; terminal stages cannot be reopened; retry uses a new reference and current revision"],
"assumptions": ["canary execution and deployment evidence are produced by their owning executor; this task records only typed evidence and advances the durable gate"],
"acceptance_scenarios": ["unauthenticated transition denied", "missing evidence denied", "stale revision denied", "canary evidence advances VERIFIED to CANARY", "promotion evidence advances CANARY to PROMOTED", "rollback evidence advances CANARY to ROLLED_BACK", "terminal gates cannot be reopened"],
"required_tests": ["go test ./cmd/core-runtime", "go vet ./cmd/core-runtime", "go run ./cmd/devctl preflight -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-diff -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-architecture", "git diff --check", "independent verifier", "CI", "production health smoke", "authenticated transition smoke"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000255",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "12ab124411771fbed16e1f1935b97b1d0700a7b0",
"risk_tier": "E",
"intent": "Refresh the audit status projection and evidence matrix from current production and authenticated UI observations without changing runtime behavior.",
"requirement_ids": ["task lineage and status synchronization", "auditable production evidence"],
"allowed_change_scope": {"modules": ["governance-documentation"], "paths": ["docs/PROJECT_STATUS.md", "docs/evidence/audit-completion-matrix-2026-08-23-v4.json", "docs/evidence/authenticated-ui-acceptance-2026-08-23-v3.json", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000255-refresh-live-audit-status-projection.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "cmd/**", "modules/**", "adapters/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["current production health and revision evidence", "current authenticated Creator UI observation"], "may_change": ["documentation evidence projection only"]},
"semantic_owner": "Governance evidence projection",
"canonical_state": ["none; evidence files are derived audit artifacts"],
"state_transitions": ["supersede stale status projection with timestamped current evidence"],
"side_effects_and_privileges": ["documentation-only; no runtime, database, secret or external mutation"],
"persistence_and_migrations": ["none"],
"failure_retry_restart": ["retain prior evidence as historical; newer evidence supersedes it without rewriting history"],
"assumptions": ["mobile viewport cannot be emulated by the current in-app browser control surface, so mobile remains explicitly unverified"],
"acceptance_scenarios": ["status names current deployed revision", "model counts match current authenticated UI", "external bridge and mobile limitations remain explicit", "no secret values are recorded"],
"required_tests": ["go test ./cmd/core-runtime", "go vet ./cmd/core-runtime", "independent evidence review", "go run ./cmd/devctl preflight -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-diff -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-architecture", "git diff --check", "CI", "production health smoke"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000256",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "3d97b348f74741b9aca2aa8d77f2e66b9f5760c2",
"risk_tier": "E",
"intent": "Expose observed qualification latency and evidence strength in provider-neutral model ratings without inferring quality, activation or authority.",
"requirement_ids": ["model fleet/failover", "provider-neutral rating", "quality must remain unrated without task evaluation"],
"allowed_change_scope": {"modules": ["capability"], "paths": ["modules/capability/domain/cognitive_registry.go", "modules/capability/domain/model_rating_test.go", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000256-model-rating-reachability-evidence.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "cmd/**", "adapters/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["existing ModelQualificationObservation", "existing provider-neutral ModelRating"], "may_change": ["derived rating values for reachability-only evidence"]},
"semantic_owner": "Capability rating derivation",
"canonical_state": ["none; ModelRating is derived from existing evidence"],
"state_transitions": ["none"],
"side_effects_and_privileges": ["pure deterministic derivation only"],
"persistence_and_migrations": ["none"],
"failure_retry_restart": ["missing or unavailable qualification remains UNRATED with no quality claim"],
"assumptions": ["reachability and latency are operational evidence, not task quality"],
"acceptance_scenarios": ["reachable qualification exposes latency/evidence scores", "quality category remains UNRATED without supported task evaluation", "provider kind and hardware do not affect rating", "unavailable qualification does not create positive rating"],
"required_tests": ["go test ./modules/capability/domain", "go vet ./modules/capability/domain", "independent evidence review", "go run ./cmd/devctl preflight -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-diff -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-architecture", "git diff --check", "CI", "production health smoke"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000257",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "8868258afd4e58edfa9c71e3fbf79793cd32397b",
"risk_tier": "E",
"intent": "Record a bounded operations acceptance smoke for authenticated fleet and agent-worker status surfaces and unauthenticated protection.",
"requirement_ids": ["UI/operations acceptance", "truthful degraded state", "authenticated read-only status"],
"allowed_change_scope": {"modules": ["governance-documentation"], "paths": ["docs/evidence/operations-acceptance-2026-08-23-v1.json", "docs/PROJECT_STATUS.md", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000257-operations-acceptance-fast-smoke.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "cmd/**", "modules/**", "adapters/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["authenticated Creator UI", "fleet readiness read API", "agent-worker status read API"], "may_change": ["evidence projection only"]},
"semantic_owner": "Governance evidence projection",
"canonical_state": ["none"],
"state_transitions": ["none"],
"side_effects_and_privileges": ["read-only API/UI checks; no mutation"],
"persistence_and_migrations": ["none"],
"failure_retry_restart": ["failed checks remain explicit and do not alter runtime state"],
"assumptions": ["deep UI, long-running delegation and mobile viewport acceptance remain separate tests"],
"acceptance_scenarios": ["unauthenticated fleet status returns 401", "unauthenticated agent status returns 401", "authenticated fleet refresh displays selected tier and degraded reason", "authenticated agent refresh displays local fallback and bridge-unavailable reason"],
"required_tests": ["go test ./cmd/creator-web", "go vet ./cmd/creator-web", "independent evidence review", "go run ./cmd/devctl preflight -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-diff -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-architecture", "git diff --check", "CI", "production health smoke", "authenticated operations smoke"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000258",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "5e8286695f0da3f3819cdc17ced6525237512e6e",
"risk_tier": "E",
"intent": "Add a fast static responsive regression guard for the authenticated Creator console while retaining the requirement for real mobile visual acceptance.",
"requirement_ids": ["UI responsive safety", "authenticated console acceptance"],
"allowed_change_scope": {"modules": ["creator-web"], "paths": ["cmd/creator-web/responsive_test.go", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000258-responsive-console-regression-guard.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "cmd/core-runtime/**", "modules/**", "adapters/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["embedded Creator console HTML/CSS"], "may_change": ["tests only"]},
"semantic_owner": "Creator Web presentation tests",
"canonical_state": ["none"],
"state_transitions": ["none"],
"side_effects_and_privileges": ["test-only static inspection"],
"persistence_and_migrations": ["none"],
"failure_retry_restart": ["test fails when responsive guardrails disappear"],
"assumptions": ["static guard is not a substitute for browser visual acceptance; real mobile viewport evidence remains required when browser capability exists"],
"acceptance_scenarios": ["viewport metadata exists", "mobile media block exists", "key panels collapse to safe single-column layouts", "only section navigation owns horizontal scrolling"],
"required_tests": ["go test ./cmd/creator-web", "go vet ./cmd/creator-web", "independent evidence review", "go run ./cmd/devctl preflight -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-diff -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-architecture", "git diff --check", "CI", "production health smoke"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000259",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "d4b541612647acd826477c8cbea2bc9976049f03",
"risk_tier": "E",
"intent": "Refresh the audit status projection after the responsive regression guard and current production deployment.",
"requirement_ids": ["task lineage and status synchronization", "auditable UI acceptance state"],
"allowed_change_scope": {"modules": ["governance-documentation"], "paths": ["docs/PROJECT_STATUS.md", "docs/evidence/audit-completion-matrix-2026-08-23-v5.json", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000259-refresh-post-responsive-evidence.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "cmd/**", "modules/**", "adapters/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["current production health/revision", "responsive regression test evidence", "authenticated operations smoke"], "may_change": ["status projection only"]},
"semantic_owner": "Governance evidence projection",
"canonical_state": ["none"],
"state_transitions": ["supersede stale projection without rewriting historical evidence"],
"side_effects_and_privileges": ["documentation-only"],
"persistence_and_migrations": ["none"],
"failure_retry_restart": ["historical evidence remains immutable; current projection can be refreshed"],
"assumptions": ["real mobile viewport visual evidence remains unavailable"],
"acceptance_scenarios": ["status names DEV-000258 as latest completed", "matrix names d4b54161 production revision", "responsive static guard is recorded", "mobile visual limitation remains explicit"],
"required_tests": ["go test ./cmd/creator-web", "go vet ./cmd/creator-web", "independent evidence review", "go run ./cmd/devctl preflight -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-diff -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-architecture", "git diff --check", "CI", "production health smoke"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000260",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "a9dbc3b",
"risk_tier": "E",
"intent": "Record deep authenticated UI and operations acceptance without changing runtime behavior.",
"requirement_ids": ["authenticated deep acceptance evidence", "truthful operational status"],
"allowed_change_scope": {"modules": ["governance-documentation"], "paths": ["docs/evidence/deep-authenticated-acceptance-2026-08-23-v1.json", "docs/PROJECT_STATUS.md", "docs/evidence/audit-completion-matrix-2026-08-23-v5.json", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000260-deep-authenticated-acceptance.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "cmd/**", "modules/**", "adapters/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["authenticated browser UI", "current production fleet/agent/learning status"], "may_change": ["evidence projection only"]},
"semantic_owner": "Governance evidence projection",
"canonical_state": ["none"],
"state_transitions": ["none"],
"side_effects_and_privileges": ["documentation-only; browser acceptance used no mutation"],
"persistence_and_migrations": ["none"],
"failure_retry_restart": ["evidence remains immutable; status projection can be refreshed"],
"assumptions": ["mobile viewport capability remains unavailable", "no delegation ID was present in the authenticated session"],
"acceptance_scenarios": ["authenticated chat reply received", "diagnostics 7/7 after refresh", "fleet and agent refresh completed", "learning refresh completed", "action history visible", "no secrets exposed"],
"required_tests": ["go test ./cmd/creator-web ./cmd/devctl", "go vet ./cmd/creator-web", "go run ./cmd/devctl preflight -task dev/tasks/DEV-000260-deep-authenticated-acceptance.json", "go run ./cmd/devctl check-diff -task dev/tasks/DEV-000260-deep-authenticated-acceptance.json", "independent evidence review", "git diff --check", "CI", "production health smoke"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000261",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "d2dd38b",
"risk_tier": "E",
"intent": "Connect unresolved model-evaluation evidence to a bounded additional Work Graph and durable dispatch schedule.",
"requirement_ids": ["model fleet/failover", "general-first qualification", "adaptive additional tests", "durable parallel dispatch"],
"allowed_change_scope": {"modules": ["work", "capability-evaluation"], "paths": ["modules/work/application/graph_runtime.go", "modules/work/application/task_evaluation_dispatch_test.go", "cmd/work-graph-runtime/main.go", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000261-durable-additional-task-evaluation-scheduling.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "cmd/core-runtime/**", "cmd/creator-web/**", "cmd/agent-worker/**", "adapters/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["TaskEvaluationExpansionRequest", "UnresolvedTaskEvidence", "Work Graph admission and dispatch ports"], "may_change": ["application orchestration function only"]},
"semantic_owner": "Work application schedules; Capability domain decides qualification expansion",
"canonical_state": ["work graph and dispatch queue remain durable owners"],
"state_transitions": ["completed unresolved general evaluation -> bounded additional graph -> leased/queued specialist dispatch"],
"side_effects_and_privileges": ["durable graph/dispatch persistence through existing ports; no provider or external mutation"],
"persistence_and_migrations": ["none; existing graph and dispatch persistence is reused"],
"failure_retry_restart": ["existing graph admission and worker lease/recovery semantics remain authoritative; qualified candidate suppresses expansion"],
"assumptions": ["caller supplies fresh dispatch identities and bounded additional benchmark version", "independent verifier remains required before qualification promotion"],
"acceptance_scenarios": ["unresolved general result creates exactly two bounded additional cases", "additional graph preserves parent evidence lineage", "fresh dispatch intent is queued through existing scheduler", "qualified candidate creates no additional graph"],
"required_tests": ["go test ./modules/work/application ./modules/work/domain ./modules/capability/domain", "go vet ./modules/work/application ./modules/work/domain ./modules/capability/domain", "go run ./cmd/devctl preflight -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-diff -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-architecture", "independent evidence review", "git diff --check", "CI", "production health smoke"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000262",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "b789878",
"risk_tier": "E",
"intent": "Record production evidence for the deployed adaptive additional task-evaluation scheduling hand-off.",
"requirement_ids": ["auditable model qualification lifecycle", "production runtime evidence"],
"allowed_change_scope": {"modules": ["governance-documentation"], "paths": ["docs/evidence/additional-evaluation-runtime-live-2026-08-23-v1.json", "docs/PROJECT_STATUS.md", "docs/evidence/audit-completion-matrix-2026-08-23-v5.json", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000262-additional-evaluation-live-evidence.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "cmd/**", "modules/**", "adapters/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["production work-graph health/readiness and route response"], "may_change": ["status projection only"]},
"semantic_owner": "Governance evidence projection",
"canonical_state": ["none"],
"state_transitions": ["none"],
"side_effects_and_privileges": ["documentation-only; live probe used rejected empty request"],
"persistence_and_migrations": ["none"],
"failure_retry_restart": ["historical evidence remains immutable; status projection can be refreshed"],
"assumptions": ["route validation is not proof of a successful graph mutation"],
"acceptance_scenarios": ["production work-graph health is OK", "readiness reports PostgreSQL available", "additional scheduling route rejects incomplete payload with 422", "no secret value appears"],
"required_tests": ["go test ./cmd/creator-web", "go vet ./cmd/creator-web", "go run ./cmd/devctl preflight -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-diff -active dev/ACTIVE_TASK.json", "independent evidence review", "git diff --check", "CI", "production health smoke"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
@@ -0,0 +1,23 @@
{
"task_id": "DEV-000263",
"task_revision": 1,
"architecture_revision": "ADR-0018",
"base_repo_revision": "1f20685",
"risk_tier": "E",
"intent": "Record the current Domovoy-owned GPU qualification result without promoting unreachable models.",
"requirement_ids": ["model fleet/failover", "quality separated from reachability", "hardware-neutral routing"],
"allowed_change_scope": {"modules": ["governance-documentation"], "paths": ["docs/evidence/gpu-qualification-runtime-2026-08-23-v2.json", "docs/PROJECT_STATUS.md", "docs/evidence/audit-completion-matrix-2026-08-23-v5.json", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000263-gpu-qualification-runtime-evidence.json"]},
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "database/**", "deploy/**", "contracts/**", "LLM-local/**", "cmd/**", "modules/**", "adapters/**"]},
"allowed_architecture_delta": {"new_cross_module_dependencies": 0, "new_canonical_owners": 0, "new_privileges": 0, "new_third_party_dependencies": 0, "new_database_owner_roles": 0},
"contracts": {"consume": ["Domovoy cognitive-worker qualification response", "provider-neutral model rating"], "may_change": ["status projection only"]},
"semantic_owner": "Governance evidence projection",
"canonical_state": ["none"],
"state_transitions": ["none"],
"side_effects_and_privileges": ["read-only bounded model qualification; no activation or promotion"],
"persistence_and_migrations": ["qualification observations are persisted by existing Capability owner route; this task adds only evidence projection"],
"failure_retry_restart": ["timeout remains UNRATED and fallback remains active"],
"assumptions": ["GPU endpoint and protected credential were resolved inside cognitive-worker"],
"acceptance_scenarios": ["four exact discovered model IDs recorded", "all timeouts remain UNRATED", "GPU does not become preferred", "no secret value appears"],
"required_tests": ["go test ./cmd/creator-web", "go vet ./cmd/creator-web", "go run ./cmd/devctl preflight -active dev/ACTIVE_TASK.json", "go run ./cmd/devctl check-diff -active dev/ACTIVE_TASK.json", "independent evidence review", "git diff --check", "CI", "production health smoke"],
"terminal_gap_states": ["BLOCKED_BY_MISSING_CAPABILITY", "BLOCKED_BY_SPEC_GAP"]
}
+7 -5
View File
@@ -2,30 +2,32 @@
## Current audit delta — 2026-08-23 ## Current audit delta — 2026-08-23
- `LAST_COMPLETED = DEV-000222`; independent task verification now supports exact text and structured top-level JSON-field checks, and unresolved outcomes can produce two bounded additional case candidates after the general evaluation stage. The task packet is merged to `main` and deployed; quality remains unclaimed unless verifier evidence is present. - `LAST_COMPLETED = DEV-000260`; the governed self-development path, provider-neutral reachability rating, bounded authenticated operations smoke, responsive static regression guard and deep authenticated acceptance evidence are live. Mobile visual UI remains explicitly unverified because the current browser control surface cannot emulate a 390x844 viewport.
- `CURRENT_PRODUCTION_STATUS = LIVE_HEALTHY`; public `/healthz` is healthy. The exact deployed revision is authoritative in the deployment log and merge record, not duplicated in this mutable status projection. Evidence: `docs/evidence/audit-runtime-status-2026-08-23-v1.json`. - `CURRENT_PRODUCTION_STATUS = LIVE_HEALTHY`; public `/healthz` is healthy. The exact deployed revision is authoritative in the deployment log and merge record, not duplicated in this mutable status projection. Evidence: `docs/evidence/audit-runtime-status-2026-08-23-v1.json`.
- `FAST_PROVIDER_STATUS = LIVE_SMOKE_SUPPORTED`: local CPU gateway authentication is configured through a protected file reference; four bounded local-only advisory cases completed through cognitive-worker. Evidence: `docs/evidence/wp-601-fast-gateway-live-smoke-2026-08-22-v1.json`. - `FAST_PROVIDER_STATUS = LIVE_SMOKE_SUPPORTED`: local CPU gateway authentication is configured through a protected file reference; four bounded local-only advisory cases completed through cognitive-worker. Evidence: `docs/evidence/wp-601-fast-gateway-live-smoke-2026-08-22-v1.json`.
- `MEDIUM_PROVIDER_STATUS = LIVE_BOUNDED_SMOKE_SUPPORTED_UNPROMOTED`; four bounded local-provider cases passed with template thinking disabled. This is availability/response-shape evidence only; lifecycle qualification, activation and promotion remain unclaimed. Evidence: `docs/evidence/medium-live-bounded-smoke-2026-08-23-v1.json`. - `MEDIUM_PROVIDER_STATUS = LIVE_BOUNDED_SMOKE_SUPPORTED_UNPROMOTED`; four bounded local-provider cases passed with template thinking disabled. This is availability/response-shape evidence only; lifecycle qualification, activation and promotion remain unclaimed. Evidence: `docs/evidence/medium-live-bounded-smoke-2026-08-23-v1.json`.
- `HEAVY_PROVIDER_STATUS = LIVE_BOUNDED_INVOCATION_SUPPORTED_UNPROMOTED`; the exact Domovoy adapter payload produced one bounded Qwen completion in 0.583s. Quality is not assessed, lifecycle promotion is not performed, and GPU availability is not treated as intelligence or routing priority. Evidence: `docs/evidence/gpu-discovery-2026-08-23-v1.json`, `docs/evidence/gpu-invocation-qualification-2026-08-23-v1.json`. - `HEAVY_PROVIDER_STATUS = LIVE_BOUNDED_INVOCATION_SUPPORTED_UNPROMOTED`; the exact Domovoy adapter payload produced one bounded Qwen completion in 0.583s. Quality is not assessed, lifecycle promotion is not performed, and GPU availability is not treated as intelligence or routing priority. Evidence: `docs/evidence/gpu-discovery-2026-08-23-v1.json`, `docs/evidence/gpu-invocation-qualification-2026-08-23-v1.json`.
- `GPU_QUALIFICATION_STATUS = LIVE_UNRATED_TIMEOUT`; Domovoy qualification discovered four exact GPU model IDs and probed them in parallel; all four timed out at the bounded 10-second limit, so quality remains `UNRATED`, no promotion occurred, and CPU/LIFEBOAT fallback remains authoritative. Evidence: `docs/evidence/gpu-qualification-runtime-2026-08-23-v2.json`.
- `AGENT_EXECUTION_STATUS = DURABLE_DRY_RUN_CANARY_VERIFIED`; the explicit production canary persisted a dispatch intent, an ACTIVE lease and callback head sequence 2. No independently operated bridge endpoint is configured, so bridge-backed execution remains unavailable. Evidence: `docs/evidence/agent-execution-dry-run-canary-2026-08-23-v1.json`. - `AGENT_EXECUTION_STATUS = DURABLE_DRY_RUN_CANARY_VERIFIED`; the explicit production canary persisted a dispatch intent, an ACTIVE lease and callback head sequence 2. No independently operated bridge endpoint is configured, so bridge-backed execution remains unavailable. Evidence: `docs/evidence/agent-execution-dry-run-canary-2026-08-23-v1.json`.
- `ADDITIONAL_EVALUATION_STATUS = LIVE_TYPED_HANDOFF`; Capability-owned unresolved evaluation decisions can now be handed to Work through a typed production endpoint. Work preserves parent evidence lineage and schedules the bounded additional profile through the existing durable graph/dispatch path; model/provider selection remains outside Work. Evidence: `docs/evidence/additional-evaluation-runtime-live-2026-08-23-v1.json` and DEV-000261.
- `FLEET_EXECUTION_EVIDENCE = docs/evidence/audit-runtime-status-2026-08-23-v1.json`; FAST, MEDIUM and LIFEBOAT are ready, HEAVY is explicitly degraded by provider timeout, FAST remains preferred/selected, and LIFEBOAT is the fallback tier. - `FLEET_EXECUTION_EVIDENCE = docs/evidence/audit-runtime-status-2026-08-23-v1.json`; FAST, MEDIUM and LIFEBOAT are ready, HEAVY is explicitly degraded by provider timeout, FAST remains preferred/selected, and LIFEBOAT is the fallback tier.
- `TRUTH_RESEARCH_STATUS = LIVE_CANARY_PERSISTED`; the web research canary preserved an OBSERVED/COMPLETE/NO-CONFLICT source chain while leaving the claim UNVERIFIED and belief PROVISIONAL. Evidence: `docs/evidence/truth-runtime-canary-2026-08-23-v1.json`. - `TRUTH_RESEARCH_STATUS = LIVE_CANARY_PERSISTED`; the web research canary preserved an OBSERVED/COMPLETE/NO-CONFLICT source chain while leaving the claim UNVERIFIED and belief PROVISIONAL. Evidence: `docs/evidence/truth-runtime-canary-2026-08-23-v1.json`.
- `LEARNING_REFLECTION_STATUS = LIVE_RECONCILED`; reflection worker returned no pending candidate and the durable state contains 31 RESOLVED candidates with no OPEN backlog. Evidence: `docs/evidence/reflection-runtime-reconciliation-2026-08-23-v1.json`. - `LEARNING_REFLECTION_STATUS = LIVE_RECONCILED`; reflection worker returned no pending candidate and the durable state contains 31 RESOLVED candidates with no OPEN backlog. Evidence: `docs/evidence/reflection-runtime-reconciliation-2026-08-23-v1.json`.
- `BACKUP_RESTORE_STATUS = VERIFIED`; latest checksum and isolated restore evidence is retained in `docs/evidence/wp-002-postgres-restore-2026-08-22-v1.json`. - `BACKUP_RESTORE_STATUS = VERIFIED`; latest checksum and isolated restore evidence is retained in `docs/evidence/wp-002-postgres-restore-2026-08-22-v1.json`.
- `GOVERNED_SELF_DEVELOPMENT_STATUS = DURABLE_GATE_PERSISTED`; Work-owned revisioned gate storage and optimistic-concurrency persistence are live. No bridge-backed source mutation, promotion or rollback is claimed. Evidence: `docs/evidence/governed-development-gate-persistence-2026-08-23-v1.json`. - `GOVERNED_SELF_DEVELOPMENT_STATUS = DURABLE_GATE_VERIFIER_AND_TRANSITIONS_LIVE`; Work-owned revisioned gate storage, independent local verification, and authenticated optimistic-concurrency transitions for canary/promotion/rollback are live. Source mutation and external bridge execution remain unclaimed. Evidence: `docs/evidence/governed-development-gate-persistence-2026-08-23-v1.json` and DEV-000254 CI/live-smoke records.
- `UI_AUTHENTICATED_ACCEPTANCE = AUTHENTICATED_QUICK_SMOKE_PASS`; browser-driven smoke completed in the active production session: chat response received, admin login accepted, diagnostics 7/7 passed, operations fleet 4/4 READY, and action history loaded. Deep mutation, delegation-specific and long-running acceptance remain intentionally deferred. - `UI_AUTHENTICATED_ACCEPTANCE = AUTHENTICATED_QUICK_SMOKE_PASS`; browser-driven smoke completed in the active production session: chat response received, admin login accepted, diagnostics 7/7 passed, operations fleet 4/4 READY, and action history loaded. Deep mutation, delegation-specific and long-running acceptance remain intentionally deferred.
- `CURRENT_UI_SESSION_STATUS = NO_CURRENT_AUTHENTICATED_SESSION`; the historical quick-smoke evidence above is retained, but the current acceptance run has no signed-in browser session, so no new authenticated visual result is claimed. Public cabinet shell and unauthenticated protection were checked separately. - `CURRENT_UI_SESSION_STATUS = NO_CURRENT_AUTHENTICATED_SESSION`; the historical quick-smoke evidence above is retained, but the current acceptance run has no signed-in browser session, so no new authenticated visual result is claimed. Public cabinet shell and unauthenticated protection were checked separately.
- `AGENT_WORKER_STATUS_CORRECTION = LIVE_TRUTHFUL_LOCAL_EXECUTOR`; absence of the protected bridge is reported as `executor_configured=false`, `mode=local-executor`, `ready=false`, with `task-evaluation` as the only advertised local capability; unsupported work remains durably waiting and is not represented as external agent execution. Evidence: `docs/evidence/audit-runtime-status-2026-08-23-v2.json` (pre-DEV-000227 field shape remains historical). - `AGENT_WORKER_STATUS_CORRECTION = LIVE_TRUTHFUL_LOCAL_EXECUTOR`; absence of the protected bridge is reported as `executor_configured=false`, `mode=local-executor`, `ready=false`, with `task-evaluation` as the only advertised local capability; unsupported work remains durably waiting and is not represented as external agent execution. Evidence: `docs/evidence/audit-runtime-status-2026-08-23-v2.json` (pre-DEV-000227 field shape remains historical).
- `FLEET_READINESS_LIVE = MEDIUM_SELECTED_BY_AVAILABILITY`; the live cognitive worker observed FAST unavailable, MEDIUM available, HEAVY available and LIFEBOAT available; it selected MEDIUM while the configured preference remained FAST. This is routing evidence only, not a quality or promotion claim. Evidence: `docs/evidence/fleet-readiness-live-2026-08-23-v2.json`. - `FLEET_READINESS_LIVE = MEDIUM_SELECTED_BY_AVAILABILITY`; the live cognitive worker observed FAST unavailable, MEDIUM available, HEAVY available and LIFEBOAT available; it selected MEDIUM while the configured preference remained FAST. This is routing evidence only, not a quality or promotion claim. Evidence: `docs/evidence/fleet-readiness-live-2026-08-23-v2.json`.
- `UI_AUTHENTICATED_ACCEPTANCE = CURRENT_LIVE_PASS`; current signed-in browser evidence covers root chat session, admin diagnostics 7/7, operations fleet 4/4 READY with FAST selected, truthful local-executor agent status, action history and learning/reflection sections; the 390x844 console layout remained readable without horizontal overflow. Evidence: `docs/evidence/authenticated-ui-acceptance-2026-08-23-v2.json`. - `UI_AUTHENTICATED_ACCEPTANCE = DEEP_DESKTOP_PASS_WITH_MOBILE_GAP`; deep signed-in browser evidence covers chat reply, diagnostics 7/7 after refresh, fleet/agent/action-history refresh, 3/4 fleet readiness with FAST selected, truthful local executor state and learning/reflection refresh. Static responsive regression guard passed in CI; mobile viewport acceptance is not claimed. Evidence: `docs/evidence/deep-authenticated-acceptance-2026-08-23-v1.json`.
## Current governance checkpoint ## Current governance checkpoint
- `COMPLETION_MATRIX = docs/evidence/audit-completion-matrix-2026-08-23-v3.json`; all seven objective areas are mapped to current repository/production proof, with external bridge, GPU promotion/quality and deep-acceptance gaps explicit. - `COMPLETION_MATRIX = docs/evidence/audit-completion-matrix-2026-08-23-v5.json`; all seven objective areas are mapped to current repository/production proof, with external bridge, GPU quality/promotion, mobile visual acceptance and deep-acceptance gaps explicit.
- `ACTIVE_TASK = dev/tasks/DEV-000235-model-qualification-probe.json revision 1`; cognitive-worker now exposes a bounded provider-neutral qualification probe that discovers actual model IDs, invokes them in parallel, reports reachability/latency and keeps quality `UNRATED` until independent task tests. Hardware presence does not grant promotion or priority. - `ACTIVE_TASK = dev/tasks/DEV-000235-model-qualification-probe.json revision 1`; cognitive-worker now exposes a bounded provider-neutral qualification probe that discovers actual model IDs, invokes them in parallel, reports reachability/latency and keeps quality `UNRATED` until independent task tests. Hardware presence does not grant promotion or priority.
- `LINEAGE_DECISION = docs/GOVERNANCE_LINEAGE_DECISION_2026-08-22.md`; historical packets remain provenance and are not current authority. - `LINEAGE_DECISION = docs/GOVERNANCE_LINEAGE_DECISION_2026-08-22.md`; historical packets remain provenance and are not current authority.
- `REGISTRY_STATUS = YAML and JSON semantic mirrors agree` - `REGISTRY_STATUS = YAML and JSON semantic mirrors agree`
- `PRODUCTION_DOMAIN = docker.cin.su`; shared docker-test is not used for this project. - `PRODUCTION_DOMAIN = docker.cin.su`; shared docker-test is not used for this project.
- `NEXT_WORK = use qualification evidence in the provider-neutral Capability rating/selection loop, then continue authenticated UI acceptance, reflection recovery and governed self-development gaps.` - `NEXT_WORK = obtain a viewport-capable browser for real mobile visual acceptance; separately qualify/promote GPU quality and provide an independently operated Agent Execution bridge when required.`
@@ -0,0 +1,13 @@
{
"evidence_id": "additional-evaluation-runtime-live-2026-08-23-v1",
"captured_at": "2026-08-23T20:00:00Z",
"production_main_revision": "b789878",
"runtime": "work-graph-runtime",
"health": {"healthz": "OK", "readyz": "READY", "work_postgres": "AVAILABLE"},
"route": {"path": "/v1/work-graphs/task-evaluations/additional/schedule", "empty_payload_status": 422, "typed_validation": "PASS"},
"behavior": "Capability-owned additional profile/cases are handed to Work, which preserves parent evidence lineage and uses existing durable graph admission and dispatch queue paths.",
"provider_selection": "not performed by Work; Capability remains the decision owner",
"mutations_performed": false,
"secrets_exposed": false,
"limitations": ["No live additional graph mutation was created; production route was validated with a rejected empty payload", "independent external Agent Execution bridge, GPU quality promotion and mobile visual acceptance remain open gaps"]
}
@@ -0,0 +1,11 @@
{
"evidence_id": "audit-completion-matrix-2026-08-23-v4",
"captured_at": "2026-08-23T18:46:05Z",
"production_revision": "12ab124411771fbed16e1f1935b97b1d0700a7b0",
"supersedes": "docs/evidence/audit-completion-matrix-2026-08-23-v3.json",
"overall_status": "NOT_COMPLETE",
"completed_areas": ["agent execution local recovery", "multi-agent work graph", "truth/research runtime", "learning reflection loop", "model availability/failover", "governed gate verification and durable transitions"],
"remaining_gaps": ["independently operated Agent Execution bridge is unavailable", "GPU quality qualification and promotion remain incomplete", "mobile authenticated acceptance is not verified in the current browser control surface", "deep UI/operations acceptance remains deferred under quick-test policy"],
"live_facts": {"healthz": "OK", "diagnostics": "7/7 OK", "fleet_ready": "3/4", "selected_tier": "FAST", "fallback_tier": "LIFEBOAT", "agent_mode": "local-fallback"},
"secrets": "No secret values included."
}
@@ -0,0 +1,12 @@
{
"evidence_id": "audit-completion-matrix-2026-08-23-v5",
"captured_at": "2026-08-23T19:05:00Z",
"production_revision": "d4b541612647acd826477c8cbea2bc9976049f03",
"supersedes": "docs/evidence/audit-completion-matrix-2026-08-23-v4.json",
"overall_status": "NOT_COMPLETE",
"completed_areas": ["agent execution local recovery", "multi-agent work graph", "truth/research runtime", "learning reflection loop", "model availability/failover and reachability rating", "adaptive additional task evaluation scheduling", "governed gate verification/transitions", "authenticated desktop operations fast smoke", "responsive static regression guard"],
"remaining_gaps": ["independently operated Agent Execution bridge is unavailable", "GPU quality qualification and promotion remain incomplete", "real mobile authenticated visual acceptance is unavailable in the current browser surface"],
"live_facts": {"healthz": "OK", "diagnostics": "7/7 OK", "fleet_ready": "3/4", "selected_tier": "FAST", "fallback_tier": "LIFEBOAT", "agent_mode": "local-fallback"},
"responsive_guard": "CI PASS: cmd/creator-web responsive regression test",
"secrets": "No secret values included."
}
@@ -0,0 +1,13 @@
{
"evidence_id": "authenticated-ui-acceptance-2026-08-23-v3",
"observed_on": "2026-08-23",
"captured_at": "2026-08-23T18:46:05Z",
"source": "current authenticated in-app browser session against assistant.cin.su",
"production_revision_visible": "12ab124411771fbed16e1f1935b97b1d0700a7b0",
"chat": {"authenticated": true, "session_state": "active"},
"admin": {"authenticated": true, "diagnostics": {"passed": 7, "total": 7}, "operations": {"fleet_ready": 3, "fleet_total": 4, "selected_tier": "FAST", "fallback_tier": "LIFEBOAT"}, "agent_worker": {"mode": "local-fallback", "executor_configured": false, "external_mutation": false}, "action_history_records_visible": 25, "learning_signals_visible": 17, "reflection_state_visible": "RESOLVED", "skill_state_visible": "SUSPENDED"},
"responsive": {"viewport": "not changed; current browser control surface has no viewport emulation", "horizontal_overflow_observed": "not assessed", "sections_readable": true},
"mutations_performed": false,
"secrets_exposed": false,
"limitations": ["mobile viewport acceptance not verified", "no delegation-specific mutation performed", "no external bridge configured"]
}
@@ -0,0 +1,13 @@
{
"evidence_id": "deep-authenticated-acceptance-2026-08-23-v1",
"captured_at": "2026-08-23T19:35:00Z",
"source": "authenticated in-app browser session against assistant.cin.su",
"production_revision_visible": "9f40c6a7933c2e459cd363a8929427c59ae9682c",
"chat": {"message_sent": true, "assistant_reply_received": true, "durable_session_state_visible": true},
"diagnostics": {"passed": 7, "total": 7, "refresh": "PASS"},
"operations": {"fleet_refresh": "PASS", "agent_refresh": "PASS", "action_history_refresh": "PASS", "fleet_ready": 3, "fleet_total": 4, "selected_tier": "FAST", "heavy_state": "DEGRADED", "agent_mode": "local-executor", "delegation_selected": false, "action_history_records_visible": 25},
"learning": {"refresh": "PASS", "signals_visible": 17, "reflection_state_visible": "RESOLVED", "skill_state_visible": "SUSPENDED"},
"mutations_performed": false,
"secrets_exposed": false,
"limitations": ["GPU heavy tier remains degraded by provider timeout", "no delegation-specific state was selected because no delegation ID was available in the session", "mobile viewport visual acceptance remains unavailable in the current browser control surface"]
}
@@ -0,0 +1,12 @@
{
"evidence_id": "gpu-qualification-runtime-2026-08-23-v2",
"captured_at": "2026-08-23T21:01:53Z",
"production_revision": "1f20685",
"source": "Domovoy cognitive-worker bounded qualification route",
"provider": "local-gpu-opportunistic",
"models_discovered": ["Qwen3.6-27B-UD-Q4_K_XL", "Qwen3.8-27B-UD-Q3_K_XL", "Qwen3.8-27B-UD-Q4_K_XL", "gemma-4-26B-A4B-it-UD-Q2_K_XL"],
"results": {"model_count": 4, "statuses": ["RESPONDED_WITHOUT_QUALIFICATION", "RESPONDED_WITHOUT_QUALIFICATION", "RESPONDED_WITHOUT_QUALIFICATION", "RESPONDED_WITHOUT_QUALIFICATION"], "finish_reasons": ["TIMEOUT", "TIMEOUT", "TIMEOUT", "TIMEOUT"], "latency_millis": [10010, 10010, 10010, 10010], "quality_assessed": false, "categories": ["UNRATED", "UNRATED", "UNRATED", "UNRATED"]},
"routing_effect": "GPU receives no promotion or priority; FAST remains selected and CPU/LIFEBOAT fallback remains authoritative.",
"secrets_exposed": false,
"limitations": ["GPU provider did not complete bounded inference, so quality and promotion remain unproven"]
}
@@ -0,0 +1,10 @@
{
"evidence_id": "operations-acceptance-2026-08-23-v1",
"captured_at": "2026-08-23T18:55:00Z",
"production_revision": "8868258afd4e58edfa9c71e3fbf79793cd32397b",
"unauthenticated": {"/api/fleet/readiness": 401, "/api/agent-worker/status": 401},
"authenticated_ui": {"fleet_refresh": "PASS", "fleet_summary": "3/4 ГОТОВЫ", "selected_tier": "FAST", "heavy_state": "DEGRADED", "agent_refresh": "PASS", "agent_mode": "local-fallback", "bridge_reason_visible": true},
"mutations_performed": false,
"secrets_exposed": false,
"limitations": ["mobile viewport not verified", "no delegation-specific mutation", "no deep/long-running acceptance"]
}
@@ -191,6 +191,9 @@ func RateCognitiveBinding(candidate capability.ResolvedCognitiveBinding) capabil
return capability.ModelRating{TaskProfileID: evaluation.ProfileID, TaskScoreMillis: evaluation.OverallScoreMillis, Category: category, OverallScoreMillis: evaluation.OverallScoreMillis, QualityScoreMillis: evaluation.QualityScoreMillis, ReliabilityScoreMillis: evaluation.ReliabilityScoreMillis, LatencyScoreMillis: evaluation.LatencyScoreMillis, EvidenceScoreMillis: 1000} return capability.ModelRating{TaskProfileID: evaluation.ProfileID, TaskScoreMillis: evaluation.OverallScoreMillis, Category: category, OverallScoreMillis: evaluation.OverallScoreMillis, QualityScoreMillis: evaluation.QualityScoreMillis, ReliabilityScoreMillis: evaluation.ReliabilityScoreMillis, LatencyScoreMillis: evaluation.LatencyScoreMillis, EvidenceScoreMillis: 1000}
} }
if candidate.Evaluation == nil || candidate.Evaluation.Result != capability.EvaluationSupported || candidate.Evaluation.QualityScoreMillis == nil || candidate.Evaluation.CriticalFailureMillis == nil { if candidate.Evaluation == nil || candidate.Evaluation.Result != capability.EvaluationSupported || candidate.Evaluation.QualityScoreMillis == nil || candidate.Evaluation.CriticalFailureMillis == nil {
if candidate.Qualification != nil && candidate.Qualification.Status == capability.ModelQualificationReachable {
return capability.ModelRating{Category: capability.ModelRatingUnrated, LatencyScoreMillis: latencyScore(candidate.Qualification.LatencyMillis * 1000), EvidenceScoreMillis: 750}
}
return capability.ModelRating{Category: capability.ModelRatingUnrated} return capability.ModelRating{Category: capability.ModelRatingUnrated}
} }
quality := clampMillis(*candidate.Evaluation.QualityScoreMillis) quality := clampMillis(*candidate.Evaluation.QualityScoreMillis)
@@ -13,6 +13,15 @@ func TestRateCognitiveBindingRequiresSupportedEvidence(t *testing.T) {
} }
} }
func TestRateCognitiveBindingExposesReachabilityWithoutQualityClaim(t *testing.T) {
rating := RateCognitiveBinding(capability.ResolvedCognitiveBinding{Qualification: &capability.ModelQualificationObservation{
Status: capability.ModelQualificationReachable, LatencyMillis: 600,
}})
if rating.Category != capability.ModelRatingUnrated || rating.OverallScoreMillis != 0 || rating.LatencyScoreMillis != 800 || rating.EvidenceScoreMillis != 750 {
t.Fatalf("reachability rating made an invalid quality claim: %+v", rating)
}
}
func TestRateCognitiveBindingUsesEvidenceNotProviderName(t *testing.T) { func TestRateCognitiveBindingUsesEvidenceNotProviderName(t *testing.T) {
quality, critical, latency := int64(900), int64(0), int64(400_000) quality, critical, latency := int64(900), int64(0), int64(400_000)
base := capability.ResolvedCognitiveBinding{ base := capability.ResolvedCognitiveBinding{
+38 -1
View File
@@ -29,6 +29,19 @@ type TaskEvaluationScheduleRequest struct {
Now int64 `json:"now_unix_millis"` Now int64 `json:"now_unix_millis"`
} }
// TaskEvaluationExpansionScheduleRequest carries a typed expansion decision
// from Capability to Work. Capability owns the decision and test-case
// construction; Work owns durable graph lineage, persistence and dispatch.
type TaskEvaluationExpansionScheduleRequest struct {
Profile capability.TaskEvaluationProfile
Cases []capability.TaskEvaluationCase
ParentGraphState work.GraphState
TriggerEvidenceRef string
Plan work.TaskEvaluationGraphRequest
Intents []work.AgentDispatchIntent
Now int64
}
type GraphCompleteRequest struct { type GraphCompleteRequest struct {
GraphID string `json:"graph_id"` GraphID string `json:"graph_id"`
Revision int64 `json:"revision"` Revision int64 `json:"revision"`
@@ -218,13 +231,37 @@ func AdmitAndScheduleTaskEvaluation(ctx context.Context, store ports.GraphStore,
intents[i].TaskEvaluationProfile = &profile intents[i].TaskEvaluationProfile = &profile
} }
intents[i].TaskEvaluationCases = append([]capability.TaskEvaluationCase(nil), node.TaskCases...) intents[i].TaskEvaluationCases = append([]capability.TaskEvaluationCase(nil), node.TaskCases...)
intents[i].TaskEvaluationExecution = &work.TaskEvaluationDispatchContext{GraphID: graph.ID, GraphRevision: graph.Revision, NodeID: node.ID, BindingRevision: request.Plan.BindingRevision, ActorID: identity.ActorID(request.Plan.ActorID), PrincipalID: identity.PrincipalID(request.Plan.PrincipalID), ScopeID: authority.ScopeID(request.Plan.ScopeID)} // AdmitAndSchedule increments the draft revision before persisting
// the leased node. The callback must target that scheduled revision;
// using the draft revision would save a completed copy that loses to
// the already-persisted immutable scheduled revision.
intents[i].TaskEvaluationExecution = &work.TaskEvaluationDispatchContext{GraphID: graph.ID, GraphRevision: graph.Revision + 1, NodeID: node.ID, BindingRevision: request.Plan.BindingRevision, ActorID: identity.ActorID(request.Plan.ActorID), PrincipalID: identity.PrincipalID(request.Plan.PrincipalID), ScopeID: authority.ScopeID(request.Plan.ScopeID)}
break break
} }
} }
return AdmitAndSchedule(ctx, store, GraphScheduleRequest{Graph: graph, Intents: intents, Now: request.Now}) return AdmitAndSchedule(ctx, store, GraphScheduleRequest{Graph: graph, Intents: intents, Now: request.Now})
} }
// ScheduleAdditionalTaskEvaluation is the runtime hand-off for the
// "general-first, additional-when-unresolved" policy. Capability decides
// whether to expand and supplies the bounded cases; this function never
// invents cases or chooses a model, and only persists/enqueues the new graph.
func ScheduleAdditionalTaskEvaluation(ctx context.Context, store ports.GraphStore, request TaskEvaluationExpansionScheduleRequest) (work.WorkGraph, []work.GraphNodeID, error) {
if request.Profile.Stage != capability.TaskEvaluationAdditional || request.Profile.ParentProfileID == "" || request.TriggerEvidenceRef == "" || len(request.Cases) == 0 {
return work.WorkGraph{}, nil, errors.New("additional task evaluation lineage is incomplete")
}
plan := request.Plan
plan.Profile = request.Profile
plan.Cases = append([]capability.TaskEvaluationCase(nil), request.Cases...)
plan.ParentGraphState = request.ParentGraphState
plan.TriggerEvidenceRef = request.TriggerEvidenceRef
graph, ready, err := AdmitAndScheduleTaskEvaluation(ctx, store, TaskEvaluationScheduleRequest{Plan: plan, Intents: request.Intents, Now: request.Now})
if err != nil {
return work.WorkGraph{}, nil, err
}
return graph, ready, nil
}
func CompleteGraphNode(ctx context.Context, store ports.GraphStore, graphID string, revision int64, nodeID work.GraphNodeID, success bool) (work.WorkGraph, error) { func CompleteGraphNode(ctx context.Context, store ports.GraphStore, graphID string, revision int64, nodeID work.GraphNodeID, success bool) (work.WorkGraph, error) {
graph, err := store.LoadWorkGraph(ctx, graphID, revision) graph, err := store.LoadWorkGraph(ctx, graphID, revision)
if err != nil { if err != nil {
@@ -41,7 +41,39 @@ func TestAdmitAndScheduleTaskEvaluationCarriesSpecialistContext(t *testing.T) {
if _, _, err := AdmitAndScheduleTaskEvaluation(context.Background(), store, request); err != nil { if _, _, err := AdmitAndScheduleTaskEvaluation(context.Background(), store, request); err != nil {
t.Fatal(err) t.Fatal(err)
} }
if len(store.intents) != 1 || store.intents[0].TaskEvaluationProfileID != "profile-general" || store.intents[0].TaskEvaluationBindingID != "binding-a" || len(store.intents[0].TaskEvaluationCaseIDs) != 2 || store.intents[0].SpecialistPurpose != string(work.GraphNodePurposeTaskEvaluation) { if len(store.intents) != 1 || store.intents[0].TaskEvaluationProfileID != "profile-general" || store.intents[0].TaskEvaluationBindingID != "binding-a" || len(store.intents[0].TaskEvaluationCaseIDs) != 2 || store.intents[0].SpecialistPurpose != string(work.GraphNodePurposeTaskEvaluation) || store.intents[0].TaskEvaluationExecution == nil || store.intents[0].TaskEvaluationExecution.GraphRevision != 2 {
t.Fatalf("specialist context was not carried into dispatch: %+v", store.intents) t.Fatalf("specialist context was not carried into dispatch: %+v", store.intents)
} }
} }
func TestExpandAndScheduleTaskEvaluationCreatesAdditionalDurableGraph(t *testing.T) {
store := &taskGraphStore{}
additional := capability.TaskEvaluationProfile{ID: "profile-additional", Revision: 1, CapabilityID: "capability-chat", Stage: capability.TaskEvaluationAdditional, ParentProfileID: "profile-general", TriggerEvidenceRef: "artifact-unresolved", BenchmarkVersion: "additional-v1", RequiredCaseIDs: []string{"case-a:reproduce", "case-a:address-failure"}, QualityWeightMillis: 600, ReliabilityWeightMillis: 300, LatencyWeightMillis: 100}
request := TaskEvaluationExpansionScheduleRequest{
Profile: additional, Cases: []capability.TaskEvaluationCase{{CaseID: "case-a:reproduce", Prompt: "проверь доступность", EvidenceArtifactRef: "artifact-unresolved"}, {CaseID: "case-a:address-failure", Prompt: "проверь доступность; обработай неизвестный результат", EvidenceArtifactRef: "artifact-unresolved"}},
ParentGraphState: work.GraphCompleted, TriggerEvidenceRef: "artifact-unresolved",
Plan: work.TaskEvaluationGraphRequest{
GraphID: "graph-additional", BindingIDs: []capability.CapabilityBindingID{"binding-a"}, DispatchIDs: []string{"dispatch-additional"}, IdempotencyPrefix: "additional", Budget: work.GraphBudget{MaxParallel: 1, MaxAttempts: 2}, ParentGraphID: "graph-general", ParentGraphRevision: 2,
},
Intents: []work.AgentDispatchIntent{{DispatchID: "dispatch-additional", IdempotencyKey: "idem-additional", DelegationID: "delegation-a", RunID: "run-a", ImplementationID: "impl", ImplementationRevision: 1, SourceRevision: "source", WorktreeID: "tree", VerificationPlanRef: "verify", CreatedAtUnixMillis: 1}},
Now: 20,
}
graph, ready, err := ScheduleAdditionalTaskEvaluation(context.Background(), store, request)
if err != nil || len(ready) != 1 || graph.State != work.GraphRunning {
t.Fatalf("graph=%+v ready=%v err=%v", graph, ready, err)
}
if len(graph.Nodes) != 1 || graph.Nodes[0].TaskProfileID != "profile-additional" || len(graph.Nodes[0].CaseIDs) != 2 || graph.TriggerEvidenceRef != "artifact-unresolved" {
t.Fatalf("additional graph did not preserve bounded expansion lineage: %+v", graph)
}
if len(store.intents) != 1 || store.intents[0].TaskEvaluationProfileID != "profile-additional" {
t.Fatalf("additional dispatch context missing: %+v", store.intents)
}
}
func TestScheduleAdditionalTaskEvaluationRejectsIncompleteLineage(t *testing.T) {
store := &taskGraphStore{}
_, _, err := ScheduleAdditionalTaskEvaluation(context.Background(), store, TaskEvaluationExpansionScheduleRequest{Profile: capability.TaskEvaluationProfile{Stage: capability.TaskEvaluationGeneral}})
if err == nil || len(store.intents) != 0 {
t.Fatalf("incomplete expansion lineage was accepted: intents=%v err=%v", store.intents, err)
}
}
@@ -0,0 +1,25 @@
package domain
import (
"encoding/json"
"testing"
"git.cin.su/m/Assistant/contracts/work"
)
func TestTaskEvaluationGraphAcceptsWirePayloadShape(t *testing.T) {
payload := []byte(`{"plan":{"graph_id":"graph-wire","profile":{"ID":"profile-wire","Revision":1,"CapabilityID":"creator-advisory","Stage":"GENERAL","BenchmarkVersion":"live-general-v1","RequiredCaseIDs":["case-ok"],"QualityWeightMillis":600,"ReliabilityWeightMillis":300,"LatencyWeightMillis":100},"binding_ids":["binding-wire"],"dispatch_ids":["dispatch-wire"],"idempotency_prefix":"idem-wire","budget":{"max_parallel":1,"max_attempts":1},"cases":[{"CaseID":"case-ok","Prompt":"Reply with exactly OK","EvidenceArtifactRef":"artifact-wire","Verification":{"Mode":"EXACT_TEXT","ExpectedText":"OK","MinimumQualityMillis":1000}}],"binding_revision":2126816167056902612,"actor_id":"domovoy-creator-actor","principal_id":"domovoy-creator-principal","scope_id":"domovoy-creator-scope"},"intents":[{"dispatch_id":"dispatch-wire","idempotency_key":"idem-wire-1234567890","delegation_id":"delegation-wire","run_id":"run-wire","implementation_id":"task-evaluator","implementation_revision":1,"source_revision":"live-quality-smoke","worktree_id":"qualification-live","verification_plan_ref":"verify-wire","created_at_unix_millis":1787500000000}]}`)
var request struct {
Plan work.TaskEvaluationGraphRequest `json:"Plan"`
Intents []work.AgentDispatchIntent `json:"Intents"`
}
if err := json.Unmarshal(payload, &request); err != nil {
t.Fatal(err)
}
if request.Plan.GraphID == "" || request.Plan.Profile.ID == "" || len(request.Plan.BindingIDs) != 1 || len(request.Intents) != 1 {
t.Fatalf("wire payload lost fields: %+v intents=%+v", request.Plan, request.Intents)
}
if _, err := BuildTaskEvaluationGraph(request.Plan); err != nil {
t.Fatalf("wire payload was rejected: %v request=%+v", err, request.Plan)
}
}