// This file holds the words alta-adopt shows or asks Paul to type. They // go through the copy-review skill before merge (plan Task 14, step 5); // a change here is a change of copy. // // Approved by Paul, 2026-11-16, verbatim: copy review // 2y3evbm7avhwx5sy6ubygyewae (every string in this file) and the README // runbook in copy review si53b27d3tasj7si7ubqovkqw4. The strings changed // for Paul's ruling of 2026-11-17 (Home discussion 103: the delivery check // replaces the witness, and the live checks are dropped) were approved // verbatim in copy review 2axwfwbh2w5tlh2qaehjutl55a. package adopt import ( "fmt" "strings" ) // WriteSummary is configure's dry-run description of the write: the two // keys and the bundle they are written to, never their values. func WriteSummary(keys [2]string, bundle string) string { return "set " + keys[0] + ", " + keys[1] + " on " + bundle } // ---- the alta-adopt command ---- // Usage is alta-adopt's help: what it prints with no command, with help, // or with a command it does not know. // // The witness and live lines are gone, and the // --carlos-token-fd line no longer names witness. const Usage = `alta-adopt adopts the Oficina apps into the Oficina team at Home. Usage: alta-adopt --config [flags] Without --apply, a command shows what it would do and writes nothing, anywhere. Commands, in the order of a run: home-preflight --phase pre-initialize|pre-plan-a check Home before initialize or before Plan A preflight [--app ] check each app's CARLOS configuration (never writes) initialize open Home's initialize plan on the directory plan-a open Plan A: seed the team, then provision and register the apps advance --run take a run as far as it can go now configure --app write the app's two agent keys, restart it and check it activate --apps open Plan B (calendar) or Plan C (the other apps) rollback-config --app remove the app's two agent keys and restart it disable --app disable the app's team binding at Home status show where the adoption is (never writes) version print the version Flags: --config the configuration file: mode 0600, owned by you --carlos-token-fd read the CARLOS Admin token from file descriptor n (3 or above); configure, activate, rollback-config, preflight and the advance of Plans B and C need it --apply do it ` // What the command says. Values are app slugs, hosts, run ids, states // and fixed codes, never a secret, a value or an address. const ( SayDryRun = "Dry run: nothing was written. Run it again with --apply to do it." SayDone = "Done." SayHomeQueries = "Run each query against Home with carlos db query (it only reads), and type the count it answers." SayHomeReady = "Home is as this phase needs it." SayInitializeWould = "This opens Home's initialize plan on the directory. With --apply you will be asked to type this sentence:" SayInitializeType = "Type this sentence, exactly, if it is true:" SayPlanAWould = "This opens Plan A on both roles: the Oficina team, then each app's provision and register. With --apply you will be asked for the owner's address." SayPlanAOwner = "Type the owner's address, as they sign in at Home:" SayAdvanceWould = "With --apply this takes the run as far as it can go now." SayDisableAsk = "With --apply you will be asked to type the team's label." ) // SayHomeQuery asks for one count. func SayHomeQuery(query string) string { return query + "\ncount: " } // SayHomeRefused lists what the Home preflight found wrong. func SayHomeRefused(codes []string) string { return "Home is not as this phase needs it: " + strings.Join(codes, ", ") } // SayPlanAContinue is plan-a once the team is seeded. func SayPlanAContinue(apps []string) string { return "The team is seeded. This continues Plan A for the apps not yet registered: " + strings.Join(apps, ", ") + "." } // SayPlanAResubmit is plan-a when Plan A's plan lapsed before the seed. const SayPlanAResubmit = "Plan A's plan lapsed before the team was seeded. This signs it again." // SayRun is a run's state. func SayRun(id int64, state, code string) string { return strings.TrimSpace(fmt.Sprintf("Run %d: %s %s", id, state, code)) } // SayConfirm is what Paul does after a plan is opened: confirm it on // Home's pages for roles, then advance the run. func SayConfirm(id int64, roles []string) string { pages := "directory" if len(roles) > 1 { pages = "directory and credential" } return fmt.Sprintf("Run %d opened. Confirm it on Home's %s confirm pages, then run:\n alta-adopt advance --run %d --apply", id, pages, id) } // SayConfigureWould is configure's dry run after the write's summary. func SayConfigureWould(host string) string { return "Then it restarts " + host + " alone, waits for it to serve the new configuration, and checks that it still serves the reviewed release." } // SayConfigured is a finished configure, its delivery check recorded. func SayConfigured(host string) string { return host + " restarted on the new configuration, and nothing else changed. It still serves the reviewed release and now answers agent requests. Delivery check recorded." } // SayActivateApp is one app's readiness for activation. func SayActivateApp(app string, codes []string) string { if len(codes) == 0 { return app + ": ready" } return app + ": refused: " + strings.Join(codes, ", ") } // SayActivateWould is activate's dry run. func SayActivateWould(apps []string) string { return "With --apply this opens an add-apps plan on both roles for: " + strings.Join(apps, ", ") + "." } // SayRolledBack is a finished rollback. func SayRolledBack(host string) string { return host + ": both agent keys removed, and the app restarted on its previous configuration." } // SayRollbackWould is rollback-config's dry run when both agent keys are // still in place: which keys go, from which bundle, and which host // restarts. func SayRollbackWould(keys [2]string, bundle, host string) string { return "This removes " + keys[0] + " and " + keys[1] + " from " + bundle + ", then restarts " + host + " alone and waits for it to serve its previous configuration." } // SayRollbackRestartOnly is rollback-config's dry run when the keys are // already gone but the restart has not been seen through. func SayRollbackRestartOnly(keys [2]string, host string) string { return keys[0] + " and " + keys[1] + " are already removed. This restarts " + host + " alone and waits for it to serve its previous configuration." } // SayRollbackNothing is rollback-config once the rollback is complete. func SayRollbackNothing(host string) string { return host + " is already rolled back. There is nothing to do." } // SayDisableType is disable's prompt. func SayDisableType(app string) string { return "This disables " + app + "'s team binding at Home. Type the team's label to go on:" } // SayDisableWould is disable's dry run. func SayDisableWould(app string) string { return "This opens a plan on the directory to disable " + app + "'s team binding at Home." } // SayStatusTeam is the team's state. func SayStatusTeam(seeded bool) string { if seeded { return "Team: seeded" } return "Team: not seeded" } // SayStatusPreflight is one Home preflight's state. func SayStatusPreflight(phase string, recorded bool) string { if recorded { return "Home preflight " + phase + ": recorded" } return "Home preflight " + phase + ": not recorded" } // SayStatusApp is one app's line: its Home steps and its journal. func SayStatusApp(app string, parts []string) string { return app + ": " + strings.Join(parts, ", ") } // SayStatusNothing is an app with no step and no journal yet. const SayStatusNothing = "not started" // SayStatusDeliveryCheck is an app's journal part once its delivery check // is recorded. const SayStatusDeliveryCheck = "delivery-check" // The command's refusals before it reaches anything: its flags, its // config file and the token's descriptor. They name fields and flags, // never a value. const ( RefuseFlag = "not a flag this command takes" RefuseConfigMissing = "--config is required" RefuseConfigOpen = "the config file does not open" RefuseConfigRegular = "the config file is not a regular file" RefuseConfigMode = "the config file must be mode 0600" RefuseConfigOwner = "the config file must be owned by you" RefuseConfigRead = "the config file does not read" RefuseConfigJSON = "the config file is not the expected JSON" RefuseTokenFD = "--carlos-token-fd must name a descriptor of 3 or above" RefuseTokenFDClosed = "--carlos-token-fd does not name an open descriptor" RefuseTokenFDRead = "--carlos-token-fd does not read" RefuseTokenLong = "the CARLOS token is too long" RefuseTokenEmpty = "the CARLOS token is empty" RefuseStateOpen = "the state database does not open" RefuseNoJournalBase = "the journal has a write and no baseline" RefuseConsoleReached = "an adoption run reached for the console" ) // RefuseConfigField is a config field that is missing or malformed. func RefuseConfigField(field string) string { return "the config's " + field + " is missing or malformed" } // Hints that follow a refusal, telling Paul what comes first. const ( HintPreInitialize = "Run alta-adopt home-preflight --phase pre-initialize --apply first." HintPrePlanA = "Run alta-adopt home-preflight --phase pre-plan-a --apply first." HintToken = "This command reads CARLOS: pass the Admin token with --carlos-token-fd." HintCanary = "Activate calendar first: alta-adopt activate --apps calendar --apply." )