package plan3test import ( "amadan.net/oficina/equipo/internal/copydesk" "html" "os" "os/exec" "path/filepath" "regexp" "slices" "strconv" "strings" "testing" "amadan.net/oficina/equipo/internal/release" "amadan.net/oficina/equipo/internal/runner/provider" "amadan.net/oficina/equipo/internal/taskplan" "amadan.net/oficina/equipo/internal/testci" ) func TestPlan3ReleaseBoundaries(t *testing.T) { t.Run("inventory", plan3CopyInventory) t.Run("copy", func(t *testing.T) { // Test the production release check with otherwise reviewed inputs, one // pending surface at a time. A pending runtime entry cannot hide a doc gap. files := []string{"internal/equipo/copy.go", "docs/api/equipo-v1.md", "docs/plan-3-acceptance.md", "docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md"} root := t.TempDir() write := func(t *testing.T, path, value string) { t.Helper() path = filepath.Join(root, path) must(t, os.MkdirAll(filepath.Dir(path), 0700)) must(t, os.WriteFile(path, []byte(value), 0600)) } for _, path := range files { write(t, path, "reviewed fixture\n") } run := func(t *testing.T, want bool) { t.Helper() testci.Files(t, "../../scripts/plan3-copy-check.py") cmd := exec.Command("python3", "-c", `import runpy,sys; m=runpy.run_path('../../scripts/plan3-copy-check.py'); sys.exit(0 if m['copy_reviewed'](m['Path'](sys.argv[1])) else 1)`, root) out, err := cmd.CombinedOutput() if (err == nil) != want { t.Fatalf("copy gate accepted=%v want=%v: %s", err == nil, want, out) } } // A document outside the reviewed surfaces does not hold a release. write(t, "docs/superpowers/plans/another-plan.md", "COPY REVIEW REQUIRED\n") run(t, true) for _, path := range files { t.Run(filepath.Base(path), func(t *testing.T) { write(t, path, "COPY REVIEW REQUIRED\n") run(t, false) write(t, path, "reviewed fixture\n") }) } write(t, files[2], "# Draft: pending copy review\n") run(t, false) write(t, files[2], "reviewed fixture\n") must(t, os.Remove(filepath.Join(root, files[1]))) run(t, false) raw, err := os.ReadFile("../../scripts/runner-release-check.py") must(t, err) if !strings.Contains(string(raw), "plan3-copy-check.py") { t.Fatal("versioned release does not invoke Plan 3 copy gate") } }) t.Run("install", func(t *testing.T) { // A build that recorded no tool proxy installs nothing. m := release.BuildManifest() if m.Installable() { t.Fatal("a build with no recorded tool proxy is installable") } for _, name := range []string{"claude", "codex"} { if provider.LoginVersion(name) != map[string]string{"claude": m.Claude, "codex": m.Codex}[name] { t.Fatal("login and execution pins differ") } d := provider.NewLoginDriver() if d.(interface{ Supported(string) bool }).Supported(name) { t.Fatal("missing official login accepted") } } m.Binaries = append(m.Binaries, release.BinaryDigest{Name: "equipo-tool-proxy", Version: m.LauncherVersion, SHA256: strings.Repeat("a", 64)}) if !m.Installable() { t.Fatal("a release that recorded its tool proxy is not installable") } for _, platform := range []string{"darwin/arm64", "linux/arm64", "hosted"} { m.RunnerTarget = platform if m.Installable() { t.Fatal("unsupported runner installable", platform) } } }) t.Run("login_capability", func(t *testing.T) { for _, name := range []string{"claude", "codex"} { for _, mode := range []string{"version", "command"} { t.Run(name+"/"+mode, func(t *testing.T) { binary := acceptanceLoginCLI(t, name, "fixture@example.test") raw, err := os.ReadFile(binary) must(t, err) script := string(raw) if mode == "version" { script = strings.ReplaceAll(script, provider.LoginVersion(name), "0.0.0") } else { script = strings.ReplaceAll(script, "'auth login --help'|'login --device-auth --help') exit 0", "'auth login --help'|'login --device-auth --help') exit 9") } must(t, os.WriteFile(binary, []byte(script), 0700)) driver := provider.NewLoginDriver(provider.LoginOptions{ClaudePath: binary, CodexPath: binary}) if driver.(interface{ Supported(string) bool }).Supported(name) { t.Fatal("unsupported login capability accepted", mode) } }) } } }) t.Run("publication", func(t *testing.T) { p := taskplan.BugPlan("feature", 1) p.Kind = taskplan.Feature p.Steps[0].Action = "scope" p.Steps[0].Specialist = "product" must(t, taskplan.Validate(p)) for _, action := range []string{"review", "checks", "person"} { bad := p bad.Steps = nil for _, step := range p.Steps { if step.Action != action { bad.Steps = append(bad.Steps, step) } } if taskplan.Validate(bad) == nil { t.Fatal("publishing guard removed", action) } } for _, action := range []string{"merge", "deploy"} { bad := p bad.Steps = append([]taskplan.Step(nil), p.Steps...) bad.Steps[len(bad.Steps)-1].Action = action if taskplan.Validate(bad) == nil { t.Fatal("automatic publication accepted", action) } } }) t.Run("API", personAPIContractCoverage) } func plan3CopyInventory(t *testing.T) { t.Helper() current, err := os.ReadFile("../equipo/copy.go") must(t, err) base, err := exec.Command("git", "show", "ff73f89:internal/equipo/copy.go").Output() must(t, err) report, err := os.ReadFile("../../docs/superpowers/plans/CONTROLLER-REPORT-plan-3.md") must(t, err) _, inventory, ok := strings.Cut(string(report), "## Plan 3 copy inventory (for Paul's review)") if !ok { t.Fatal("complete Plan 3 copy inventory missing") } inventory, _, _ = strings.Cut(inventory, "\n## ") rows := map[string]string{} for _, line := range strings.Split(inventory, "\n") { if strings.HasPrefix(line, "| `") { cells := strings.Split(line, " | ") if len(cells) != 4 { t.Fatal("malformed copy row") } key := strings.TrimPrefix(strings.TrimSuffix(cells[0], "`"), "| `") rows[key] = html.UnescapeString(strings.ReplaceAll(cells[1], "
", "\n")) acceptedAll := strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)") acceptedGuide := strings.HasPrefix(cells[2], "Guided live gate") && strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)" acceptedStarter := key == "scope" && strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED FOR NOW (Paul, 2026-11-05; starter-set brief)" acceptedRound2 := slices.Contains([]string{"CopyCalibrationFunding"}, key) && strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED FOR NOW (Paul, 2026-11-05; iterate in context)" // Paul delegated copy review on 2026-10-25; a row Astra's // delegated pass accepted carries that marker. acceptedDelegation := strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-11)") || strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-12)") || strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-13)") || slices.Contains([]string{"docs/api/equipo-v1.md / COPY ACCEPTED FOR NOW (Paul, 2026-11-04; iterate in context)", "docs/api/equipo-v1.md / Retry writes and handle revisions", "docs/api/equipo-v1.md / Reconnect and answer questions", "docs/api/equipo-v1.md / Talk to your Coordinator from a device"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-19)") || slices.Contains([]string{"conversation.empty", "conversation.start.label", "conversation.start.bug", "conversation.start.bug_draft", "conversation.start.feature", "conversation.start.feature_draft", "conversation.start.project", "conversation.start.project_draft", "work.track.working"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-20)") // Paul's own review of the publish strings (base-publish). approvedPublish := strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-12, copy-review jadya3tfrmkf7t3ym2nqhpgira, unchanged)") // Paul's own review of the Assistant lane's strings and API section. approvedAssistant := strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-13, copy-review jbltdd2mvwblrz4en6xfhv6d2y, unchanged)") || strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-13, copy-review 64nswfjbrpsw2pezhyi7y3nenq, unchanged)") || strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-13, copy-review c3ipwcupsvwv7rpbj2kdbgrsyy, unchanged)") // Paul's own review of the jobs strings and the API section's job prose. approvedJobs := strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-14, copy-review cvaxhn3pwgpxhpssj5cgizqtrq, unchanged)") || strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-14, copy-review cvaxhn3pwgpxhpssj5cgizqtrq)") || strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-14, copy-review mbvzxmewxxgud4ksakdb2m7pye)") // Paul's own review of the Oficina connection's strings and API sentence. approvedOficina := strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-16, copy-review arfnqquz6wks4vdyxptv6ditju, unchanged)") // Paul's own review of the failed-reply lines and Try again, and of the sign-in door's refusal. approvedFailedReplies := strings.HasPrefix(key, "chat.failed.") && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-22, copy-review ipgtz3lqoo3rj6rpiodpekh6vu, unchanged)") || key == "signin.refused" && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-22, copy-review smart-door-copy-5, unchanged)") // Paul's own review of the Engineering stop reasons. approvedStopReasons := slices.Contains([]string{"work.reason.no_further_changes", "work.reason.tools_refused"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-23, copy-review eavqvil43jg2zs3wxx3kxp3bpm, unchanged)") // Paul's approval of the no-access going-live strings, given in the // coordinator's session (2026-11-26). approvedNoAccess := slices.Contains([]string{"assistant.team.no_access", "assistant.job.detail.no_access"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-26, coordinator session, unchanged)") // Paul's own review of the merge step's credential and hub reasons. approvedMergeCredential := slices.Contains([]string{"work.reason.merge_credential", "work.reason.amadan_unreachable"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-25, copy-review 6wxwi7zo3fph5nu4nm6eipptfq, unchanged)") // Paul's own review of the coordinator's stuck-task strings. approvedStuckTasks := slices.Contains([]string{"chat.merge.retry_offer", "chat.activity.offer_retry", "chat.activity.retry_step", "work.tl.coordinator_retried"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-25, copy-review 6haczxo74hoyyuf7xkojgqd27e, unchanged)") acceptedRoster := strings.HasPrefix(key, "roster.") && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-14)") acceptedPlacement := strings.HasPrefix(key, "placement.") && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-15)") acceptedAccess := slices.Contains([]string{"access.waiting", "access.reopen", "access.not_owned", "access.already", "access.unconfirmed", "access.missing", "access.uncheckable", "access.authority", "access.confirm_namespace", "access.namespace", "access.granted_note", "access.title", "access.confirm", "access.ask", "access.approve", "access.aside", "access.reason", "access.role", "access.confirmation", "access.filing", "access.pending", "access.approved", "access.declined", "access.expired", "access.limited", "access.failed", "access.operator", "access.continue"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-17)") acceptedPlacementEdges := slices.Contains([]string{"placement.late_push", "placement.late_report"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-17)") acceptedReportActions := slices.Contains([]string{"roster.talk", "roster.round_busy", "roster.round_done", "roster.merge_busy", "roster.merge_done"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-15)") // Luna's delegated pass on the boot refusal for CARLOS mail submission. acceptedInjection := slices.Contains([]string{"autonomy.title", "autonomy.lede", "autonomy.auto_merge_ci", "autonomy.auto_merge_ci_help", "autonomy.public_previews", "autonomy.public_previews_help", "autonomy.empty", "work.reason.base_checks_failed", "chat.merge.not.base_failed", "chat.merge.not.base_checks", "chat.merge.not.gates", "chat.merge.not.review_truncated", "work.reason.base_gate_unavailable", "work.reason.preview_secrets", "work.reason.preview_scanner", "work.reason.preview_public_disabled", "work.reason.preview_host", "work.reason.preview_headers", "autonomy.auto_merge_sensitive", "autonomy.auto_merge_sensitive_help", "work.reason.preview_header_missing", "preview.unsafe_question", "preview.unsafe_help", "preview.unsafe_open", "preview.wrapper_title"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Astra, 2026-11-19)") acceptedMail := key == "copyMissingSMTP" && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-17)") // Luna's delegated pass on native slice 2's push strings and API // prose (Paul, 2026-11-20: Luna's verdicts are the review). acceptedPush := slices.Contains([]string{"copyLoggedPushPublic", "copyCarlosPushUnavailable", "copyPushBoth", "push.card.title", "push.card.body", "push.reply.title", "push.task.done", "push.task.cancelled", "push.task.failed", "push.activity.started", "docs/api/equipo-v1.md / Talk to your Coordinator from a device: set aside", "docs/api/equipo-v1.md / Receive pushes on a device"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-20)") // Paul, 2026-11-20: Luna's verdicts are the agent-access copy review. // Paul, 2026-11-22: Luna verdicts and the controller clarification are this slice's review. acceptedAPIErrors := slices.Contains([]string{"api.repo_not_allowed", "api.card_answered", "api.card_stale", "api.confirmation_required", "api.coordinator_busy", "api.hold_bar", "api.idempotency_conflict", "api.models_not_allowed", "api.not_active", "api.not_askable", "api.not_mergeable", "api.not_retryable", "api.question_ended", "api.runner_offline", "api.task_busy", "api.task_ended", "api.task_merging", "api.turn_ended"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23)") acceptedNativeProjects := slices.Contains([]string{"projects.new_request", "projects.remove_selection"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23)") acceptedGitHubApp := slices.Contains([]string{"github.title", "github.connect", "github.account", "github.account_type", "github.organization", "github.personal_account", "github.create_app", "github.create_hint", "github.confirm_account", "github.repository_count", "github.confirm", "github.connected", "github.already_connected", "github.disconnect", "github.disconnect_hint", "github.pending", "github.pending_hint", "github.pending_approval", "github.check_again", "github.redirect_expired", "github.pending_expired", "github.setup_failed", "github.app_remains", "github.app_settings", "github.reconnect", "github.reconnect_hint", "github.check_failed", "github.not_connected", "github.suspended", "github.too_many", "github.choose_repositories"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23)") // Luna's verdict on the GitHub sweep log line, 2026-11-25. acceptedGitHubSweep := key == "copyGitHubSweep" && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-25)") acceptedGitHubEgress := key == "CopyGitHubEgress" && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23)") acceptedForgeSeam := key == "work.reason.proposal_failed" && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23)") // Luna's reviews of the paused-work strings and API prose (2026-11-24). // Luna's two native preview API error verdicts, controller 2026-11-26. // Luna's seven operator check-db verdicts, controller 2026-11-26. acceptedDBCheck := slices.Contains([]string{"CopyDBPathMissing", "CopyDBPathInvalid", "CopyDBOpenFailed", "CopyDBCheckFailed", "CopyDBTimeout", "CopyDBMetadataFailed", "CopyDBArguments"}, key) && strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-26)" acceptedPreview := slices.Contains([]string{"api.preview_changed", "api.preview_expired"}, key) && strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-26)" // Luna's review of the Assistant's file strings, controller 2026-11-26. acceptedAskFiles := slices.Contains([]string{"api.attachments_unavailable", "api.attachment_sent", "chat.activity.read_attachment"}, key) && strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-26)" acceptedPaused := slices.Contains(pausedCopyKeys, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24)") // Luna's review of the new team's grant card line (hub #48). acceptedNewTeamCard := key == "chat.card.access_first" && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-24)") acceptedCardNames := slices.Contains([]string{"projects.carried_selection", "projects.remember_name", "projects.name_to_remember", "projects.use_title", "docs/api/equipo-v1.md / Projects and starting a request"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23)") acceptedProjects := slices.Contains([]string{"projects.amadan", "projects.yours", "projects.can_add", "projects.add_reachable", "projects.names", "projects.names_hint", "projects.details", "projects.title", "projects.description", "projects.save", "projects.context", "projects.found", "projects.selected", "projects.owner_add", "projects.selection_lost", "projects.other", "projects.name_question", "projects.personal_names", "projects.forget_name", "docs/api/equipo-v1.md / Projects and starting a request"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-22)") acceptedAgentAccess := slices.Contains([]string{"copyAgentConfig", "copyAgentForbidden", "copyAgentNotFound", "copyAgentUnavailable", "copyAgentTooLarge", "copyAgentInvalid", "copyAgentMedia", "copyAgentUnauthenticated", "agent.equipo_projects_list", "agent.equipo_tasks_list", "agent.equipo_task_get", "agent.equipo_needs_you", "docs/api/equipo-v1.md / Delegated read-only operations"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-20)") // Luna's review of the places slice 1 strings (Paul, 2026-11-26: Luna reviews all but the place and publish cards, which stay his). acceptedPlaces := slices.Contains([]string{"chat.publish_blocked", "chat.publish_unproven", "places.missing.no_place", "places.missing.no_runner", "places.missing.runner_outdated", "places.missing.carlos_outdated", "places.missing.no_login", "places.missing.no_deploy", "places.missing.not_owner", "work.reason.carlos_outdated", "work.reason.publish_secrets", "work.reason.publish_scanner", "work.reason.publish_key_missing", "work.reason.publish_mint_failed", "work.reason.publish_app_missing", "work.reason.publish_app_unproven", "chat.activity.places", "chat.activity.propose_place", "chat.activity.publish_site", "chat.activity.site_status", "settings.places", "settings.places_about", "places.title", "places.empty", "places.site_line", "places.site_live", "places.site_unconfirmed", "places.site_not_yet", "places.unplaced", "places.pending", "places.deploy_held", "places.deploy_lost", "places.deploy_none"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-26)") // Paul's own review of the place and publish cards (places slice 1). approvedPlaces := slices.Contains([]string{"chat.card.place_question", "chat.card.place_option", "chat.card.place_chose", "chat.card.place_chose_not_now", "chat.card.publish_place_question", "chat.card.publish_setup_note", "chat.card.publish_mint_note", "chat.card.publish_stale"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-26, copy-review iic5rwpyavu7rnhiuvx7cnedzm, unchanged)") // Luna's review of the Mac fixes' installer and task lines (Paul, 2026-11-28: Luna reviews all but the four Needs you card lines, which stay his). acceptedMacFixes := slices.Contains([]string{"runner.mac.other_instance", "runner.install.other_instance", "runner.enrol.identity", "runner.mac.restored", "runner.mac.not_restored", "work.needs.mac_runner", "work.needs.mac_engineering", "work.waits.mac_runner", "work.waits.mac_engineering"}, key) && strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-28)" // Paul's own review of Mac slice F's six lines, and Luna's of the rest (Paul delegated 2026-10-25), controller 2026-11-29. approvedMacSliceF := slices.Contains(macSliceFPaulKeys, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-29, copy-review d62qn3bsdsvg6g2c42p2t3ptqm, unchanged)") acceptedMacSliceF := slices.Contains(macSliceFLunaKeys, key) && strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-29)" // Paul's own review of the four Mac Needs you card lines (2026-11-29). approvedMacCards := slices.Contains([]string{"work.decide.mac_runner_why", "work.decide.mac_runner_ask", "work.decide.mac_engineering_why", "work.decide.mac_engineering_ask"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-29, copy-review ugmpahjf6nxcpfkjflv35rjoeq, unchanged)") // Paul's own review of the Design card, recovery card, held card and // direction card strings (dynamic specialists slice 1). approvedDesign := slices.Contains([]string{"chat.specialist.capability.branch.edit", "chat.specialist.capability.page.render", "chat.card.specialist_project", "chat.specialist.added_record", "chat.specialist.added_ask", "chat.specialist.profile.design-v1", "chat.specialist.profile.research-v1", "chat.card.maker_removed", "chat.card.to_engineering", "chat.card.maker_removed_chose_to_engineering", "chat.held.design_limit", "work.decide.direction_ask_options", "chat.card.direction_note_options", "chat.card.build_note", "api.direction_note"}, key) && strings.TrimSuffix(cells[3], " |") == "COPY APPROVED (Paul, 2026-11-29, copy-review v4fsltihakfhehduzju7dgu47m, unchanged)" // Luna's review of the rest of dynamic specialists slice 1's strings. acceptedDesign := slices.Contains([]string{"work.reason.specialist_no_grant", "work.design.design_limit", "work.design.design_runner_old", "work.design.design_renderer", "work.design.design_no_claude", "work.captures.option", "work.captures.alt", "work.captures.none", "work.captures.tree.work", "work.captures.tree.base", "work.captures.tree.diff", "work.explore.build_note"}, key) && strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED BY DELEGATION (Luna, 2026-11-29)" acceptedCopy := strings.TrimSuffix(cells[3], " |") == "COPY ACCEPTED BY DELEGATION (Copy, record-bound) sha256:"+copydesk.Hash(rows[key]) // Paul's own review of the Assistant abilities strings (2026-11-28). approvedAbilities := slices.Contains([]string{"assistant.ability.web.name", "assistant.ability.apps_read.name", "assistant.ability.apps_write.name", "assistant.ability.build.name", "assistant.ability.go_live.name", "assistant.ability.services.name", "assistant.ability.services_add.name", "assistant.job.detail.ability_off", "assistant.job.detail.ability_back", "assistant.job.detail.go_live_off", "chat.card.ability_off", "oficina.connect.ability_off", "services.inventory.question", "services.inventory.confirm", "assistant.activity.lookup", "assistant.lookup.fallback_sources"}, key) && strings.HasSuffix(strings.TrimSuffix(cells[3], " |"), "COPY APPROVED (Paul, 2026-11-28, copy-review mi3kgi7nubnsf7kxn235tqwrbu, unchanged)") if !approvedDesign && !acceptedDesign && !approvedMacSliceF && !acceptedMacSliceF && !approvedMacCards && !approvedAbilities && !acceptedMacFixes && !acceptedGitHubApp && !acceptedGitHubSweep && !approvedPlaces && !acceptedPlaces && !acceptedAskFiles && !acceptedDBCheck && !acceptedPreview && !approvedNoAccess && !approvedMergeCredential && !approvedStuckTasks && !acceptedPaused && !acceptedNewTeamCard && !acceptedGitHubEgress && !acceptedForgeSeam && !acceptedAPIErrors && !acceptedNativeProjects && !acceptedInjection && !acceptedMail && !acceptedPush && !acceptedAgentAccess && !acceptedProjects && !acceptedCardNames && !acceptedAccess && !acceptedPlacementEdges && !acceptedPlacement && !acceptedReportActions && !acceptedRoster && !acceptedCopy && !strings.Contains(cells[3], "COPY REVIEW REQUIRED") && !acceptedAll && !acceptedGuide && !acceptedRound2 && !acceptedStarter && !acceptedDelegation && !approvedPublish && !approvedAssistant && !approvedJobs && !approvedOficina && !approvedFailedReplies && !approvedStopReasons { t.Fatal("entry has no copy review status or applicable acceptance", key) } } } patterns := []*regexp.Regexp{ regexp.MustCompile(`(?m)^\s*"([^"]+)":\s*("(?:[^"\\]|\\.)*")`), regexp.MustCompile(`(?m)^(?:const )?\s*([A-Za-z][A-Za-z0-9_]*)\s*=\s*("(?:[^"\\]|\\.)*")`), } for _, pattern := range patterns { old := map[string]bool{} for _, m := range pattern.FindAllStringSubmatch(string(base), -1) { old[m[1]+"\x00"+m[2]] = true } for _, m := range pattern.FindAllStringSubmatch(string(current), -1) { if old[m[1]+"\x00"+m[2]] { continue } text, err := strconv.Unquote(m[2]) must(t, err) if rows[m[1]] != text && rows["runnerDraftCopy."+m[1]] != text { t.Fatal("pending copy omitted or changed in review inventory", m[1]) } } } // Full API sections must be present, including the newest notification prose. raw, err := os.ReadFile("../../docs/api/equipo-v1.md") must(t, err) for _, heading := range regexp.MustCompile(`(?m)^## (.+)$`).FindAllStringSubmatch(string(raw), -1) { if rows["docs/api/equipo-v1.md / "+heading[1]] == "" { t.Fatal("API section omitted", heading[1]) } } if rows["docs/mockups/onboarding.html / Mac app enrolment note"] == "" || rows["runner.install.lingering"] == "" { t.Fatal("setup proposals or diagnostics omitted") } } // macSliceFPaulKeys are the six Mac slice F lines Paul approved unchanged // (copy review d62qn3bsdsvg6g2c42p2t3ptqm, 2026-11-29). var macSliceFPaulKeys = []string{"work.needs.mac_connection", "work.needs.mac_update", "chat.connections.add_to", "work.needs.mac_runner", "work.needs.mac_engineering", "work.step.made_on"} // macSliceFLunaKeys are the Mac slice F strings shipped exactly as Luna // reviewed them (2026-11-29). var macSliceFLunaKeys = []string{"runner.mac.home_open", "work.decide.mac_connection_why.no_connection", "work.decide.mac_connection_why.signed_out", "work.decide.mac_connection_why.limited", "work.decide.mac_connection_why.probes_pending", "work.decide.mac_connection_why.probes_failed", "work.decide.mac_connection_why.cli_unpinned", "work.decide.mac_connection_why.home_open", "work.decide.mac_connection_why.tainted", "work.decide.mac_update_why", "work.decide.mac_wait_ask", "work.reason.base_unavailable", "chat.merge.not.mac_made", "work.reason.workspace_too_large", "runner.probe_detail.turn_busy", "runner.unproven.record_incomplete", "runner.mac.home_open_folder", "runner.mac.keychain_item", "runner.unproven.credential_unproven", "chat.connections.reason.mac_claude_only", "work.reason.secret_in_candidate", "work.reason.engineering_unavailable", "work.ask.mac_offline", "runner.probe.F1", "runner.probe.F2", "runner.probe.F3", "runner.probe.F4", "runner.probe.F5", "runner.probe.F6", "runner.probe.F7", "work.step.no_xcode", "work.step.waiting_base", "work.decide.sandbox_held", "work.decide.unsandboxed_withdrawn", "runner.engineering", "runner.engineering.ready", "runner.engineering.no_connection", "runner.engineering.signed_out", "runner.engineering.limited", "runner.engineering.probes_pending", "runner.engineering.probes_failed", "runner.engineering.cli_unpinned", "runner.engineering.home_open", "runner.engineering.tainted", "runner.mac.holds_claude", "runner.tainted_held", "runner.unproven.processes_left", "runner.probe_detail.probe_limit", "runner.probe_detail.not_run", "runner.probe_detail.f5_skipped", "runner.probe_detail.inputs_changed", "runner.probe_detail.stale_runner", "runner.probe_detail.stale_settings", "runner.probe_detail.stale_cli", "runner.probe_detail.stale_xcode", "runner.probe_detail.stale_runtimes", "runner.probe_detail.future", "runner.probe_detail.expired", "runner.probe_detail.launch_not_started", "runner.probe_detail.launch_unproven", "runner.probe_detail.script_not_run", "runner.probe_detail.other_command", "runner.probe_detail.records_foreign", "runner.probe_detail.tree_unmade", "runner.probe_detail.not_prepared", "runner.probe_detail.no_loopback", "runner.probe_detail.script_unwritten", "runner.probe_detail.no_xcode", "runner.probe_detail.no_simulator", "runner.probe_detail.xcode_unavailable", "runner.probe_detail.simulator_unavailable", "runner.probe_detail.fixture_uncopied", "runner.probe_detail.fixture_unprepared", "runner.probe_detail.no_sentinel", "runner.probe_detail.allowed", "runner.probe_detail.not_shown_denied", "runner.probe_detail.not_collected", "runner.probe_detail.unix_only", "runner.probe_detail.reached_scratch", "runner.probe_detail.reached_tree", "runner.probe_detail.not_set_up", "runner.probe_detail.incomplete", "runner.probe_detail.tree_unsearched", "runner.probe_detail.secrets_unreadable", "runner.probe_detail.not_all_denied", "runner.probe_detail.loopback_hits", "runner.probe_detail.dns_control_failed", "runner.probe_detail.control_failed", "runner.probe_detail.no_token_file", "runner.probe_detail.no_procargs_reader", "runner.probe_detail.ps_control_failed", "runner.probe_detail.procargs_not_sandboxed", "runner.probe_detail.procargs_incomplete", "runner.probe_detail.process_list_unreadable", "runner.probe_detail.pipe_open", "runner.probe_detail.token_reached_scratch", "runner.probe_detail.token_reached_tree", "runner.probe_detail.token_reached", "runner.probe_detail.not_shown_tried", "runner.probe_detail.env_unreadable", "runner.probe_detail.token_in_env", "runner.probe_detail.control_read_missing", "runner.probe_detail.reached_model", "runner.probe_detail.not_shown_made", "runner.probe_detail.not_prescribed", "runner.probe_detail.unobserved", "runner.probe_detail.write_denied_place", "runner.probe_detail.write_through_link", "runner.probe_detail.hard_linked", "runner.probe_detail.link_not_refused", "runner.probe_detail.child_not_started", "runner.probe_detail.child_not_own_session", "runner.probe_detail.child_outlived", "runner.probe_detail.child_not_gone", "runner.probe_detail.f1_denied", "runner.probe_detail.f2_denied", "runner.probe_detail.other_home_os", "runner.probe_detail.f3_denied", "runner.probe_detail.f4_passed", "runner.probe_detail.f5_denied", "runner.probe_detail.unix_home", "runner.probe_detail.f6_denied", "runner.probe_detail.f7_denied", "runner.probe_detail.xcode", "runner.probe_detail.ios_simulators", "runner.probe_detail.computer", "runner.probe_detail.srt_missing", "runner.probe_detail.user_temp_refused", "runner.probe_detail.all_denied", "runner.probe_detail.end_unproven", "runner.probe_detail.srt_ran_xcode", "runner.probe_detail.srt_failed", "runner.probe_detail.srt_not_run", "runner.probe_detail.p3_keychain_denied", "runner.probe_detail.p3_keychain_unshown", "runner.probe_detail.p3_keychain_unprobed", "runner.probe_detail.p5_parked", "runner.probe_detail.homes_unchecked", "runner.probe_detail.homes_readable", "runner.probe_detail.homes_closed", "runner.probe_detail.agent_loaded", "runner.probe_detail.agent_not_loaded", "runner.probe_detail.sleep_unknown", "runner.probe_detail.sleep_off", "runner.probe_detail.sleep_after", "runner.probe_detail.test_not_started", "runner.probe_detail.group_gone", "runner.probe_detail.group_unproven", "runner.probe_detail.marked_left", "runner.probe_detail.still_running", "runner.probe_detail.simulators_shut", "runner.probe_detail.tree_removed", "runner.probe_detail.tree_not_removable", "runner.probe_detail.tool_missing", "runner.probe_detail.tool_version", "runner.probe_detail.node_old", "runner.probe_detail.srt_cannot_run", "work.step.waiting_publish", "runner.engineering.needs_p2"} // pausedCopyKeys are the paused-work strings and API prose Luna reviewed // (2026-11-24). var pausedCopyKeys = []string{"work.stage.paused", "work.stage.stopped", "work.stage.needs_you", "work.pause.until", "work.pause.since", "work.pause.moment", "time.tonight", "time.today_at", "time.tomorrow_at", "time.midnight", "time.in_hours", "work.pause.reason.headroom_out", "work.pause.reason.headroom_saving", "work.pause.reason.budget", "work.pause.reason.busy", "work.pause.reason.offline", "work.pause.next.by_itself", "work.pause.next.budget", "work.pause.next.busy", "work.pause.next.online", "work.pause.next.choose", "work.pause.next.try_again", "work.pause.next.update", "work.pause.next.spend_unknown", "work.pause.run_now_with", "work.pause.run_now_on", "work.pause.run_now_room", "work.pause.run_now_last", "work.pause.run_now_metered", "work.pause.check_machine", "work.pause.update_runner", "work.pause.connect", "work.pause.try_again", "work.pause.lead.spend_unknown", "work.pause.lead.no_connection", "work.pause.lead.too_old", "work.pause.lead.stopped", "assistant.job.paused", "assistant.job.paused_view", "assistant.job.detail.paused_allowance", "assistant.job.detail.paused_limit", "assistant.job.detail.paused_offline", "assistant.job.carry_on", "assistant.job.carry_on_note", "assistant.job.change_limit", "time.in_hours.one", "time.in_days.one", "api.carry_on_unavailable", "time.in_minutes", "time.in_minutes.one", "time.in_days", "time.when_in", "api.not_paused", "docs/api/equipo-v1.md / Talk to the Assistant: paused jobs", "docs/api/equipo-v1.md / Talk to the Assistant: only_if_unset", "api.already_running", "api.offer_changed", "work.pause.run_now_may_bill"}