Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/a-question-says-what-it-is-for.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@fnndsc/menu": minor
"@fnndsc/brasa": patch
"@fnndsc/stratus": patch
"@fnndsc/argus": patch
---

A teardown asks its name typed back, and a cluster build wears YES · BILL, by what the question is for, not its words.

Rewording a stratus question no longer changes how a screen offers its answer. `vm teardown`, `net build`, `net teardown`, `cluster teardown` and the three questions of `cluster build` (what it makes before billing, resuming a billing build, starting billing) each carry a purpose and the name of what they act on; `repl_question` takes the same `about` its siblings take. `STRATUS_PROMPTS` in `@fnndsc/menu` says what a yes to each does (destroys, bills, acts) and which name is typed back; the script screen's strip and the TD controller's read it, and their patterns over the words are gone. A network built now reads in the plain tone (nothing a network is made of bills), and the question that makes a cluster's free things before billing reads YES, not YES · BILL.
9 changes: 9 additions & 0 deletions .changeset/a-read-session-holds-what-the-engine-refuses.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@fnndsc/menu": minor
"@fnndsc/stratus": patch
"@fnndsc/argus": patch
---

A READ session holds exactly what the engine refuses: `vm keep` and `chris plugin sync` no longer stand as if they ran.

Which stratus lines act outside this host was said twice: by a pattern in ARGUS and by a check inside each verb, and the two had drifted. Both now read one list in `@fnndsc/menu`, `STRATUS_ACTING_VERBS`, with `stratusLine_acts`. Each stratus verb that refuses in READ asks `tierRefusal_get` by its name in that list, so a verb missing from it does not compile; the refusal reads as before.
14 changes: 14 additions & 0 deletions .changeset/read-refuses-before-it-writes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@fnndsc/menu": minor
"@fnndsc/brasa": patch
"@fnndsc/stratus": patch
"@fnndsc/argus": patch
---

A first cluster build in READ is refused before it asks or writes anything; the password door is the same on every screen.

`cluster build` in a READ session now refuses before its first question: nothing is accepted, no lock is kept in the tenancy and no account is asked for (a build already running is still followed). The page's own password control for raising a session, in its own words, now stands on the script screen, the TD controller and the console as it did on the VM controller; a hidden question from the session never takes its form, and a `stratus oci manage` relayed from a shell elsewhere is refused with a note instead of asking here. `chris deploy … --plan` and `play … --status` no longer count as acting, and lines are read by the engine's own word splitting, quotes and all (`STRATUS_READ_FORMS`, `stratusActingVerb_find`). The host-settings-only `vm build` question carries its own purpose (`stratus.vm.build.host`, nothing bills), and `rm -i` asks as a removal (`fs.rm`), so a screen draws it as destroying. `stratusPrompt_get` is now `promptEffect_get`.

Second review: in READ a `cluster build` on a build already running only watches it (no account asked or kept, no billing recorded, nothing started or resumed). A desktop loaded or a view replayed by a relayed line stays relayed, and a relayed `stratus oci manage` refusal reaches the shell as a failure. With the terminal console and no takeover, the door stands on a sheet over the stage, the console drawer opened. `play … --dry-run` stands in READ like `--status`.

Third review: the question sheet over the stage has one owner, so a question it displaces is settled as cancelled, never left waiting; and a relayed line's status comes from its run (a refused MANAGE stops a desktop's replay there and fails the load), never from matching its words.
9 changes: 9 additions & 0 deletions .changeset/share-offers-the-groups-you-belong-to.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@fnndsc/menu": minor
"@fnndsc/brasa": patch
"@fnndsc/argus": patch
---

SHARE offers the CUBE groups you belong to, read from `id`, and never the group named after you that `id` only projects.

ARGUS read the groups to offer by running `cat /etc/group` and parsing its text. It now runs `id` and reads its model through `posixIdentityModelSchema`; text alone, or a model that fails the schema, offers no group. `id`'s model gains `memberships`, the CUBE groups alone, beside the printed `groups` list, which still starts with the projected primary group. A real CUBE group that happens to bear your name is offered; with no memberships, SHARE offers EVERYONE and a name to type.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@fnndsc/argus": patch
---

The password field that raises a READ session answers only ARGUS's own question, never one the session sends.

The VM screen drew its door (YOUR PASSWORD, TO …) for any hidden question whose words began `MANAGE · your password, for:`, so a session could ask for the password in the door's own dress. The question ARGUS asks to raise a session is now marked where it is made (`raiseAsk_make`), and the mark travels with that question while it is held for a screen that is away and stands again; a question from the session, whatever its words, purpose or subject, is a plain hidden question. The TD controller now carries a question's purpose and subject through to its strip.
1 change: 1 addition & 0 deletions apps/argus/docs/aegis.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ AEGIS — the *ARGUS Ergonomics & Graphical Interface Standard* — is the desig

[cols="1,3"]
|===
| 2026-12-02 (a question is read by what it is for, and the door is ARGUS's own) | The security plan's stage S found ARGUS reading its questions' words for state. The VM screen drew its door (YOUR PASSWORD, TO …) for any hidden question whose words began `MANAGE · your password, for:`, its own or one the session sent; the door is now drawn only for the question ARGUS asked to raise the session, marked where it is made (`raiseAsk_make` in `app/lineRun.ts`, `AskAbout.raise`), and the mark travels with that question while it is held for a screen away; a session's question in the same words and naming the same purpose is a plain hidden question. A teardown's name field, and the strip's destroying and billing tones on the script screen and the TD controller, now follow the question's purpose through `STRATUS_PROMPTS` (`@fnndsc/menu`), never its words: a reworded teardown still asks its name, an unnamed question that says "type its name" offers plain text, `net build` reads plain (nothing a network is made of bills), and of a cluster build's three questions only resuming and starting billing wear YES · BILL. A READ session holds the controls of `STRATUS_ACTING_VERBS`, the list the engine's refusals read, so `vm keep` and `chris plugin sync` are held as the engine refuses them. SHARE offers the CUBE groups `id` names as memberships, never the group it projects from the user, and reads no `/etc/group` text. Review of the first cut (2026-12-03): the door (takeover/raise.ts, its words the page's alone) now stands on the script screen, the TD controller and the console too, where the raise had been drawn as an ordinary hidden field; a `stratus oci manage` relayed from a shell elsewhere is refused here with a note; `chris deploy … --plan` and `play … --status` stand in READ (the engine answers them at any tier), and lines are read by the engine's own word splitting; a machine's host-settings-only build reads plain (`stratus.vm.build.host`), and `rm -i` keeps its destroying control by its purpose (`fs.rm`).
| 2026-11-28 (a surface runs on its own machine only what a line it sent asked for) | The code audit (#1541) found that a daemon a chell is attached to could ask that chell to run any host command, pipeline segment or editor at any time, and chell ran it on the person's own machine. Now each such request names the line that asked (`lineId`, the surface's own id for it), and chell runs it only against what that line asked for, read from the line by the engine's own routing before it was sent (`lineHostOperations_read`: a `!` line its command, a later non-builtin pipeline segment its exact text, grep's and `command`'s delegated host lines, an `edit <file>` line one edit of that file), each grant once, retired with the line, a cancel or the connection's close. A request with no line, for another line or connection, or for anything else runs nothing. A line whose host operations cannot be read from it alone (a list, a capture, a redirect, a background line, a reference or a pattern the engine expands) grants nothing. The daemon refuses at its own side a host command or pipeline segment that would go to another surface than the one that sent the line (a browser holding a terminal's line); a browser's edit for a terminal's line keeps its own route. What no grant covers is put to the person on the chell's own terminal (`y` once, `l` the rest of the line for that kind, `r` refuse the rest, `allow all` the connection), never run silently and never refused silently where they could be asked; `--allow-host-requests` gives the connection that permission from the start (operator, 2026-11-28: full functionality when the person explicitly authorizes it). The terminal has one holder at a time (a question, a host command, the editor, a handed-over program, the session's own prompt); a question is put only on a free terminal and never answered by what was typed before it, the session's output is shown after it, `l` for a file written here covers only its place and source, and a connection that holds standing permission says so at the start of every prompt. A surface does not shadow the session: the engine's routing is the one source, and the browser's own routes are unchanged.
| 2026-11-28 (a session starts no program on its host, and reads none of its files, unless its operator said so) | The code audit (#1541) found three ways a line typed at any surface reached the host its session runs on with no grant: `plugin add` of an image ran docker there, `--ssh-key-file` read a key file there (and said whether it existed), and `cluster adopt --from` read a checkout there, its secrets included. A new capability, `engineProcesses`, says whether the engine may start programs on its own host: true for a person's own local shell, and for a daemon only when its operator granted the `shell` tier; nothing an attached surface declares raises it, the `pipes` or `tasks` tier alone does not. `plugin add` gives salsa a docker runner only then (salsa starts none on its own; chili's own command line trusts docker for its process), and otherwise answers `plugin add from an image (docker): this session may not start programs on its host; start the session with --host-control=shell`. `--ssh-key-file` and `cluster adopt --from` ask `hostDisk_refusal` before the path is touched, so the refusal reads the same whether the file is there or not. The same grant is asked by every other program the engine would start on its host: git for `scripts add` and `pull` (a session without it still lists and plays scripts already there, and shows no head), ssh for `vm shell`, and the renderer and browser of chili's delegated lines. The three refusals live in one place (`brasa/src/core/hostGate.ts`), and a lint (`lint:hostgate`) holds every engine source that imports `fs` or `child_process` to a listed reason, the list to the PR's base, and the gate calls to pins. |
| 2026-11-27 (a page attaches before it wires) | A code audit (#1541) found the page wiring every listener and timer before it attached, so a refused token left it wired; 4.4a made the next attempt reload the page to avoid wiring it twice. The page now attaches first: the socket is opened and acknowledged before anything is wired, what the session says meanwhile is held with that socket, and it is handed over in order once every handler is in place. A refused token wires nothing, and the form takes the next attempt in place, with no reload. A session that goes away, or wiring that fails, after the acknowledgement announces nothing as ready and drops what was held; only then is the next attempt a fresh page's.
Expand Down
45 changes: 25 additions & 20 deletions apps/argus/src/app/access.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/**
* @file A feed's name and who it is shared with, as the host wires them.
*
* SHARE asks with the CUBE groups the operator belongs to and EVERYONE as
* SHARE asks with the CUBE groups the operator belongs to (as `id`'s model
* names them, never the group `id` projects from the user) and EVERYONE as
* pills, the ones that already hold dimmed, and a field for a user's name;
* it asks again after each pick until DONE. The holders of a feed — each
* user, each group, and PUBLIC when it is — are marks on the indicated row,
Expand All @@ -13,7 +14,8 @@
* user and what to refresh once something changed.
*/
import type { WireEnvelope } from '@fnndsc/menu';
import { arg_quote } from '@fnndsc/menu';
import { arg_quote, POSIX_IDENTITY_MODEL_KIND, posixIdentityModelSchema, type PosixGroup } from '@fnndsc/menu';

import type { ExecuteOutcome } from '../calypso/client.js';
import type { PaneAskChoice, PaneAskRequest } from '../features/ask/paneAsk.js';
import { saveLine_compose } from '../features/edit/line.js';
Expand All @@ -33,8 +35,6 @@ export type FeedHolder = { kind: 'user' | 'group'; name: string } | { kind: 'pub
/** What the access verbs ask of the host. */
export interface AccessHooks {
askOnPane_await: (id: string, request: PaneAskRequest) => Promise<string | null>;
/** The session's user, for the groups they belong to; null before the prompt names one. */
promptUser: () => string | null;
/** A feed's access or name changed: whatever shows it reads it again. */
changed: (feedId: number) => void;
}
Expand Down Expand Up @@ -68,18 +68,26 @@ export function holders_extract(outcome: ExecuteOutcome): FeedHolders | null {
}

/**
* The groups a user belongs to, from `/etc/group`'s text (`name:x:gid:members`).
* The CUBE groups the session's user belongs to, from `id`'s model read by
* its schema: its `memberships`, never the primary group `id` projects from
* the user (CUBE has no such group to share with). A model that fails the
* schema, or none, yields no group: printed text is never read.
*
* @param outcome - What `id` returned.
* @returns The groups' names, in `id`'s order.
*
* @param text - The file.
* @param user - The user.
* @returns The groups' names, in the file's order.
* @example
* ```ts
* memberships_extract(await client.line_execute('id', quiet)); // ['pacs', 'research']
* ```
*/
export function groupsOf_user(text: string, user: string): string[] {
return text.split('\n')
.map((line: string): string[] => line.trim().split(':'))
.filter((parts: string[]): boolean => parts.length >= 4 && (parts[3] ?? '').split(',').includes(user))
.map((parts: string[]): string => parts[0] ?? '')
.filter((name: string): boolean => name !== '');
export function memberships_extract(outcome: ExecuteOutcome): string[] {
for (const envelope of outcome.envelopes as ReadonlyArray<WireEnvelope>) {
if (envelope.model?.kind !== POSIX_IDENTITY_MODEL_KIND) continue;
const read = posixIdentityModelSchema.safeParse(envelope.model.data);
return read.success ? read.data.memberships.map((membership: PosixGroup): string => membership.group) : [];
}
return [];
}

/**
Expand Down Expand Up @@ -162,7 +170,7 @@ function holderMarks_build(holders: FeedHolders, removePress: (holder: FeedHolde
* Wires the access verbs to a host.
*
* @param context - The console and the wire.
* @param hooks - The pane question, the session's user, the refresh.
* @param hooks - The pane question, the refresh.
* @returns The access verbs.
*/
export function access_wire(context: Pick<HostContext, 'terminal' | 'client'>, hooks: AccessHooks): AccessVerbs {
Expand All @@ -176,13 +184,10 @@ export function access_wire(context: Pick<HostContext, 'terminal' | 'client'>, h
}
};

/** The groups the session's user belongs to, read from /etc/group. */
/** The CUBE groups the session's user belongs to, from `id`'s model. */
const groups_read = async (): Promise<string[]> => {
const user: string | null = hooks.promptUser();
if (user === null) return [];
try {
const outcome: ExecuteOutcome = await context.client.line_execute('cat /etc/group', quiet);
return groupsOf_user(outcome.envelopes.map((envelope): string => envelope.rendered).join(''), user);
return memberships_extract(await context.client.line_execute('id', quiet));
} catch {
return [];
}
Expand Down
Loading
Loading