mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-11-29 15:51:52 +00:00
OpenDevice 0.2: aliases, access (ssh_config-shaped, creds by reference), notes; OpenFleet 0.2: hosts by any device name (#289)
Some checks failed
CI / build (push) Has been cancelled
Deploy to dev2 / deploy (push) Has been cancelled
test / test (push) Has been cancelled
Some checks failed
CI / build (push) Has been cancelled
Deploy to dev2 / deploy (push) Has been cancelled
test / test (push) Has been cancelled
A device is called many things (seed2 = vienna = devchovy), and an inventory that cannot say how to connect makes every agent rediscover user/port/key. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
147aa2633d
commit
27e5725aea
3 changed files with 22 additions and 11 deletions
|
|
@ -54,6 +54,12 @@ An operator serves or hands over a JSON document. Published, it lives at `/.well
|
|||
"profile": "server",
|
||||
"role": "shared app box",
|
||||
"hostnames": ["app1.northwind.example"],
|
||||
"aliases": ["app1", "seed3"],
|
||||
"access": [
|
||||
{ "name": "app1", "user": "deploy", "auth": "key", "key": "SHA256:Qe1vT0pGq8...", "identity_file": "~/.ssh/id_ed25519", "sudo": true, "gives": "shell" },
|
||||
{ "name": "app1-root", "user": "root", "port": 2202, "auth": "key", "secret": "vault:northwind/app1/ROOT_KEY", "gives": "root" }
|
||||
],
|
||||
"notes": "Root ssh only from the office allowlist. Do not restart the database during business hours.",
|
||||
"addresses": { "ipv4": ["203.0.113.10"], "ipv6": ["2001:db8::10"] },
|
||||
"provider": {
|
||||
"name": "Example Racks",
|
||||
|
|
@ -117,13 +123,16 @@ The rules, and every one degrades:
|
|||
2. **`id`** is stable for as long as the device is the same machine. It is the dedupe key: a reader that sees the same inventory and `id` tomorrow updates its row. Absent, the reader derives one from `name`. A rebuilt box on a new IP with the same job keeps its `id`; a second box doing the same job gets its own.
|
||||
3. **`profile`** is `server`, `desktop`, `phone`, `tablet` or `other`. Absent means `server` when the device has `hostnames` or `addresses`, `other` when it has neither. Each profile's own keys are in its section below.
|
||||
4. **`hostnames`** are names that resolve to the device. **`addresses`** are its public `ipv4` and `ipv6` addresses. Private addresses (RFC 1918, CGNAT, link-local, a tailnet's) go under `private` inside `addresses` and are never collected by an observer.
|
||||
5. **`provider`** is who the device is rented from. `offer` names the [OpenServer](/docs/openserver) offer it was bought as, by the provider's descriptor URL and the offer's `id`, so a reader can show the provider's own specs and price beside the operator's. `account` is the operator's own reference at the provider, an order number or a contract, never a credential.
|
||||
6. **`location`** is where the device is: `country` an ISO 3166-1 alpha-2 code, `region` in the operator's words. A phone or a laptop states it only if its owner wants it stated; an observer never infers a personal device's location.
|
||||
7. **`hardware`** uses OpenServer's units unchanged: `vcpu`, `cores`, `ram_mb`, `vram_mb`, `arch`, and `storage` as a list of `{type, size_gb}`.
|
||||
8. **`os`** is `name`, `version`, and for client profiles `patch`, the security patch level as the device reports it (`YYYY-MM-DD`).
|
||||
9. **`status`** is `active`, `standby`, `retired` or `unknown`. A retired device stays in the file with its cost ended, so last month's books still add up. Absent means `active`.
|
||||
10. **`updated`** is when the inventory last changed; ISO 8601. **`currency`** is the default for every `cost` that states none.
|
||||
11. **Unknown keys are kept.** An operator says more than this document names, and a reader passes it through.
|
||||
5. **`aliases`** are the other names people and agents call the device: nicknames, old names, role names like `seed2`, short ssh names. Plain strings, unique within the inventory and never equal to another device's `id`. They need not resolve in DNS. A reader looking a device up by name tries `id`, then `hostnames`, then `aliases`, and lists the device under every one, so "which box is seed2" has one answer. A name that moves to another box comes off the old device's `aliases` in the same edit.
|
||||
6. **`access`** is how to get in: a list of entries, each one what an `ssh_config` `Host` block says. `name` is the short name a client uses (`ssh <name>`), unique within the inventory; `protocol` is `ssh` (absent means `ssh`), `mosh`, `rdp`, `vnc`, `https` or another URI scheme; `host` is the address or hostname to dial (absent means the first of `hostnames`, then `addresses`); `port` (absent means the protocol's default); `user`; `auth` is `key`, `password`, `certificate`, `agent` or `none`; `key` is the public key fingerprint the server accepts (`SHA256:...`) and `identity_file` the client-side path a reader would use; `secret` is where a password or private key is kept, as a vault reference, a password-manager item or a URL behind the reader's own credential; `jump` is the `name` of another entry to go through (`ProxyJump`); `sudo` is `true`, `false` or `nopasswd`; `gives` is what the entry lands in (`shell`, `root`, an app, a menu); `note` is free text. A reader can write an `ssh_config` from the `ssh` entries alone. **Credentials never appear inline:** no password, private key or token in the file, only the reference in `secret`, so the same inventory can go to a reader who holds none of them.
|
||||
7. **`notes`** is free text about the device for the people and agents who run it: what is special, what not to touch, what is pending. Never a credential.
|
||||
8. **`provider`** is who the device is rented from. `offer` names the [OpenServer](/docs/openserver) offer it was bought as, by the provider's descriptor URL and the offer's `id`, so a reader can show the provider's own specs and price beside the operator's. `account` is the operator's own reference at the provider, an order number or a contract, never a credential.
|
||||
9. **`location`** is where the device is: `country` an ISO 3166-1 alpha-2 code, `region` in the operator's words. A phone or a laptop states it only if its owner wants it stated; an observer never infers a personal device's location.
|
||||
10. **`hardware`** uses OpenServer's units unchanged: `vcpu`, `cores`, `ram_mb`, `vram_mb`, `arch`, and `storage` as a list of `{type, size_gb}`.
|
||||
11. **`os`** is `name`, `version`, and for client profiles `patch`, the security patch level as the device reports it (`YYYY-MM-DD`).
|
||||
12. **`status`** is `active`, `standby`, `retired` or `unknown`. A retired device stays in the file with its cost ended, so last month's books still add up. Absent means `active`.
|
||||
13. **`updated`** is when the inventory last changed; ISO 8601. **`currency`** is the default for every `cost` that states none.
|
||||
14. **Unknown keys are kept.** An operator says more than this document names, and a reader passes it through.
|
||||
|
||||
## Cost
|
||||
|
||||
|
|
@ -196,7 +205,7 @@ A published inventory is a claim by the operator; that it came from the operator
|
|||
|
||||
## What is deliberately absent
|
||||
|
||||
**No credentials.** No passwords, keys, tokens or API secrets, ever. `account` is an order number, not a login.
|
||||
**No credentials.** No passwords, private keys, tokens or API secrets, ever. `account` is an order number, not a login. `access` says how to connect and where the secret is kept (`secret`, a reference), and a public key fingerprint is not a secret. A published inventory at `/.well-known/opendevice.json` leaves out `access` and `notes` entirely: they map the way in.
|
||||
|
||||
**No live stats.** Load, memory in use and uptime belong to the fleet agent that reports them every few seconds. The inventory is what the device is, not how it is doing.
|
||||
|
||||
|
|
@ -223,6 +232,7 @@ A published inventory is a claim by the operator; that it came from the operator
|
|||
| Version | Date | Change |
|
||||
|---|---|---|
|
||||
| 0.1 | 2026-10-28 | First publication: the inventory, five profiles, the cost block and its matching rule, public metadata and its bound. |
|
||||
| 0.2 | 2026-11-15 | `aliases` (the other names a device goes by; lookup order id, hostnames, aliases), `access` (how to connect, shaped like an `ssh_config` Host block, credentials by reference only) and `notes`. Additive; a 0.1 reader keeps them as unknown keys. |
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ The record moshcode should have written for the first piece of the swarm in the
|
|||
| `depth` | | How far below the sysop this member sits. Absent means 0. Members of a swarm are their parent's depth plus one, and never above `ceiling.depth`. |
|
||||
| `engine` | | The program that runs and can kill this session, lowercase. A sysop tool stops a member through this. |
|
||||
| `session` | | The engine's own handle for this session when the starter knows one that differs from `member`: a tmux target, a pid for `claude -p`. Absent means the same as `member`, or that the engine will supply it in `member.start`. The join key to the engine's roster. |
|
||||
| `host` | | The hostname this member runs on. Absent means the host the record was read on. Must be in `ceiling.hosts` when that key is set. |
|
||||
| `host` | | The hostname this member runs on. Absent means the host the record was read on. Must be in `ceiling.hosts` when that key is set. Any name the sysop's [OpenDevice](/docs/opendevice) inventory gives the machine (its `id`, a hostname or one of its `aliases`) names the same host. |
|
||||
| `cwd` | | The working directory the member started in, absolute. |
|
||||
| `started` | | When the starter wrote this record and told the engine to start, ISO 8601 UTC. The `at` of the ledger's `member.start` is the authoritative start time. |
|
||||
| `approvals` | | `native` or `bypass`. Absent means `native`. `bypass` is allowed only when `ceiling.approvals` is `bypass`. This is the field a sysop tool marks in the tree. |
|
||||
|
|
@ -102,7 +102,7 @@ The ceiling's keys, as they read on an opened fleet:
|
|||
| `budget` | uncapped | `<amount> <currency>` (ISO 4217, or a CAIP-19 asset id), the way [OpenAccess](/openaccess) writes a money limit, or `<n> tokens`, this spec's own unit. The most the members under this ceiling may spend in total, summed from `member.spend`. |
|
||||
| `depth` | 1 | The deepest member allowed. 1 means a root member may spawn swarms, and the members of those swarms may not spawn. |
|
||||
| `fan_out` | the engine's default | The most members one swarm under this ceiling may hold. |
|
||||
| `hosts` | the host the ceiling was set on | Hostnames members may run on. |
|
||||
| `hosts` | the host the ceiling was set on | Hostnames members may run on. With an OpenDevice inventory at hand, a reader resolves each entry and `host` to a device before comparing, so `seed2` and `vienna` match when they are the same box; without one it compares the strings as written. |
|
||||
| `until` | no deadline | ISO 8601 UTC time after which every member under this ceiling is stopped. |
|
||||
|
||||
**How a ceiling is read.** A fleet's ceiling is whole: the latest `fleet.cap` whose target is the fleet, else `fleet.open`, else the implicit fleet's. A ceiling in `swarm.spawn`, or in a `fleet.cap` whose target is a swarm, holds only the keys that were narrowed, and a key absent there is inherited. A member's effective ceiling is the fleet's, merged key by key with the ceiling of each `swarm.spawn` on the path down to it, with the latest `fleet.cap` for any swarm on that path applied last. That merged object is what the record's `ceiling` carries. In the implicit fleet, `approvals` enters the merge at the root: each root member's own approvals, from the flags it was started with, and `native` for a root that carries `orphan`.
|
||||
|
|
@ -260,6 +260,7 @@ Three ship: `logicsrc fleet` in `@logicsrc/openfleet` 0.1.0 (logicsrc CLI 0.3.0)
|
|||
| Version | Date | Change |
|
||||
|---|---|---|
|
||||
| 0.1 | 2026-09-13 | First publication: fleet and swarm, the record, the environment, claiming and deriving, the ledger's eight events, five sysop verbs, fifteen rules, the worked example, what Claude Code and moshcode each add. Same day: `logicsrc fleet` and the Claude Code hooks ship in `@logicsrc/openfleet` 0.1.0, `moshcode swarm` and `moshcode fleet` in moshcode 0.99.0. |
|
||||
| 0.2 | 2026-11-15 | Hosts may be named by any OpenDevice `id`, hostname or alias; readers with an inventory resolve before comparing `host` against `ceiling.hosts`. Additive; string comparison stays correct. |
|
||||
|
||||
## License
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue