@awebai/oats 0.69.7 → 0.69.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,48 @@
1
+ # OATS 0.69.8
2
+
3
+ Unreleased
4
+
5
+ 0.69.8 is the first slice of the onboarding redesign. `oats.framework` 1.18.0
6
+ ships the setup expert as a package soul, with a capability that tailors a new
7
+ workspace; `oats onboard` names it, the kernel records who spawned each
8
+ instance, and the Desktop can open on an instance. A pi home that may have no
9
+ provider also gets a warning. The catalog moves to oats.framework 1.18.0.
10
+
11
+ ## Upgrade
12
+
13
+ - **Either order of the Desktop and the CLI works.**
14
+ [Upgrading](../upgrading.md) installs the Desktop first, and a host that
15
+ installed the CLI first is fine too: the 0.69.8 Desktop accepts OATS CLIs
16
+ `>=0.26.0 <0.70.0`, and so does the 0.69.7 Desktop.
17
+ - **Package move:** the official catalog pins oats.framework 1.18.0, with no
18
+ change to its OATS floors. A deployment takes it by raising its own pin
19
+ (`/oats-package-pins`), then `oats sync`. Running instances keep the modules
20
+ they were spawned with: new spawns get the new ones, and a stopped home moves
21
+ with `oats instance upgrade`.
22
+
23
+ ## Added
24
+
25
+ - **Desktop opens on an instance: `--instance <name>` beside `--dir <deployment>`.** The deployment's window selects that instance in the roster as **Show in roster** does, on a first launch and on a launch while Desktop runs (`open -a "OATS Desktop" --args --dir <deployment> --instance <name>`). It only selects: nothing starts, attaches or is written. Only the `--dir` deployment's own instances count. A name not there yet (a spawn still finishing) is waited for about 30 seconds, then the window says "No instance <name> in this workspace". A value that isn't an instance name, or a name two instances share, selects nothing and says so. Selecting, typing or clicking while it waits drops it ([Opening on an instance](../desktop.md#opening-on-an-instance); [awebai/oats#1665](https://github.com/awebai/oats/issues/1665)). An older Desktop ignores the argument and opens the workspace.
26
+
27
+ - **`oats.framework` 1.18.0 ships the setup expert as a package soul, and a capability that tailors a new workspace.** The package soul `oats-setup-expert` holds `oats.setup` and the new `oats.onboarding`. It works in its own folder (`work: directory`), takes no knowledge slot and takes the workspace's messaging default. `oats.onboarding` 1.0.0 has one skill, `/oats-tailor-workspace`: for a new workspace, it discovers how the team works, authors the workspace's own coordination, knowledge and tasks capabilities from OATS's defaults, takes the person through the deployment-agent step their messaging capability offers (instances spawned after it carry a chain to them; earlier ones stay `unknown` until respawned), offers the approved channel route and briefs the person. The catalog maps `oats.onboarding` to `oats.framework` ([awebai/oats#1665](https://github.com/awebai/oats/issues/1665); [The official OATS catalog](../official-catalog.md)).
28
+
29
+ - **The kernel records who spawned each instance, and status rows show the human an instance's identity is attributed to.** The feature probe is `spawn-attribution`. Everything here is additive: a home, provider or client without these fields behaves as before.
30
+ - **`spawnedBy`.** A new instance records `spawnedBy: {instance, home}` in `instance.json` and in the `spawned` event, or `null`. Status rows, local and remote, carry it in that shape only: anything else reads `null`. The caller is the instance that the `spawnOrigin` check confirms, so `spawnedBy` non-null implies `spawnOrigin: "instance"`. `spawnOrigin: "instance"` with `spawnedBy: null` means the spawner's session was found gone. A spawner whose session can't be read (tmux unreadable, its session receipt unusable) is kept, and the spawn is never refused. A person's shell, the Desktop, an automation and another deployment's home give `null`, and so does a `--server` spawn whose caller is not a live home on that host. `spawnedBy` is separate from `parentInstance` and `relation`, so an instance's `--relation unrelated` spawn still has a spawner. It is written once, at spawn: retire's lineage repair doesn't touch it, and it can name a home that no longer exists.
31
+ - **`OATS_SPAWNER_HOME`.** Spawn hooks get the spawner's absolute home in this new reserved variable, unset when the spawner is `null`. It selects who signs the new identity. An inherited value is always dropped, and it never reaches the harness's pane. A capability should treat a missing value as a person's spawn only when the kernel lists `spawn-attribution`. The kernel reads the caller from its environment only, so a harness that strips its session's environment reads as a person's spawn.
32
+ - **`attributedHuman`.** Status rows, local and remote, gain `attributedHuman`. It is the label of the human that the messaging capability attributed its served identity to, through an optional `identity.attribution` (`{mode, human: {id, label}|null, parent: {id}|null}`). Otherwise it is `null`. Only the messaging-layer capability's identity counts. The label is untrusted text, held to a waiting claim's message rule: one line of 1 to 200 characters with no refused character, else `null`. A malformed `attribution` reads as absent and never fails a row. `oats inspect` passes the identity through unchanged.
33
+ - `spawnedBy` and `attribution` report: no kernel decision reads them.
34
+
35
+ See [awebai/oats#1665](https://github.com/awebai/oats/issues/1665), [Spawned by](../desktop-cli-api.md#spawned-by), [Attributed human](../desktop-cli-api.md#attributed-human) and [Commands and hooks](../capabilities.md#commands-and-hooks).
36
+
37
+ ## Changed
38
+
39
+ - **`oats onboard` names `oats.framework`'s setup expert, with a name for the workspace.** `next.spawn` picks the workspace's own `<workspace>-oats-setup-expert`, then the package soul `oats-setup-expert`, then the first soul by name that declares `oats.setup`; a soul is never chosen by its name alone. For the package soul it carries `--name <workspace>-oats-setup-expert`, or `<workspace>-oats-setup` when a soul of the workspace already holds that name, or no `--name` when that is taken too or the name would pass the 64-character instance-name limit; the text output says why. `next.spawn` stays a command string, and a long workspace name never makes onboarding fail ([awebai/oats#1665](https://github.com/awebai/oats/issues/1665); [`oats onboard`](../desktop-cli-api.md)).
40
+ - **`oats.setup` 2.10.0: SSH, signing and the DCO sign-off are optional.** `/oats-setup-expert` and `/oats-onboarding` no longer send every onboarding through `/oats-git-setup`: GitHub over https is enough for onboarding's reads, pushes and pull requests, and `/oats-git-setup` runs when Git access is broken or the person wants an SSH key, signed commits or the sign-off. For a new workspace whose setup expert carries `oats.onboarding`, `/oats-setup-expert` routes the use case, the first souls and knowledge to `/oats-tailor-workspace` ([awebai/oats#1665](https://github.com/awebai/oats/issues/1665)).
41
+
42
+ - **`/oats-agent-permissions` treats a checkpoint as an instance's own act.** A wake job on an instance's own home is no longer listed as an operator act. `oats schedule show` and `oats schedule host status` join the allow list as reads, and the `autoMode` entry tells the classifier that adding or removing such a job is normal. Installing the host's timer stays the operator's, and `--wake-*` on a spawn stays `ask`.
43
+
44
+ - **The macOS installers are built on `macos-15`.** GitHub retires `macos-14` on 2026-11-02, so `release.yml`, `build-installers.yml`, the macOS test run and the TUI's macOS tests move to it. The installers' targets and signing don't change, and the x64 installer is still cross-built and smoke-tested under Rosetta.
45
+
46
+ ## Fixed
47
+
48
+ - **A pi home that may have no provider now gets a warning at spawn and start.** pi starts with no provider, takes its prompt and shows no error, so the home read as running while nothing happened. oats.core 2.12.0 warns when pi finds no provider in the environment of the command, and names the fix: log in, set a provider's API key, or pin the soul to another harness. The warning never refuses a start, and a slow or failed check says nothing. The check sees the calling process's environment, not the pane's, so a pi folder (`PI_CODING_AGENT_DIR`) or key that only the launch or the pane has can warn on a pi that works.
@@ -0,0 +1,92 @@
1
+ # OATS 0.69.9
2
+
3
+ 0.69.9 moves the official catalog to three package releases: `oats.framework`
4
+ 1.19.0 (the setup expert attaches a person to a messaging account created for
5
+ the workspace), `oats.aweb` 1.33.1 (a workspace set up without a browser
6
+ sign-in, and setup no longer writes aw's rules into `AGENTS.md` or
7
+ `CLAUDE.md`) and `oats.engineering` 1.18.0 (a waiting agent sets a checkpoint,
8
+ so a stalled child no longer stalls it). Plain `oats status` shows how long a
9
+ needs-input claim has waited, and the Desktop says when an older Claude home
10
+ can't report its dialogs.
11
+
12
+ ## Upgrade
13
+
14
+ - **Either order of the Desktop and the CLI works.**
15
+ [Upgrading](../upgrading.md) installs the Desktop first, and a host that
16
+ installed the CLI first is fine too: the 0.69.9 Desktop accepts OATS CLIs
17
+ `>=0.26.0 <0.70.0`, and so does the 0.69.8 Desktop.
18
+ - **Package moves:** the official catalog pins oats.framework 1.19.0,
19
+ oats.aweb 1.33.1 and oats.engineering 1.18.0, with no change to their OATS
20
+ floors (oats.aweb keeps aw >=1.36.33). A deployment takes each by raising its
21
+ own pin (`/oats-package-pins`), then `oats sync`. Running instances keep the
22
+ modules they were spawned with: new spawns get the new ones, and a stopped
23
+ home moves with `oats instance upgrade`.
24
+ - **A stop doesn't hold while a checkpoint is pending.** With oats.engineering
25
+ 1.18.0, an instance stopped while it waits comes back when its checkpoint
26
+ fires, because a wake job starts a stopped home. To keep it stopped, run
27
+ `oats schedule disable <id>`, or retire it. A checkpoint fires only on a host
28
+ whose schedule timer is installed (`oats schedule host install`).
29
+ - **Joined teams on a Claude home are read at task boundaries.** With
30
+ oats.aweb 1.33.1, a Claude home takes no live wakes for its joined teams,
31
+ `--yolo` or not: an idle session reads that mail only once something else
32
+ wakes it. Its default team, and pi and Codex homes, are unchanged. If you
33
+ paused a home with `aw wake pause`, start it under this version before you
34
+ resume it. A Claude channel home then needs no resume, and a pi or Codex
35
+ home stays paused until you resume it.
36
+ - **A deployment set up by an earlier `oats aweb setup` may still carry aw's
37
+ rules** in `AGENTS.md` or `CLAUDE.md`. Nothing in OATS reads them; the
38
+ oats.aweb CHANGELOG (1.33.0) says how to remove them.
39
+
40
+ ## Changed
41
+
42
+ - **`oats.aweb` 1.33.1.** `oats aweb setup --username` creates a workspace's
43
+ account and team without a browser sign-in, and `/oats-aweb`'s new section
44
+ "attach yourself to the account" has the setup expert run `aw claim-human`
45
+ with the address the person gives; the account is theirs once they click the
46
+ link aw mails them. **On aweb Cloud today that link fails** for an account
47
+ that `--username` created ("Verification failed"): aweb's fix ships in its
48
+ next Cloud release. Until then, sign in to your own account instead, as
49
+ getting started in this release does. Setup's `aw init` no longer writes
50
+ aw's rules into the deployment. A shorter always-loaded inject, the approved route as the
51
+ guidance for unattended Claude homes, joined teams read at task boundaries on
52
+ Claude homes, and an opt-in attention flag for unread mail with a persisting
53
+ broker error (it needs aw's `mail inbox --count-only`) are in it too.
54
+ 1.33.1 makes `oats aweb invite` work on such a workspace and adds
55
+ `awebUrl`, the service to hand on, to its JSON answer; an aw pre-release
56
+ above the floor passes the provider's version checks
57
+ ([CHANGELOG](https://github.com/awebai/oats-aweb/blob/v1.33.1/CHANGELOG.md);
58
+ [awebai/oats#1665](https://github.com/awebai/oats/issues/1665)).
59
+
60
+ - **`oats.engineering` 1.18.0: a stalled child no longer stalls its waiter.**
61
+ Before a developer, expert or maintainer ends a turn to wait on a child, it
62
+ sets a checkpoint: a wake job on its own home, due when the result is
63
+ overdue. When it fires, the waiter inspects the child, then unblocks it or
64
+ asks it one precise question; a second overdue checkpoint with no movement
65
+ replaces the child. A waiter sets one only where `wakeHold` reads `on-claims`
66
+ or `not-exposed`, and otherwise hands the wait up. The package's own CI now
67
+ checks layer neutrality, and a reviewer reports a failure that stops its
68
+ round ([CHANGELOG](https://github.com/awebai/oats-engineering/blob/v1.18.0/CHANGELOG.md)).
69
+
70
+ - Plain `oats status` now shows when a running instance's needs-input claim
71
+ started, in the CLI machine's local time, and how long it has waited
72
+ (`under a minute`, minutes, hours or days). A start in the future shows
73
+ only its time; an unparseable start keeps the previous line without time.
74
+ JSON output is unchanged.
75
+
76
+ - **`oats.core` 2.12.1, in `oats.framework` 1.19.0:** `/oats-operate` gives the needs-input line that plain `oats status` prints from OATS 0.69.9, with when the claim started and how long it has waited.
77
+
78
+ - **`oats.framework` 1.19.0: the setup expert attaches the person to a messaging account created for the workspace.** `oats.onboarding` 1.1.0's `/oats-tailor-workspace` gains a normal step 3, before the deployment-agent step: when getting started created the workspace's account without the person's sign-in, the setup expert attaches the person through the messaging capability's own step (with aweb, `/oats-aweb`'s "attach yourself to the account", from the `oats.aweb` release that ships it), and skips it when the person signed in to their own account. When the answer waits on the person's email, the account is theirs only once they click its link, and a refusal leaves it unattached; the briefing reports which. Until it is theirs, the skill and `oats.setup` 2.10.1's `/oats-setup-expert` say the team is on an account created for the workspace, never that it is the person's ([awebai/oats#1665](https://github.com/awebai/oats/issues/1665)).
79
+
80
+ - **Getting started: a new workspace ends with the Desktop open on it and its setup expert running.** `oats-getting-started` now installs OATS, OATS Desktop and the messaging CLI first (`aw`, with no soul), then has the person sign in to their own aweb account in their browser (`aw auth login`) and creates the workspace's team with one call that installs its root in the deployment (`aw team ensure --workspace-key <host repo key> --label <workspace> --expect-account <account>`): the team is owned by their aweb account. It asks where the workspace lives (inside a monorepo, a dedicated private host, or a first new repository), writes the skeleton with the team id from that answer (one framework pin, no soul of its own, no `tasks:` default), spawns `oats.framework`'s `oats-setup-expert` with `oats onboard`'s `next.spawn` and opens the Desktop on the workspace with the setup expert selected (`--instance`; an older Desktop ignores it). It needs `oats.framework` 1.18.0 and stops on an older catalog. It also stops when Node is under 22, naming the minimum and the version found, and recommends Git 2.45 or later (older Git works, with whole-tree fetches); on Linux, x64 or arm64, it installs Node 22 from NodeSource and, on Ubuntu, Git from the git-core PPA. SSH, signing and the DCO sign-off leave the main path (`/oats-git-setup`, optional); GitHub stays where the flow needs it: the Desktop's download, the host repository and its push. Its messaging gate is the soul's messaging capability and its readiness, with aweb as the default ([awebai/oats#1665](https://github.com/awebai/oats/issues/1665)).
81
+
82
+ - **Getting started stops when this machine's messaging root is not a member of the workspace's team.** In step 9, when `oats aweb setup --check-only` answers `"member": false` for a new workspace whose team step 5 created, the skill spawns nothing and names the fix; a machine found-list's first check, before its signup, still goes on to it. With no root (`"root": null`), step 5's team creation did not finish in the deployment's `.aw`, and its line for an interrupted run continues it. With a root, the workspace file's team id is not step 5's `canonical_team_id`, so it is corrected, committed and synced. After a found-list signup or an invited join, it stops and reports what the check shows, without rerunning them ([awebai/oats#1665](https://github.com/awebai/oats/issues/1665)).
83
+
84
+ ## Fixed
85
+
86
+ - **Desktop explains when an older Claude home's questions and permission requests aren't reported
87
+ as needs input.** Its roster hover card and the instance panel's Session card say when its recorded
88
+ oats.core comes from oats.framework before 1.6.0 (oats.core 2.4.0), and the panel suggests upgrading
89
+ or respawning it to report those dialogs. The explanation clears when the home's recorded version
90
+ supports reporting. It works for local and remote rows; missing or unknown version evidence shows
91
+ nothing. The live "Needs input" marker is unchanged, and an agent's own attention claim can appear
92
+ alongside the dialog reporting explanation.
@@ -105,7 +105,9 @@ souls, and keeping its messages to other instances few and short:
105
105
  `oats.framework`). Workspaces give it to every soul through
106
106
  `defaults.capabilities: { oats.core: { from: package } }`; a soul may say
107
107
  `oats.core: off`. **`oats.setup`** (same package) carries the whole-architecture
108
- knowledge an onboarding expert needs, and **`oats.support`** (same package)
108
+ knowledge an onboarding expert needs, **`oats.onboarding`** (same package)
109
+ is how the package soul `oats-setup-expert` tailors a new workspace to its use
110
+ case, and **`oats.support`** (same package)
109
111
  is the support desk role: a publicly reachable soul that tickets requests and
110
112
  hands them to a support maintainer. None of them is kernel magic; the kernel still
111
113
  composes its own instance-boundary and work-mode briefings, and the "You run
package/docs/upgrading.md CHANGED
@@ -6,11 +6,11 @@ host that comes from it.
6
6
 
7
7
  ## Upgrading to the latest version
8
8
 
9
- The latest version is **OATS 0.69.7** ([release notes](release-notes/v0.69.7.md)).
10
- The 0.69.7 Desktop accepts OATS CLIs `>=0.26.0 <0.70.0`.
9
+ The latest version is **OATS 0.69.9** ([release notes](release-notes/v0.69.9.md)).
10
+ The 0.69.9 Desktop accepts OATS CLIs `>=0.26.0 <0.70.0`.
11
11
 
12
12
  **First, read the `## Upgrade` section of every release after yours, up to
13
- 0.69.7,** in the [release notes](release-notes/): it says what to do before
13
+ 0.69.9,** in the [release notes](release-notes/): it says what to do before
14
14
  the CLI changes, and what else must change with it (the Desktop, another
15
15
  tool, a package pin). [Coming from an older version](#coming-from-an-older-version)
16
16
  names the releases that ask for more than the steps below. `oats version`
@@ -19,8 +19,8 @@ prints the version you have.
19
19
  Then, on each host:
20
20
 
21
21
  ```sh
22
- # 0. where the Desktop is installed: Desktop 0.69.7 first
23
- npm install -g @awebai/oats@0.69.7 # 1. the CLI
22
+ # 0. where the Desktop is installed: Desktop 0.69.9 first
23
+ npm install -g @awebai/oats@0.69.9 # 1. the CLI
24
24
  oats update # 2. in each deployment: the plan, then it asks before it runs
25
25
  oats doctor # 3. in the same deployment
26
26
  ```
@@ -202,6 +202,13 @@ of the Desktop and the CLI, and an optional package pin. A change a script
202
202
  must follow is in its release's Upgrade section whether or not it is listed
203
203
  here.
204
204
 
205
+ - **[0.69.9](release-notes/v0.69.9.md#upgrade):** the catalog pins
206
+ oats.framework 1.19.0, oats.aweb 1.33.1 and oats.engineering 1.18.0. With
207
+ oats.engineering 1.18.0, a stop doesn't hold while a checkpoint is pending:
208
+ `oats schedule disable <id>` keeps it stopped. Claude homes read their
209
+ joined teams at task boundaries, so an idle one doesn't wake for that mail.
210
+ - **[0.69.8](release-notes/v0.69.8.md#upgrade):** the catalog pins
211
+ oats.framework 1.18.0.
205
212
  - **[0.69.7](release-notes/v0.69.7.md#upgrade):** the catalog pins
206
213
  oats.framework 1.17.0. This release is the bridge of
207
214
  [the move to the oats-project organisation](#the-move-to-the-oats-project-organisation):
@@ -54,7 +54,7 @@ members: # repo refs, NO @revision (E_WORKSPAC
54
54
  - git:github.com/acme/tools # a member that ALSO publishes a package (see below)
55
55
 
56
56
  packages: # the ONLY versioned things
57
- oats.framework: v1.17.0 # bare version → resolves through the official catalog
57
+ oats.framework: v1.19.0 # bare version → resolves through the official catalog
58
58
  oats.okf: v5.7.0
59
59
  acme.tools: git:github.com/acme/tools@v0.4.0 # outside the catalog → git:<repo>@<tag|OID>; still a package
60
60
 
package/lib/core.mjs CHANGED
@@ -99,7 +99,7 @@ import { lastConversation } from "../packages/record/lib/last-conversation.mjs";
99
99
  import { PKG_ROOT } from "./version.mjs";
100
100
  import { canonicalDeploymentPath } from "./deployment-path.mjs";
101
101
  import { INSTANCE_NAME_RE, RESERVED, capabilityAgentDirs, enclosingInstanceHome, findInstanceHomes, listAgents, logicalCwd, readSoul, soulOf, stripInternalAnnotations, withConfigFile, yamlKey } from "./soul-listing.mjs";
102
- import { RETIRE_BASELINE_VERSION, authorityMismatch, findRetirementBaseline, instanceSessionTarget, instancesRetirementRoot, isPlainObject, launchStateAgrees, missingSessionReceipt, readJsonOrUndefined, receiptHomeIdentity, receiptRecordsHome, recordsHerdr, refuseHerdrHome, retirementBaselinePath, runtimeAuthorityOf, tmuxEndpointAgrees } from "./session-inspect.mjs";
102
+ import { RETIRE_BASELINE_VERSION, authorityMismatch, findRetirementBaseline, inspectInstanceSession, instanceSessionTarget, instancesRetirementRoot, isPlainObject, launchStateAgrees, missingSessionReceipt, readJsonOrUndefined, receiptHomeIdentity, receiptRecordsHome, recordsHerdr, refuseHerdrHome, retirementBaselinePath, runtimeAuthorityOf, tmuxEndpointAgrees } from "./session-inspect.mjs";
103
103
  import { CLAIM_VERBS, DEFAULT_TMUX_SESSION, LAUNCH_RECIPE_VERSION, claimAction, defaultTmuxWindows, deferredRetireResultPath, directoryRollbackPath, hostProcesses, isCapturedHome, lookupOnPath, missingSocketUnestablished, namedProcesses, parseLaunchCommand, procReadable, processesWorkingIn, readHomeRecord, readRetirePending, redactLaunchCommand, redactLaunchRecipe, retireClaimPath, retirePendingMarkerPath, retireStateOf, subdirs, tmuxFailure, tmuxOn, tmuxServerAbsence, unreadableRecordSaid, upgradeHomeMeta, upgradeLaunchRecipe } from "./instance-listing.mjs";
104
104
  import { LAYERS, PACKAGE_ID_RE } from "./package-catalog.mjs";
105
105
  import { RESERVED_LAUNCH_ENV } from "./reserved-launch-env.mjs";
@@ -1376,8 +1376,8 @@ export function teamEnv(resolved) {
1376
1376
  OATS_WORKSPACE_NAME: typeof ws.name === "string" ? ws.name : "", OATS_WORKSPACE_KEY: typeof ws.key === "string" ? ws.key : "",
1377
1377
  };
1378
1378
  }
1379
- function withoutAmbientLaunchPreview(env) {
1380
- const { OATS_LAUNCH_PREVIEW: _ambient, OATS_HARNESS_EXECUTABLE: _inherited, ...rest } = env;
1379
+ function withoutAmbientHookFacts(env) {
1380
+ const { OATS_LAUNCH_PREVIEW: _ambient, OATS_HARNESS_EXECUTABLE: _inherited, OATS_SPAWNER_HOME: _spawner, ...rest } = env;
1381
1381
  return rest;
1382
1382
  }
1383
1383
  /** A hook's OATS_HARNESS_EXECUTABLE: what the kernel's pane-side selection found, as an absolute real
@@ -1407,7 +1407,9 @@ export function lifecycleHookEnv(event, cap, { home, instance, agentName, soulDi
1407
1407
  return {
1408
1408
  // OATS_LAUNCH_PREVIEW is the kernel's to give (prepareLaunchHooks), never
1409
1409
  // inherited: a real start's hook must not read an ambient one as a preview.
1410
- ...withoutAmbientLaunchPreview(process.env),
1410
+ // Nor are OATS_HARNESS_EXECUTABLE and OATS_SPAWNER_HOME (spawn's
1411
+ // callerSpawner): a hook started from inside an instance must not read its caller's.
1412
+ ...withoutAmbientHookFacts(process.env),
1411
1413
  // OATS_INSTANCE_HOME is the runtime-neutral contract name for the
1412
1414
  // instance home (absolute). OATS_HOME predates it and stays as a
1413
1415
  // compatibility alias: shipped capability hooks read it
@@ -2380,7 +2382,7 @@ function oatsTmuxWindows(session) {
2380
2382
  /** A launch's command followed by its exit marker (lib/session-end.mjs): the start id and the harness's
2381
2383
  * exit status, written when the harness ends, by spawn's window and start's alike. */
2382
2384
  const exitMarked = (command, startId, path) => `${command}; oats_start_status=$?; printf '{"startId":"%s","status":%d}\\n' ${shq(startId)} "$oats_start_status" > ${shq(path)}`;
2383
- const paneCommand = (command, removed = []) => `unset ${["COLORFGBG", "OATS_HARNESS_EXECUTABLE", ...removed].join(" ")}; ${command}; exec "\${SHELL:-/bin/zsh}"`;
2385
+ const paneCommand = (command, removed = []) => `unset ${["COLORFGBG", "OATS_HARNESS_EXECUTABLE", "OATS_SPAWNER_HOME", ...removed].join(" ")}; ${command}; exec "\${SHELL:-/bin/zsh}"`;
2384
2386
  /** The tail that marks the pane a launch creates (new-window: the new pane, tmux's current one after
2385
2387
  * it) or respawns (`paneId`) as the agent's (AGENT_PANE_OPTION), chained into the launch's own tmux
2386
2388
  * call. `-q`: a mark that cannot be set never fails the launch; readers then find the pane by id. */
@@ -3346,29 +3348,52 @@ export function spawnInstance(root, agent, o = {}) {
3346
3348
  function localMissingForSpawn(agent) {
3347
3349
  return oatsError("E_LOCAL_MISSING", `spawning ${agent?.name ?? "an instance"} needs a workspace deployment (oats-local.yaml, found walking up from the deployment): a soul's capabilities are the workspace's resolution, prepared before the spawn — \`oats onboard\` creates the deployment`);
3348
3350
  }
3349
- /** Informational caller attribution, never permission or lineage. Only consistent
3350
- * runtime identity evidence resolving to an extant home in this deployment counts;
3351
- * a stopped home still counts. Invalid evidence must not refuse a spawn. */
3351
+ /** Which instance runs this spawn, as its inherited identity (OATS_INSTANCE, OATS_INSTANCE_HOME) says:
3352
+ * `{ spawnOrigin, caller }`. Only consistent evidence resolving to an extant home of this deployment
3353
+ * (an immediate child of an instances/ directory of `root`) whose readable instance.json names it
3354
+ * counts: `spawnOrigin` "instance" and `caller` `{ instance, home }` (the canonical home); anything
3355
+ * else is "operator" and null. A stopped home still counts. Invalid evidence must not refuse a spawn.
3356
+ * `spawnOrigin` is informational attribution, never permission or lineage. `caller` is what
3357
+ * callerSpawner adds liveness to, and that one is not only informational: as OATS_SPAWNER_HOME it
3358
+ * selects who signs the new instance's identity (feature spawn-attribution). */
3352
3359
  function callerSpawnOrigin(root) {
3360
+ const operator = { spawnOrigin: "operator", caller: null };
3353
3361
  const name = process.env.OATS_INSTANCE, home = process.env.OATS_INSTANCE_HOME;
3354
- if (name === undefined && home === undefined) return "operator";
3362
+ if (name === undefined && home === undefined) return operator;
3355
3363
  try {
3356
- if (name !== undefined && !INSTANCE_NAME_RE.test(name)) return "operator";
3357
- if (home !== undefined && !isAbsolute(home)) return "operator";
3364
+ if (name !== undefined && !INSTANCE_NAME_RE.test(name)) return operator;
3365
+ if (home !== undefined && !isAbsolute(home)) return operator;
3358
3366
  let matches;
3359
3367
  if (home === undefined) {
3360
3368
  matches = findInstanceHomes(root, name);
3361
- if (matches.length !== 1) return "operator";
3369
+ if (matches.length !== 1) return operator;
3362
3370
  }
3363
3371
  const canonical = realpathSync(home ?? matches[0].home);
3364
3372
  // Name lookup's immediate-child check also applies to the agents root: an
3365
3373
  // instances/ directory symlinked to another deployment cannot qualify it.
3366
- if (basename(dirname(canonical)) !== "instances" || dirname(dirname(dirname(canonical))) !== realpathSync(root)) return "operator";
3374
+ if (basename(dirname(canonical)) !== "instances" || dirname(dirname(dirname(canonical))) !== realpathSync(root)) return operator;
3367
3375
  const record = readHomeRecord(canonical);
3368
- if (record.state !== "record" || record.meta.instance !== basename(canonical) || (name !== undefined && record.meta.instance !== name)) return "operator";
3376
+ if (record.state !== "record" || record.meta.instance !== basename(canonical) || (name !== undefined && record.meta.instance !== name)) return operator;
3369
3377
  matches ??= findInstanceHomes(root, record.meta.instance);
3370
- return matches.some((m) => realpathSync(m.home) === canonical) ? "instance" : "operator";
3371
- } catch { return "operator"; }
3378
+ return matches.some((m) => realpathSync(m.home) === canonical) ? { spawnOrigin: "instance", caller: { instance: record.meta.instance, home: canonical } } : operator;
3379
+ } catch { return operator; }
3380
+ }
3381
+ /** Feature spawn-attribution: `spawnedBy`, the instance whose session runs this spawn, `{ instance, home }`,
3382
+ * or null; a kernel fact apart from lineage (parentInstance, relation). It is callerSpawnOrigin's caller
3383
+ * unless the kernel's own liveness read (inspectInstanceSession, status's `running`) finds its session
3384
+ * gone: not running (a fallback shell, a dead or absent pane, a home never launched), or its tmux server
3385
+ * gone. A read that cannot tell (tmux unreadable, the session receipt unusable) keeps the spawner: as far
3386
+ * as anyone knows that instance runs this command, and reading it as a person's spawn would have the
3387
+ * deployment agent sign the child. Never a refusal. So spawnedBy non-null implies spawnOrigin "instance",
3388
+ * and "instance" with null means the session was found gone. It reads the environment only: a harness
3389
+ * that strips its session's environment reads as a person's spawn. */
3390
+ function callerSpawner(caller, io) {
3391
+ if (!caller) return null;
3392
+ try { return inspectInstanceSession(caller.home, { io }).running === false ? null : caller; }
3393
+ catch (e) {
3394
+ // inspectInstanceSession keeps the tmux failure as the cause of E_SESSION_UNAVAILABLE.
3395
+ return e?.code === "E_SESSION_UNAVAILABLE" && e.cause && sessionServerGone(caller.home, e.cause, io).gone ? null : caller;
3396
+ }
3372
3397
  }
3373
3398
  /** A soul name as a spawn names it, by shape only: a slug, after an optional `<package or member>/`
3374
3399
  * and an optional `<package>--` (lib/instance-naming.mjs soulRole reads its role from the same). */
@@ -3455,7 +3480,7 @@ function unconfirmedSpawn(error) {
3455
3480
  }
3456
3481
  function* spawnBody(root, agent, o = {}) {
3457
3482
  // Capture the caller before target scaffolding or hooks supply the new instance's identity.
3458
- const spawnOrigin = callerSpawnOrigin(root);
3483
+ const { spawnOrigin, caller } = callerSpawnOrigin(root), spawnedBy = callerSpawner(caller, o.io);
3459
3484
  if (!o.prepared) throw localMissingForSpawn(agent);
3460
3485
  const deliver = (r) => r;
3461
3486
  const work = o.work || agent.work || "checkout";
@@ -4395,7 +4420,7 @@ function* spawnBody(root, agent, o = {}) {
4395
4420
  const hookRes = runLifecycleHooks("spawn", {
4396
4421
  home, instance, agentName: agent.name, soulDir: homeSoulTarget, soulId: preparedSoulId, contextDir: repoAbs,
4397
4422
  workspaceDir: workspaceOf(root), rootDir: root, resolved: resolvedCfg,
4398
- extraEnv: { OATS_TASK: task, OATS_REPO: repoAbs, OATS_BRANCH: branch || "", OATS_WORK: work, OATS_HARNESS: harness, ...harnessExecutableHanded, OATS_RUNTIME: harness, OATS_KIND: agent.kind || "persistent", ...(triggerEventFile ? { OATS_TRIGGER_EVENT_FILE: triggerEventFile } : {}) },
4423
+ extraEnv: { OATS_TASK: task, OATS_REPO: repoAbs, OATS_BRANCH: branch || "", OATS_WORK: work, OATS_HARNESS: harness, ...harnessExecutableHanded, OATS_RUNTIME: harness, OATS_KIND: agent.kind || "persistent", ...(triggerEventFile ? { OATS_TRIGGER_EVENT_FILE: triggerEventFile } : {}), ...(spawnedBy ? { OATS_SPAWNER_HOME: spawnedBy.home } : {}) },
4399
4424
  });
4400
4425
  warnings.push(...hookRes.warnings);
4401
4426
  if (kernelNode().warning) warnings.push(kernelNode().warning);
@@ -4735,6 +4760,7 @@ ${task.trim() ? `\n## Task\n\n${task.trim()}\n` : "\nNo task was provided at spa
4735
4760
  relation: relation || undefined,
4736
4761
  relativeTo: relation ? relativeTo : undefined,
4737
4762
  spawnOrigin,
4763
+ spawnedBy,
4738
4764
  policy: { childSpawns: ownChildPolicy },
4739
4765
  ...(triggerEventFile ? { trigger: { id: o.triggerEvent.trigger, key: o.triggerEvent.key ?? null, source: o.triggerEvent.source, repo: o.triggerEvent.repo ?? null, number: o.triggerEvent.number ?? null, subject: o.triggerEvent.subject ?? null, url: o.triggerEvent.url ?? null, event: o.triggerEvent.event, headSha: o.triggerEvent.headSha ?? null, observedAt: o.triggerEvent.observedAt ?? null, eventFile: triggerEventFile,
4740
4766
  // A capability source's event carries its declared fields (a pull request's never does).
@@ -4942,7 +4968,7 @@ ${task.trim() ? `\n## Task\n\n${task.trim()}\n` : "\nNo task was provided at spa
4942
4968
  // retained prompt failures keep their lineage.
4943
4969
  commitParentLineage();
4944
4970
 
4945
- appendEvent(home, { kind: "spawned", data: { agent: agent.name, work, branch: branch ?? null, harness, model: model || null, parentInstance: meta.parentInstance ?? null, relation: relation ?? null, launched: launch, hooks: hookReceipt(hookRes), ...(worktreeRun ? { worktreeHooks: worktreeRun.receipt } : {}) } });
4971
+ appendEvent(home, { kind: "spawned", data: { agent: agent.name, work, branch: branch ?? null, harness, model: model || null, parentInstance: meta.parentInstance ?? null, relation: relation ?? null, spawnedBy, launched: launch, hooks: hookReceipt(hookRes), ...(worktreeRun ? { worktreeHooks: worktreeRun.receipt } : {}) } });
4946
4972
  if (launch) appendEvent(home, { kind: "launched", data: { harness, backend, launchConfig: launchConfig?.name ?? null } });
4947
4973
  if (unscoped) appendEvent(home, { kind: "launch-warning", data: { message: unscoped } });
4948
4974
  if (o.idempotencyKey !== undefined) {
@@ -8,7 +8,7 @@ import { readFileSync, readdirSync, lstatSync, existsSync, statSync, openSync, c
8
8
  import { join, dirname, resolve, basename } from "node:path";
9
9
  import { noteRuntimeName } from "./deprecation.mjs";
10
10
  import { createSessionPaneInspector, AGENT_PANE_OPTION } from "./session-input.mjs";
11
- import { liveWaiting } from "./instance-events.mjs";
11
+ import { liveWaiting, validWaitingMessage } from "./instance-events.mjs";
12
12
  import { processLiveness } from "./worktree-hooks.mjs";
13
13
  import { shownHolder } from "./claim.mjs";
14
14
  import { isInstant as isInstantString, readRetireState } from "./retire-state.mjs";
@@ -16,6 +16,7 @@ import { herdrInstanceRemoved, oatsError } from "./errors.mjs";
16
16
  import { readInstanceColor } from "./instance-color.mjs";
17
17
  import { readInstanceBackground } from "./instance-background.mjs";
18
18
  import { sameWorkOf } from "./instance-same-work.mjs";
19
+ import { readSpawnedBy } from "./spawned-by.mjs";
19
20
  import { sessionEndOf } from "./session-end.mjs";
20
21
  import { recordSeen } from "./session-seen.mjs";
21
22
  import { listAgents, capabilityAgentDirs } from "./soul-listing.mjs";
@@ -199,6 +200,32 @@ export function servedIdentityOf(meta) {
199
200
  return pick(messaging) ?? pick(Object.keys(cm));
200
201
  }
201
202
 
203
+ const ATTRIBUTION_MODES = new Set(["human", "none", "unknown"]);
204
+ const opaqueId = (v) => typeof v === "string" && v.length > 0;
205
+ /** Feature spawn-attribution: the label of the human an instance's served identity is attributed to,
206
+ * or null. Read by slot, never by name: only the `identity` that a capability whose captured layer is
207
+ * "messaging" recorded counts, never servedIdentityOf's fallback to any capability, so no other
208
+ * capability can name a human on a row. Its optional `attribution` is the capability's,
209
+ * `{ mode: "human"|"none"|"unknown", human: { id, label }|null, parent: { id }|null }` (an omitted
210
+ * `human` or `parent` is null), opaque strings the kernel never interprets; only mode "human" names one.
211
+ * The label is untrusted text: a waiting claim's message rule (validWaitingMessage), else null. A
212
+ * malformed attribution reads as absent: null. It reports; no kernel decision reads it. */
213
+ export function attributedHumanOf(meta) {
214
+ const cm = meta?.capabilityMeta;
215
+ if (!isPlainObject(cm) || !Array.isArray(meta.capabilityRuntime)) return null;
216
+ for (const { id } of meta.capabilityRuntime.filter((c) => c && c.layer === "messaging")) {
217
+ const identity = cm[id]?.identity;
218
+ if (!isPlainObject(identity)) continue;
219
+ const a = identity.attribution;
220
+ if (!isPlainObject(a) || !ATTRIBUTION_MODES.has(a.mode)) return null;
221
+ const human = a.human ?? null, parent = a.parent ?? null;
222
+ if (human !== null && !(isPlainObject(human) && opaqueId(human.id) && typeof human.label === "string")) return null;
223
+ if (parent !== null && !(isPlainObject(parent) && opaqueId(parent.id))) return null;
224
+ return a.mode === "human" && human && validWaitingMessage(human.label) ? human.label : null;
225
+ }
226
+ return null;
227
+ }
228
+
202
229
  /** The window names of `session` on the tmux server at `socket`: `{ windows }`, empty when the server
203
230
  * or the session is gone, with `missingSocket` (tmux's words) when the socket file is missing, which
204
231
  * alone does not say the server is gone (#624); `{ error }` when the server could not be read. */
@@ -321,7 +348,7 @@ export function listInstances(root, tmuxSession = DEFAULT_TMUX_SESSION, io, { re
321
348
  // messaging identity's address (or alias) its capability recorded, null otherwise; `modelFrom` — null
322
349
  // for a home spawned before it was recorded.
323
350
  const lastStart = Array.isArray(meta.restarts) && meta.restarts.length ? meta.restarts[meta.restarts.length - 1]?.startedAt ?? null : null;
324
- const facts = { startedAt: lastStart ?? (meta.launched ? meta.createdAt ?? null : null), identityAddress: identity ? identity.address ?? identity.alias ?? null : null, modelFrom: meta.modelFrom ?? null };
351
+ const facts = { startedAt: lastStart ?? (meta.launched ? meta.createdAt ?? null : null), identityAddress: identity ? identity.address ?? identity.alias ?? null : null, modelFrom: meta.modelFrom ?? null, attributedHuman: attributedHumanOf(meta) };
325
352
  // The home IS the directory enumerated here, and the instance its name:
326
353
  // a file inside it cannot relocate or rename itself in the roster (every
327
354
  // consumer acting on `home` — retire, inspect --home, the Desktop's file
@@ -344,6 +371,9 @@ export function listInstances(root, tmuxSession = DEFAULT_TMUX_SESSION, io, { re
344
371
  // `retire` is only ever the value read above, and `background` and `sameWork` the home's own records
345
372
  // (below): a record that carries any of them (hand-edited, or copied from a row) never stands in for it.
346
373
  const { retire: _recordedRetire, background: _recordedBackground, sameWork: _recordedSameWork, ...recorded } = meta;
374
+ // `spawnedBy` (feature spawn-attribution) is the record's own, read in place by its rule (lib/spawned-by.mjs):
375
+ // a malformed one is null, and a home spawned before the feature has no key.
376
+ if (Object.hasOwn(recorded, "spawnedBy")) recorded.spawnedBy = readSpawnedBy(recorded.spawnedBy);
347
377
  // Feature session-resume: how the last session of a launched home that does not run ended
348
378
  // (lib/session-end.mjs): lost, stopped or exited. Absent while it runs or reads unknown, for a
349
379
  // home never launched, and for one being set up, retired or quarantined.
@@ -5,6 +5,6 @@
5
5
  * (test/cli-json-contract.test.mjs). Kernel-private, not exported from `./core`. Dependency-free. */
6
6
  import { SESSION_RESUME_FEATURE } from "./session-resume-contract.mjs";
7
7
 
8
- export const KERNEL_FEATURES = Object.freeze(["retire-home", "session-start", "session-restart", "launch-config", "schedule", "schedule-host-caps", "session-upload", "operations", "instance-git", "instance-git-remote", "souls-declarations", "lifecycle-plans", "retire-retention", "readiness", "spawn-preview", "instance-events", "instance-events-2", "schedule-history", "schedule-read-2", "spawn-preview-2", "spawn-idempotency", "spawn-idempotency-2", "spawn-apply-2", "workspace-v2", "instance-modules", "spawn-provider-payload", "served-identity", "packages-no-approval", "spawn-name", "settings-origins", "team-model-3", "settings-declared", "capabilities-private", "layers-from", "harness", "package-souls", "triggers", "automations", "desktop-facts", "launch-preference", "preview-composed-from", "observe-max-age", "spawn-preview-max-age", "launch-config-default", "capability-show", "capture-file", "workspace-identity", "server-connect", "capability-route", "servers-per-workspace", "operator-default-soul", "waiting-on-you", "automation-descriptions", "souls-capabilities", "soul-composed-instructions", "teams-conditional-default", "server-probe-features", "worktree-event", "trigger-sources", "session-attach-detach-key", "lifecycle-kernel-codes", "schedule-run-warnings", "lifecycle-claim-stop", "launch-prompt-dev-channel", "soul-launch", "retire-plan-own-worktree", "spawn-kernel-codes", "soul-skills", "roster-workspace-key", "spawn-apply-max-age", "status-retire-state", "session-inspect-size", "session-inspect-running", "deployments-list", "soul-composed-skills", "instance-color", "spawn-suggest-name", "instance-upgrade", "session-attach-no-status-line", "session-attach-prefix-scroll", "instance-suggest-name", "spawn-apply-suggest-name", SESSION_RESUME_FEATURE, "instance-background", "instance-same-work", "warm-reader", "status-liveness", "lifecycle-claim-start", "wake-hold"]);
8
+ export const KERNEL_FEATURES = Object.freeze(["retire-home", "session-start", "session-restart", "launch-config", "schedule", "schedule-host-caps", "session-upload", "operations", "instance-git", "instance-git-remote", "souls-declarations", "lifecycle-plans", "retire-retention", "readiness", "spawn-preview", "instance-events", "instance-events-2", "schedule-history", "schedule-read-2", "spawn-preview-2", "spawn-idempotency", "spawn-idempotency-2", "spawn-apply-2", "workspace-v2", "instance-modules", "spawn-provider-payload", "served-identity", "packages-no-approval", "spawn-name", "settings-origins", "team-model-3", "settings-declared", "capabilities-private", "layers-from", "harness", "package-souls", "triggers", "automations", "desktop-facts", "launch-preference", "preview-composed-from", "observe-max-age", "spawn-preview-max-age", "launch-config-default", "capability-show", "capture-file", "workspace-identity", "server-connect", "capability-route", "servers-per-workspace", "operator-default-soul", "waiting-on-you", "automation-descriptions", "souls-capabilities", "soul-composed-instructions", "teams-conditional-default", "server-probe-features", "worktree-event", "trigger-sources", "session-attach-detach-key", "lifecycle-kernel-codes", "schedule-run-warnings", "lifecycle-claim-stop", "launch-prompt-dev-channel", "soul-launch", "retire-plan-own-worktree", "spawn-kernel-codes", "soul-skills", "roster-workspace-key", "spawn-apply-max-age", "status-retire-state", "session-inspect-size", "session-inspect-running", "deployments-list", "soul-composed-skills", "instance-color", "spawn-suggest-name", "instance-upgrade", "session-attach-no-status-line", "session-attach-prefix-scroll", "instance-suggest-name", "spawn-apply-suggest-name", SESSION_RESUME_FEATURE, "instance-background", "instance-same-work", "warm-reader", "status-liveness", "lifecycle-claim-start", "wake-hold", "spawn-attribution"]);
9
9
  /** The warm reader's protocol (`oats reader --stdio`, lib/reader.mjs): `readerApi` in the probe and in the reader's hello. */
10
10
  export const READER_API = 1;
@@ -8,6 +8,8 @@
8
8
  export const RESERVED_LAUNCH_ENV = new Set(["OATS_INSTANCE", "OATS_INSTANCE_HOME", "OATS_HOME", "OATS_AGENT", "OATS_SOUL", "OATS_SOUL_ID", "OATS_ROOT", "OATS_CONTEXT", "OATS_WORKSPACE", "OATS_EVENT", "OATS_SETTINGS", "OATS_SETTINGS_ORIGINS", "OATS_CLI_BIN", "OATS_NODE_BIN", "PI_AGENT_INSTANCE", "PI_AGENT_HOME", "PI_AGENTS_ROOT",
9
9
  // What a spawn or launch hook is handed (#1667): the kernel's lookup, never a launch's to set.
10
10
  "OATS_HARNESS_EXECUTABLE",
11
+ // The spawner a spawn hook is handed (feature spawn-attribution): the kernel's validation, never a launch's to set.
12
+ "OATS_SPAWNER_HOME",
11
13
  // The test seam that replaces the login shell (lib/login-environment.mjs): never a launch's to set.
12
14
  "OATS_TEST_LOGIN_SHELL",
13
15
  // The test seams of #796, the same: a worktree hook's fixed timeout, the fetch timeout of
package/lib/servers.mjs CHANGED
@@ -23,10 +23,11 @@ import { homedir } from "node:os";
23
23
  import { basename, join, resolve } from "node:path";
24
24
  import { parseStrictJson } from "./canonical-json.mjs";
25
25
  import { noteRuntimeName } from "./deprecation.mjs";
26
- import { readWaitingClaim } from "./instance-events.mjs";
26
+ import { readWaitingClaim, validWaitingMessage } from "./instance-events.mjs";
27
27
  import { readRetireState } from "./retire-state.mjs";
28
28
  import { SESSION_END } from "./session-resume-contract.mjs";
29
29
  import { paletteColor } from "./instance-color.mjs";
30
+ import { readSpawnedBy } from "./spawned-by.mjs";
30
31
  import { withDirLock } from "./dir-lock.mjs";
31
32
  import { shellWord } from "./shell-word.mjs";
32
33
  import { DETACH_KEY_FEATURE, requireDetachKey } from "./session-viewer.mjs";
@@ -886,10 +887,13 @@ function listSnapshotServers() {
886
887
  * record (`repo` is a path on the host, never read here); `soul` and `modules`
887
888
  * carry the host's drift observation against its own members and lock, not
888
889
  * recomputed here (#675). */
889
- export const REMOTE_ROW_FACTS = ["identity", "identityAddress", "teams", "startedAt", "createdAt", "model", "runtimeState", "parentInstance", "siblingInstance", "relation", "relativeTo", "spawnOrigin", "work", "repo", "branch", "modelFrom", "soul", "modules", "color"];
890
+ export const REMOTE_ROW_FACTS = ["identity", "identityAddress", "teams", "startedAt", "createdAt", "model", "runtimeState", "parentInstance", "siblingInstance", "relation", "relativeTo", "spawnOrigin", "work", "repo", "branch", "modelFrom", "soul", "modules", "color", "attributedHuman", "spawnedBy"];
890
891
  /** Each fact as the host answered it, null when it did not; `color` (feature instance-color) only as a palette
891
- * name (lib/instance-color.mjs paletteColor), anything else null. */
892
- const rowFacts = (i = {}) => Object.fromEntries(REMOTE_ROW_FACTS.map((k) => [k, k === "color" ? paletteColor(i[k]) : i[k] ?? null]));
892
+ * name (lib/instance-color.mjs paletteColor), and (feature spawn-attribution) `attributedHuman` only as a
893
+ * label the local row's rule admits (validWaitingMessage) and `spawnedBy` only as the local row's reader
894
+ * takes it (lib/spawned-by.mjs), anything else null. */
895
+ const remoteFact = { color: paletteColor, attributedHuman: (v) => (validWaitingMessage(v) ? v : null), spawnedBy: readSpawnedBy };
896
+ const rowFacts = (i = {}) => Object.fromEntries(REMOTE_ROW_FACTS.map((k) => [k, remoteFact[k] ? remoteFact[k](i[k]) : i[k] ?? null]));
893
897
  /** `waitingOnYou` (feature waiting-on-you) is relayed ONLY when the host's row has the
894
898
  * key, so it is not one of REMOTE_ROW_FACTS: a host whose kernel predates the feature
895
899
  * omits it, and absent ("not reported") must stay distinct from null ("no claim"). The
@@ -0,0 +1,18 @@
1
+ /** `spawnedBy` as a status row shows it (feature spawn-attribution, awebai/oats#1665): the spawner a spawn
2
+ * recorded in instance.json, `{ instance, home }`, read by one rule for a local row (lib/instance-listing.mjs)
3
+ * and a remote one (lib/servers.mjs REMOTE_ROW_FACTS). Dependency-free, so the remote status read loads
4
+ * nothing more for it. */
5
+ import { isAbsolute } from "node:path";
6
+
7
+ /** The instance-name grammar (lib/soul-listing.mjs INSTANCE_NAME_RE). */
8
+ const INSTANCE_NAME = /^[a-z0-9][a-z0-9-]*$/;
9
+
10
+ /** `{ instance, home }` when `value` is exactly that: an instance-name slug and an absolute path, and no
11
+ * other key. Anything else (a hand-edited record, a remote host's answer) is null, never an error. */
12
+ export function readSpawnedBy(value) {
13
+ if (!value || typeof value !== "object" || Array.isArray(value)) return null;
14
+ const keys = Object.keys(value);
15
+ if (keys.length !== 2 || !keys.includes("instance") || !keys.includes("home")) return null;
16
+ const { instance, home } = value;
17
+ return typeof instance === "string" && INSTANCE_NAME.test(instance) && typeof home === "string" && isAbsolute(home) ? { instance, home } : null;
18
+ }
@@ -18,6 +18,38 @@ export const livenessWord = (i) => i.running === true ? "RUNNING" : i.running ==
18
18
  /** A row's word: a retire under way wins over its liveness. */
19
19
  export const statusWord = (i) => i.retirePending ? "RETIRING" : livenessWord(i);
20
20
 
21
+ const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
22
+
23
+ /** Plain status's claim line, or null unless running. The clock defaults to the CLI machine's
24
+ * timezone; explicit `now` and `timeZone` keep calendar-boundary tests independent of the host.
25
+ * Elapsed words match the client's waitedText without a dependency on packages/client. */
26
+ export function waitingLine(i, { now = Date.now(), timeZone } = {}) {
27
+ if (i.running !== true || !i.waitingOnYou) return null;
28
+ const claim = i.waitingOnYou, since = Date.parse(claim.since);
29
+ let timing = "";
30
+ if (Number.isFinite(since)) {
31
+ const clock = new Intl.DateTimeFormat("en-US", {
32
+ timeZone, year: "numeric", month: "2-digit", day: "numeric",
33
+ hour: "2-digit", minute: "2-digit", hourCycle: "h23",
34
+ });
35
+ const parts = (at) => Object.fromEntries(clock.formatToParts(at).map(p => [p.type, p.value]));
36
+ const at = parts(since), today = parts(now);
37
+ const time = `${at.hour}:${at.minute}`;
38
+ let start = time;
39
+ if (at.year !== today.year) {
40
+ start = `${at.year.padStart(4, "0")}-${at.month}-${at.day.padStart(2, "0")} ${time}`;
41
+ } else if (at.month !== today.month || at.day !== today.day) start = `${MONTHS[Number(at.month) - 1]} ${at.day} ${time}`;
42
+ timing = ` since ${start}`;
43
+ const ms = now - since;
44
+ if (ms >= 0) {
45
+ const min = Math.floor(ms / 60000), h = Math.floor(min / 60);
46
+ const elapsed = min < 1 ? "under a minute" : min < 60 ? `${min} min` : h < 24 ? `${h} h` : `${Math.floor(h / 24)} d`;
47
+ timing += `, ${elapsed}`;
48
+ }
49
+ }
50
+ return `! needs input (${claim.reason ?? "unknown"})${timing}${claim.message ? `: ${claim.message}` : ""}`;
51
+ }
52
+
21
53
  /** The one line under a LOST row that says how to bring it back, or null for any other row. Local:
22
54
  * the resume by hand, or the next sweep. `host` (a `--server` or roster row): both refuse `--server`
23
55
  * (E_BAD_ARGS), so the line says to run them on that host. */
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "oats.aweb": {
10
10
  "url": "https://github.com/awebai/oats-aweb.git",
11
- "ref": "v1.32.1",
11
+ "ref": "v1.33.1",
12
12
  "path": "oats-package"
13
13
  },
14
14
  "oats.jira": {
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "oats.engineering": {
30
30
  "url": "https://github.com/awebai/oats-engineering.git",
31
- "ref": "v1.17.2",
31
+ "ref": "v1.18.0",
32
32
  "path": "oats-package"
33
33
  },
34
34
  "oats.cloning": {
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "oats.framework": {
50
50
  "url": "https://github.com/awebai/oats.git",
51
- "ref": "oats-framework/v1.17.0",
51
+ "ref": "oats-framework/v1.19.0",
52
52
  "path": "oats-package"
53
53
  }
54
54
  },
@@ -76,6 +76,7 @@
76
76
  "oats.knowledge-theory": "oats.framework",
77
77
  "oats.core": "oats.framework",
78
78
  "oats.setup": "oats.framework",
79
+ "oats.onboarding": "oats.framework",
79
80
  "oats.okf-harvest": "oats.okf",
80
81
  "oats.okf-maintenance": "oats.okf",
81
82
  "oats.aweb-tasks": "oats.aweb",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@awebai/oats",
3
- "version": "0.69.7",
3
+ "version": "0.69.9",
4
4
  "description": "OATS (Open Agent Team Specification) — durable souls, disposable instances, targetable capability packages, and the runtime-neutral oats CLI/kernel.",
5
5
  "keywords": [
6
6
  "agents",