This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"task_file": "dev/tasks/DEV-000134-truth-bundle-compiler.json",
|
||||
"task_id": "DEV-000137",
|
||||
"task_id": "DEV-000138",
|
||||
"task_revision": 1
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"task_id": "DEV-000138",
|
||||
"task_revision": 1,
|
||||
"architecture_revision": "ADR-0018",
|
||||
"base_repo_revision": "1ccd43c",
|
||||
"risk_tier": "E",
|
||||
"intent": "Add executable contract coverage for authenticated cabinet, operations, learning, accessibility, responsive, and reduced-motion surfaces.",
|
||||
"requirement_ids": ["WP-801", "WP-802", "WP-805", "Authenticated cabinet acceptance"],
|
||||
"allowed_change_scope": {"modules": ["creator-web"], "paths": ["tests/creator_web/cabinet_acceptance_contract_test.go", "dev/ACTIVE_TASK.json", "dev/tasks/DEV-000138-ui-operations-acceptance-contract.json"]},
|
||||
"forbidden_change_scope": {"paths": ["architecture/**", "security/**", "deploy/**", "database/**", "cmd/**", "contracts/**", ".gitea/**"]},
|
||||
"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 creator-web authenticated API and static cabinet"], "may_change": ["Acceptance tests only"]},
|
||||
"semantic_owner": "creator-web",
|
||||
"canonical_state": ["None; tests inspect existing UI contract"],
|
||||
"state_transitions": ["login session gates cabinet; operations and learning request authenticated API data"],
|
||||
"side_effects_and_privileges": ["No external mutation; live authenticated browser acceptance remains a separate production verification"],
|
||||
"persistence_and_migrations": ["None"],
|
||||
"failure_retry_restart": ["Missing auth, learning, or responsive contract fails CI"],
|
||||
"assumptions": ["Credentials are never embedded in acceptance tests"],
|
||||
"acceptance_scenarios": ["cabinet exposes operations and reflection surfaces", "session and learning routes are authenticated", "mobile/reduced motion rules are present"],
|
||||
"required_tests": ["go test ./...", "go vet ./...", "preflight", "check-diff", "check-architecture", "independent", "git diff --check"],
|
||||
"terminal_gap_states": ["BLOCKED_BY_AUTHENTICATED_BROWSER_SESSION", "BLOCKED_BY_CONFLICT"]
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package creator_web_test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCreatorCabinetHasAuthenticatedOperationalAndLearningSurfaces(t *testing.T) {
|
||||
page, err := os.ReadFile("../../cmd/creator-web/static/index.html")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
markup := string(page)
|
||||
for _, marker := range []string{
|
||||
`<form id="login-form"`, `aria-labelledby="diagnostics-title"`, `data-page="operations"`,
|
||||
`id="learning"`, `id="reflection-list"`, `id="skill-list"`, `id="settings"`,
|
||||
`id="logout"`, `role="alert"`, `aria-live="polite"`,
|
||||
} {
|
||||
if !strings.Contains(markup, marker) {
|
||||
t.Fatalf("cabinet missing %q", marker)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreatorCabinetRoutesSessionAndLearningThroughAuthenticatedAPI(t *testing.T) {
|
||||
script, err := os.ReadFile("../../cmd/creator-web/static/assets/console.js")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
code := string(script)
|
||||
for _, marker := range []string{
|
||||
`request("/api/session/current")`, `request("/api/learning/recent?limit=8")`,
|
||||
`request("/api/advisory-policy")`, `request("/api/capabilities/cognitive-proposal/health")`, `request("/api/learning/recent?limit=1")`, `sessionStorage.getItem("domovoy.creator.session")`,
|
||||
`if (response.status === 401`,
|
||||
} {
|
||||
if !strings.Contains(code, marker) {
|
||||
t.Fatalf("console missing authenticated flow %q", marker)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreatorCabinetResponsiveAndReducedMotionRulesExist(t *testing.T) {
|
||||
style, err := os.ReadFile("../../cmd/creator-web/static/assets/console.css")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
css := string(style)
|
||||
for _, marker := range []string{"@media (max-width: 680px)", "@media (prefers-reduced-motion: reduce)", ".learning-grid { grid-template-columns: 1fr; }"} {
|
||||
if !strings.Contains(css, marker) {
|
||||
t.Fatalf("console missing responsive rule %q", marker)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user