Compare commits

...
3 changed files with 459 additions and 0 deletions
+6
View File
@@ -5174,3 +5174,9 @@ Before: managed project/thread verbs had no Console conversation area. After: fi
2026-10-20 04:44:54 UTC | Row 178 round 2 preparation | Before: Dewey C1 five render guards lacked killing tests. Added independent refusal fixtures, a temporary uid+1 id stub with cleanup, and empty loopback proof case; activation ordering recorded in r2 BUILD. Product unchanged; syntax/text preflight only, no test or mutant execution. Pending row 181 rebase and Sage slot.
2026-10-20 05:10:34 UTC | Row 178 #1676 round 2 verified | Before: C1 render refusals lacked killing tests and row 181 base was pending. Rebased onto 931651f2d, kept all COUNTED/count code and tests, appended T178 tail; added independent owner/collision/absolute/charset/header and empty-loopback proof tests. Four files singly 156/156, all 24 mutants killed, metadata and sandbox fixture probes pass; scratch sweep empty. Packet agents/rocko/work/queue-178/r2/, candidate 9300a670, inventory d0dcde7b (59/59), scan 58 files no findings; in-review revs 2166-2167, expected no-token request failure. No live actions or commits.
2026-10-20 19:09:44 UTC | Gander row 196 #1694 design phase | Before: tester TCP reaches every local uid and human proofs do not bind the socket peer. After: design draft at agents/gander/work/queue-196/DESIGN.md inventories listeners, proposes private tester HTTP and SO_PEERCRED binding, aligns the per-request principal contract with Morgana and Gizmoduck, and lists migration, tests, mutants and same-uid limits. Python versus other credential options and Console provenance require Duckworth ruling. Documentation only. No product code, suite, live probe, secret access or deployment.
2026-10-20 19:16:20 UTC | Gander row 196 #1694 design r2 | Before: Duckworth r1 requested concurrent helper-fd evidence (B1) and selected O1 with interpreter, proof-only and image conditions. After: design adds eight concurrent genuine proof processes plus a racing copier, M20 swapped socket and post-helper socket survival, root-owned system ELF pinning and activation evidence, safe gid validation, cap traffic without helpers, and unchanged P19 R2 text. Mos accepted socket-only tester access (mos-1015 via sage-1363); any authenticated browser relay is a separate row. Documentation coverage checks passed. No product code, suites or live action.
2026-10-20 19:21:19 UTC | Gander row 196 #1694 design approval and N5 | Before: Duckworth approved r2 (duckworth-0009, cb6d840df) with a nonblocking interpreter-upgrade note. After: r3 chooses startup safety revalidation, appends actual interpreter identity to bus/peercred-starts.jsonl and retains old activation evidence. Operator re-pin uses the next reviewed copy, respecting already-active refusal. Added task-by-task PLAN.md for inline implementation and independent manifest review. Documentation checks passed. No product code, suites or live action.
+332
View File
@@ -0,0 +1,332 @@
# Row 196: the human boundary across uids and humans
Gander, 2026-10-20. Revision 3, recording approved r2 and N5. Gitea #1694, P19 333.
Base: `96f243faf`, branch `gander/row196`. Design approval latest-by 2026-10-22, landing
latest-by 2026-10-24 and before federation R3. This document authorizes no live action.
## 1. Outcome and authority
Other Linux users must not reach the tester's data or writes. A bus human proof must describe
the process that actually connected. Console user calls must also pass the human walk and
come directly from this bus tree's Console. Row 193 and federation R3 use that one verifier.
This is not isolation from a hostile process on the instance's own uid. Keeping the human
terminal CLI means that an unmarked process on that uid still has the owner's authority.
Process ancestry cannot prove that a process was never an agent. Sections 4 and 8 state this
limit without treating it as an enforcement guarantee.
Inputs: COMMON at `53bb59462`, the row brief at `96f243faf`, Q175 sections 1, 6 and 8,
federation r2 at `60b9b112a` section 3.6, Duckworth's B1-B5 at `b402197ff`, row 190's
DESIGN.md and the row 190b brief. Q175-Q178 and the MVP plan set the order. Row 190b is on
hold pending the host decision. This row does not assume that a separate uid is already live.
Sage's `sage-1343` accepts the design direction and requires Duckworth to rule on the peer
credential implementation. `sage-1345` keeps the control board inventory-only. Morgana's
`morgana-0003` supplies the principal contract in section 4. Sage registers this session.
Mos accepted removal of direct tester browser access in mos-1015, relayed by sage-1363.
Agents test through the private socket. Any later browser view is an authenticated relay
behind SSO, designed and reviewed in its own row. This row adds no relay.
## 2. Inventory from code, not a live probe
"Same uid" includes untrusted local processes. "Other uid" excludes root, which is outside
this boundary. SSO below means Q175 is active on that instance, not merely installed.
| Entry | Same uid today | Other uid today | Effect of SSO and this row |
|---|---|---|---|
| Main Console, default 7332, bare serve default 7330 | Loopback reads. With preview/send, matching Host, header and origin can write as owner | Same TCP reach and header forgery | Q175 SSO verifies login and refuses non-public Host except GET /healthz. This row does not change public ingress |
| Tester TCP, default installation 7333, optional per instance | Reads and the tester instance, route, name and chat writes | Identical reach, no uid check | Q175 deliberately leaves tester separate. This row replaces TCP with a private filesystem Unix socket |
| `<dataRoot>/bus/broker.sock` | Connects, then needs cap or proof. Claimed human PID is not the socket peer | Normally refused by bus/ 0700 and socket 0600 | SSO changes nothing. Add peer uid and PID binding, retain file checks |
| Human wrapper to tree's human-cli.mjs | Owner if CLI path, nonce and ancestry pass. Agent ancestors refuse | Cannot connect to protected socket, and proof uid refuses | Preserve terminal owner path, add peer binding. SSO does not authenticate terminal users |
| Tester CLI to broker.sock | Tester if its proof passes and bus.tester is exactly true. T3 agents are allowed, managed runs are not | Filesystem modes normally refuse | Same tester policy, plus peer binding. No owner/user upgrade |
| `<dataRoot>/bus-host/launch.sock` | Requires run cap and launcher checks | bus-host/ 0700, socket 0600 | No human proof endpoint. Unchanged |
| `<dataRoot>/bus-host/git.sock` | Git capability protocol and broker authorization | bus-host/ 0700, socket 0600 | No human proof endpoint. Unchanged |
| Discord connector | Outbound Discord gateway/REST, no inbound local listener. Local process could tamper with same-uid files/process | No local port to call. File separation depends on uid and modes | Existing guild, user, channel, bot and webhook checks remain. Discord is not a new bus human transport |
| Row 190 additions | Separate configs, roots, unit names, wrappers and Console ports, on one uid | Console/tester TCP still reachable | Adds no new class of listener. Row 196 derives its socket per dataRoot. Row 190 alone supplies no hostile-process isolation |
| Control board, default 7331 | Unauthenticated transcript/board reads, POST /api/reply and /api/seen after request checks | Same loopback reach. A local client can supply matching request headers | Independent development service, outside instance SSO. Inventory only per sage-1345. Its fix needs another row |
Evidence: `packages/webui/src/{cli,serve,bus}.mjs`, `packages/bus/src/{server,runtime,human,
tester,store}.mjs`, `packages/cli/src/{launcher,git-socket,transport}.mjs`,
`packages/discord/src/{gateway,authorize}.mjs`, `packages/control-board/src/serve.mjs`.
Store checks bus/ with `safe(directory,true)`, including owner, symlink and mode checks.
The dataRoot check itself does not require 0700 today. Do not describe that as a checked mode.
## 3. D1: private tester HTTP socket
Add `serve --tester-socket`, a boolean selecting `<dataRoot>/console/tester.sock`. No arbitrary
path or new system config field. Create console/ as 0700. Refuse a symlink, wrong owner,
non-directory or any group/other bits on an existing console/. Refuse a pre-existing socket
or other entry rather than deleting it blindly. A stale socket needs an operator's diagnosis.
Refuse a path longer than Linux's 107-byte pathname capacity before binding.
Bind HTTP on the Unix path, set socket mode 0600, then verify type, owner and mode before
declaring ready. The private parent covers the bind-to-chmod interval. Cleanup only the owned
device/inode, as broker.sock does. Never open a TCP compatibility bridge or an abstract socket.
Readiness failure closes the main listener too, rather than leaving a partially started Console.
The tester handler keeps its fixed principal, header/cookie refusals and exact write list.
Use a fixed logical origin `http://mosaic-tester.invalid` for URL and same-origin checks. It
does not resolve that name. Clients send that Host and Origin plus the existing Fetch Metadata
when required. A Host string is not authentication. Unix socket access supplies that boundary.
The main listener still refuses x-mosaic-tester. No tester /auth route exists.
`bus.tester` remains Jason's switch. Socket reach never enables tester authority by itself.
Turning it off must refuse every tester bus call. This row adds no user or owner capability
to the tester. Tester reads retain today's scope, including any local Console reads that are
not bus calls. This row does not turn bus.tester into a separate HTTP read switch.
### Consumers and migration paths
| Consumer of 7333 | New path |
|---|---|
| Agent tester HTTP tools and curl probes in authorized window packets | `curl --unix-socket <dataRoot>/console/tester.sock http://mosaic-tester.invalid/...`, with the fixed Origin for writes. Add one repository helper for bounded tester HTTP requests so callers do not copy path/origin logic |
| `scripts/mosaic ... --tester` | Already uses TESTER_CLI and broker.sock, not TCP. Keep its verbs, output and switch |
| Browser tester page in row 176 and later window checks | Ordinary browsers cannot navigate a Unix HTTP socket. Replace automated tester HTTP checks with the socket helper. Browser visual QA uses scratch fixtures only. No local TCP relay is added |
| `webui-service.sh` render/install and installed unit | Carry --tester-socket for new copies. Refuse a target without support. Units running old copies retain their old flags until a window |
| `stack-release.sh` activate, plan, rehearsal and rollback | Add --tester-socket. Replace inherited --tester-port N only when explicitly requested. Refuse incompatible inherited flags before stopping units. Plan names the transport and every dropped pair. Rehearsal uses a scratch socket |
| Gate/window Console checks, including agents' console-check scripts | Extend checks to use scratch Unix HTTP and expect no tester TCP bind. Sage owns live packet updates, including Q175 phase 2's old --tester-port 7333 instructions |
| `docs/TOOLS.md`, webui/cli/bus READMEs and examples | Document socket invocation, fixed origin, loss of direct browser navigation and per-instance path. Historical window receipts stay unchanged |
Repository search found no non-test hardcoded 7333 caller in tools/ or the harness code. The
active windows and external seat commands still need Sage's consumer audit before re-pin.
The build manifest will record the full search, rather than treating this draft as that audit.
## 4. D2: one verified principal per bus request
Internal interface: `verifyPrincipal(request, connection) -> {kind,business,id}` or refusal.
Kinds are owner, user and tester. The connection metadata is supplied by the trusted server,
never deserialized from JSON. No role or authority is returned. The broker looks up live policy.
1. Read and validate the bounded envelope first. For human, tester and user proofs, read Linux
SO_PEERCRED on that accepted Unix connection before dispatch. Require a valid peer PID
and the bus uid. Refuse unavailable credentials, unsupported platform and errors. Cap
traffic keeps its capability protocol behind the validated 0700 directory and 0600 socket.
2. Require exactly one cap, human, tester or future user envelope. Human/tester/user proof.pid
must equal the kernel peer PID. Verify startTime, nonce and CLI path against that process.
Keep the second process read after the walk. Missing, changed or exited processes refuse.
3. Owner terminal: run the full existing human walk. Map the business to businesses[b].human.
No supplied human id, role or uid selects the principal. Keep today's terminal invocation.
4. Tester: run verifyTester, retaining its deliberate difference from the human walk. An agent
seat may be tester. A managed-run marker or registered managed ancestor refuses. Then check
bus.tester. The full human walk must never be weakened to admit a session user.
5. Session user: use the full human walk with the path-bound user-cli entry and its own nonce
variable, MOSAIC_BUS_USER_NONCE. Parameterize the nonce reader without admitting a human
or tester nonce as a user proof. Require its immediate parent to be the same tree's resolved webui/src/cli.mjs,
argv[2] `serve`. Check parent uid, startTime and ppid again before binding. Both child and
parent remain alive for the call. A different checkout or wrapper parent refuses.
6. For user calls, the Console puts its mapped access-file user id in the verified proof's
user field, as federation 3.6 specifies. The id comes only from claims Q175 verified for
this request's live session, never from an identity cached past that session. It never
takes that id from a form field or verb
args. Return kind user, proof.business and proof.user as id only after the provenance
checks. R3 then validates that mapping and the live grant. Bad access.json denies users,
not the terminal owner. The verifier does not implement access-file policy.
7. Owner Console calls keep the verified Q175 owner subject path. Under SSO only a subject
in console.sso.subjects reaches owner bus calls. They use human-cli and the same peer/walk
checks. A terminal owner still needs no SSO token. No anonymous main-listener fallback.
The bus verifies which process supplied the session identity. It relies on that Console's
Q175 implementation to have verified OIDC. It does not independently verify an ID token in
this option. A provider/sub field alone, from another process, is not enough.
The Console must spawn user-cli directly with its nonce already in the launch environment.
It must not use human-cli's existing self-respawn pattern, which makes the CLI's parent a CLI.
Apply the same initial-nonce spawn to Console human calls for consistent tests. Terminal
human-cli can retain its self-respawn since no Console-parent condition applies there.
Never strip agent markers from inherited environments to make a walk pass.
The server binds an internal cap for this request, dispatches, and disconnects in every
success/error/timeout path, including asynchronous task and web calls. It never returns the
cap or a reusable principal handle. A proof copied by another process has a different kernel
peer PID and fails. One verified CLI may make only its one request on its one connection.
The session may hold s.user for that request. No PID or principal cache survives the connection.
### Fit with rows 193 and R3
Row 196 owns peer metadata, proof/walk verification and the internal principal interface.
It supplies the Console provenance verifier and tests before R3 adds user-cli and user sessions.
R3 owns access.json mapping and the bindUser integration, using this interface. It must not
add a second ancestry implementation. Row 193 adds viewer and share policy to the same live
grant check. An owner id is the business human. A user id is the access-file id, with stored
owner string `user:<id>`. Neither row takes role from the proof.
No live grant, unknown subject, duplicate owner/user mapping and invalid access file all
deny user binding through R3's policy. Per-request authorization, access.reload and the
30-second recheck remain R3's responsibility. Share visibility uses that check in row 193.
Binding provenance is not a grant and never widens one. R3's user dispatch must run before
names falls through to #agent. R3 must not land before this contract and its tests are green.
Gizmoduck's gizmoduck-0015 and Gander's gander-0007 agree on this split. R3 keeps the reserved
user-name mutant. Row 196 tests kind separation even if a user id resembles the owner name.
### OIDC alternative
The bus could verify the signed ID token itself and map its issuer/sub. That reduces reliance
on the Console's subject assertion, but requires JWKS/provider handling, nonce or challenge
binding, replay handling, login and logout/session lifetimes in the bus. Reusing an ID token
on every request either creates a replay credential or expires a Console session with the
token. A bus-issued session needs a separate lifecycle design. It also leaves the terminal
owner and hostile same-uid limit intact. Recommend the Console provenance contract for this
slice. Duckworth approved this option in duckworth-0006, with the live-session condition above
and the requirement to carry section 8 R2 into P19 333 word for word.
## 5. D3: obtaining kernel credentials, O1 approved with conditions
All options must bind the accepted connection, not a PID a caller picked. None gets a silent
fallback to the current proof. Sage required this comparison. Duckworth selected O1 in
duckworth-0006, with the interpreter, proof-only and image conditions below. O4 remains the
fallback if Python is unavailable, and needs a revised build manifest before use.
| Option | What it proves and costs | Recommendation |
|---|---|---|
| O1 Python stdlib helper on inherited accepted socket | Node passes the accepted net.Socket as fd 3 using documented spawn stdio stream passing. Python socket(fileno=3) reads SO_PEERCRED and returns only pid,uid,gid on stdout. No socket reads, no shell, no credential values. Adds Python to bus hosts and any future bus image, with a process per admitted proof connection. Copies carry the helper and depend on the system interpreter | Selected by Duckworth, with conditions below |
| O2 /proc/net/unix plus inode and /proc/PID/fd scans | The table identifies Unix socket entries, not an authenticated peer PID for each accepted connection. Finding a process holding an inode is racy, may have several holders and can be unreadable. The server endpoint's inode is not the client's inode | Reject as a replacement for SO_PEERCRED. No claimed proof PID may choose the scan target |
| O3 plain Node fd passing or abstract sockets | A private inherited IPC channel can authenticate a child that this parent spawned. The bus did not spawn the independently started Console or terminal CLI. Moving the bus into the Console's child tree changes lifecycle and ownership. An abstract name supplies no filesystem mode boundary and no peer uid check by itself. Node's public net API supplies no SO_PEERCRED accessor | Reject as a drop-in. A larger bus-spawned transport design could use fd capabilities, but is outside this slice |
| O4 small compiled helper or Node-API addon | Calls getsockopt directly, with no Python runtime. A helper can use the same inherited fd. Adds compiler/build closure and platform artifacts to stack-copy and containers. An addon also needs a supported way to obtain the accepted socket fd and Node version coverage | Viable alternative if Python is refused. Prefer a small helper over undocumented Node handles |
For O1, pin the system interpreter `/usr/bin/python3`, resolving its system symlink to an
absolute ELF binary. Require root ownership and no group/other write on that executable and
its path components. Refuse scripts, PATH shims and any resolved path under an OS account's
home, including /home and /root. A pyenv shim can choose an interpreter before -I -S applies.
No PATH lookup, caller-selected interpreter or helper. Invoke the resolved binary with
`-I -S`, a minimal environment and the absolute helper path in the same pinned copy.
Activation preflight records the interpreter's resolved path, version and file identity/hash
in its gate evidence. The bus validates and pins the resolved executable at each startup
before opening broker.sock. The activation gate must report the same interpreter used by
that bus. Missing, unsafe or changed resolution during that activation refuses it, never
falling back to PATH. No secret values are recorded. Test system-owned interpreter checks
through injected metadata.
N5 decision: a later bus restart repeats the safety/version/support checks and accepts a
safe system interpreter installed by an OS upgrade. It does not compare against an old
activation hash. Before opening the listener, append a startup receipt with timestamp,
copy path, resolved interpreter path, version and file identity/hash to
`<dataRoot>/bus/peercred-starts.jsonl` (0600 in the checked 0700 bus directory). Refuse an
unsafe receipt file or failed append. Never edit the old activation evidence. The startup
receipt identifies the binary now in use, so the old receipt remains a historical fact.
If an upgraded interpreter fails the checks, startup fails closed until a safe supported
system interpreter is restored by the operator. There is no shim or O4 auto-fallback.
Operator re-pin after an interpreter change: in the next authorized window, prepare the
next reviewed copy with `scripts/stack-copy.sh copy NEW`, then run
`scripts/stack-release.sh activate NEW BUSINESS --tester-socket` with that instance's existing
flags and selector, first with --plan. NEW must differ from the active copy because activate
refuses already-active. Record the interpreter in the new activation evidence and compare it
with the bus startup receipt. A routine OS update alone does not authorize a re-pin or unit
restart. A bus restart does not rewrite config, pointer or activation history.
Preflight helper and SO_PEERCRED support too. The helper lives under packages/bus/src so
stack-copy's closure includes it. Copies remain immutable. Document Python >=3.10 on bus
hosts. Today's Containerfile builds the worker image and runs run-agent.sh, not the bus.
It needs no Python change for this row. A future bus-host image must explicitly include
the pinned system Python or use reviewed O4. No install through the node_modules symlink.
Pause each proof connection while reading credentials. Limit outstanding helpers
to 16, timeout to one second, output to one strict JSON record of at most 256 bytes. Refuse
nonzero exit, extra output, malformed integers, missing fd and timeout. Validate pid, uid and
gid as safe integers, pid >=2 and uid/gid >=0. Only pid and uid select the principal. gid is
validated but grants no authority. Kill and reap helpers on shutdown. Cap envelopes never
spawn this helper. Reading the proof envelope first is sound because SO_PEERCRED describes
the peer at connect time. Keep the accepted Socket object owned by its connection closure,
not a shared current-fd variable. Only the helper's duplicate fd is closed when it exits.
References: [Node stdio stream passing](https://nodejs.org/api/child_process.html#optionsstdio),
[Node Unix socket support](https://nodejs.org/api/net.html#ipc-support),
[Python socket and getsockopt](https://docs.python.org/3/library/socket.html),
[Linux Unix credentials and permissions](https://man7.org/linux/man-pages/man7/unix.7.html),
[Linux proc network table fields](https://man7.org/linux/man-pages/man5/proc_pid_net.5.html).
These support the APIs. The connection-binding behavior still needs T2 on supported Node versions.
## 6. Migration and rollback
No config schema or store schema changes. Old copies and units keep working until each
instance re-pins. No new verifier is loaded into a running old broker. Do not pair a new
Console with an old bus and call it protected. Same-tree paths intentionally refuse mixtures.
The authorized window must pin bus, Console and human wrapper to one candidate. New tools
offer `activate ID BUSINESS --tester-socket`. Plan must show the old tester-port pair removed
and the new socket flag added, and tell Jason that direct tester browser navigation is lost.
Mos accepted that change in mos-1015 (sage-1363). Agents test through the socket. A later
authenticated browser relay behind SSO belongs to its own row. Without the explicit
conversion, a candidate that no longer
serves tester TCP refuses inherited --tester-port before stopping anything. New serve refuses
--tester-port with a migration error. It never silently changes that flag's meaning.
Rollback to a copy lacking --tester-socket drops tester enablement and reports it, as today's
tools drop unsupported flags. It does not turn the socket back into TCP. The old main Console
and owner CLI can run with their known old limits. A failed activation's recovery may restore
the old saved unit, including its TCP listener. Report that recovery as restoration of the old
security state, never as a hardened deployment. After rollback, R3 and second-human access are
not accepted until prerequisites are restored. Older operator tools cannot manage the new
flag safely. The window must use the reviewed candidate tool blob for rollback as well.
The Q173 window supplies real uid-denial evidence and the final consumer audit. No second uid,
live socket, unit, config or secret is touched in this row's tests. Row 190b or a separate host
still owns cross-instance file isolation. It is not replaced by SSO or this socket change.
## 7. Acceptance tests and mutants
All fixtures use scratch roots and ephemeral sockets, no live 7332/7333, public origin or
provider. No real second uid. Foreign uid checks use injected metadata and name that limit.
Use short TMPDIR paths so the longest Unix socket path stays under 108 bytes.
| Test | Required evidence | Mutant killed |
|---|---|---|
| T1 private tester | HTTP over scratch socket reads and writes as tester only. parent 0700, socket 0600. No tester TCP listen. Wrong Host/origin and auth cookies refuse | M1 bind loopback TCP as well, M2 remove socket mode check, M3 accept owner cookie |
| T2 real peer binding | At least 8 concurrent proof connections from distinct scratch client processes, each with its own live proof, plus a copier racing one live CLI. Barrier the helpers so connections overlap. Each genuine call must bind its own peer PID and pass, the copier must refuse. Repeat on Node 24 and 26. A lower-level helper fixture exchanges bytes both ways on the accepted socket after the helper exits, and each real bus call receives its response after helper exit. Helper failure cases all refuse | M4 use proof.pid as peer PID, M5 continue after helper error, M20 give the helper another pending connection's socket |
| T3 uid/path refusal | Inject foreign peer uid, wrong file owner/modes, symlink parent, existing socket and long path. Inject interpreter script, user-owned ELF, home path, writable ancestor and missing executable. Refuse before dispatch, no repaired paths. Unsafe pid/uid/gid and extra helper output refuse | M6 ignore uid, M7 accept unsafe parent |
| T4 ancestry | Agent env, binary and registered launch above owner/user refuse. Missing/reused PID, changed parent and cycles refuse. Clean terminal owner works | M8 omit walk, M9 omit identity re-read |
| T5 Console parent | Direct CLI child from exact tree Console fixture works. Same CLI under shell, other copy, wrapper, agent ancestor or CLI respawn refuses | M10 remove direct-parent check, M11 accept any Console basename |
| T6 principal shape | No human id or role from request body. Exactly one proof. No returned cap. Disconnect on synchronous and async failure, timeout and close. Tester agent allowed, managed tester refused | M12 accept extra identity, M13 omit disconnect, M14 use tester walk for user |
| T7 consumer migration | Render/plan/activate/rehearse fixture carries socket flag in unit and pointer. Explicit conversion removes port. Unsupported/inherited mismatch refuses before unit calls. Rollback disables unsupported tester, never opens TCP | M15 keep inherited tester port, M16 restore TCP on downgrade |
| T8 gates and identity | bus.tester false refuses tester calls. SSO owner/user wiring uses only claims verified for that request's live session. Expired/logged-out or replaced session cannot reuse an earlier mapped id. User kind never becomes owner from its id. R3 integration maps subject, denies missing/invalid grants and owner overlap, broken access file leaves terminal owner working | M17 bypass tester switch, M18 turn user kind into owner by id |
| T9 isolation limits | Two scratch instances have different sockets and matching tree paths. Foreign-uid stand-in refuses. Record that no real uid boundary was exercised | M19 choose default instance socket |
| T10 interpreter and cap path | Activation evidence records the same pinned root-owned system ELF that the bus uses. Scripts, home paths and unsafe owners/modes refuse. Simulated OS replacement followed by startup accepts a safe replacement and appends its actual identity without changing the old receipt, refuses an unsafe replacement or unsafe/unwritable receipt. Cap calls complete without invoking the helper, proven with a helper spy that fails if called | M21 bypass interpreter safety, M22 invoke helper for cap traffic, M23 retain stale interpreter identity after restart |
Tests for new policy stay in the bus, WebUI and CLI packages. R3 provides the real user/grant
half of T8 in its candidate, with its own gate. This row tests the shared verifier's user
provenance without shipping placeholder user access. Mutants run on scratch copies,
restore the original bytes and verify hashes. Two failures in a gate run stop and are reported.
Single test files run freely. Ask Sage for the slot before any suite. Final acceptance is
Duckworth's approved manifest plus Sage's bus, WebUI, CLI and scripts/test-*.sh gate.
## 8. Closure, limits and review decisions
R1. Same uid remains trusted OS authority. A hostile process may detach, clear its markers,
modify argv, read same-uid pipes or capabilities, edit policy files, or interfere with the
Console where host policy permits. SO_PEERCRED proves the connecting process identity at
connection time. It does not prove human intent, protect memory, or track a socket passed to
another process. Ordinary agent children fail the walk. Hostile detached agents are not
claimed contained. Separate uids narrow cross-instance reach, not reach within one instance.
R2. The Console provenance option trusts verified code and process metadata, not an independent
bus-side OIDC exchange. That trade must be approved, not hidden behind the phrase zero trust.
R3. A Unix tester endpoint removes direct browser navigation. No bridge is in this design.
The 7331 development board remains a separately reported reachability and impersonation risk.
P19 333 can record the following after the implementation gate and authorized re-pin:
"Tester ingress is private to the instance uid. Bus human proofs are tied to the actual
Unix peer and retain the human walk. Session-user calls require the same-tree Console as
direct parent. Q175 phase 2 separately protects main Console ingress with verified OIDC.
Hostile processes on the instance uid, root, and the independent development control board
remain outside these guarantees. Cross-instance file isolation requires the uid/host gate."
Duckworth requires that P19 333 also carry R2 word for word:
"The Console provenance option trusts verified code and process metadata, not an independent
bus-side OIDC exchange. That trade must be approved, not hidden behind the phrase zero trust."
Do not mark the historical task fully closed on a design or commit. Closure needs live
Q175 phase 2, this row's re-pin and the recorded residual accepted through Mos. A promise of
hostile same-uid isolation would require separate OS authority for agents and a new design.
Review receipt: duckworth-0006, notes at `86be181a2:agents/duckworth/work/row196/REVIEW.md`.
Q1 selects O1 with the conditions incorporated in section 5. Q2 approves Console provenance
with the live-session and unchanged P19 R2 conditions. B1 adds concurrent T2, M20 and socket
survival checks. N2's detached-Console limit remains in R1. N3's gid validation and N4's
operator window warning are included. Mos's tester-access ruling is recorded above. No
product code begins before design approval.
Duckworth approved revision 2 in duckworth-0009, review at
`cb6d840df:agents/duckworth/work/row196/REVIEW-r2.md`. N5 permits either restart policy.
Revision 3 selects safety revalidation with a new append-only startup receipt, and gives the
operator a re-pin path that respects the existing already-active refusal.
+121
View File
@@ -0,0 +1,121 @@
# Row 196 Human Boundary Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox syntax for tracking.
**Goal:** Bind human proofs to their actual Unix peers and make tester HTTP private to the instance uid.
**Architecture:** The bus reads kernel credentials through a pinned system Python helper only for proof envelopes. One principal verifier keeps the human walk and supplies Console provenance for federation R3. Tester HTTP moves to a private filesystem socket. Release tools migrate the flags explicitly.
**Tech Stack:** Linux, Node 24 and 26, Python >=3.10 standard library, existing Node test runner and shell release tools.
**Spec:** `agents/gander/work/queue-196/DESIGN.md`, approved r2 at 5fe259f16, with N5 restart policy added in r3.
## Global Constraints
- Work in the existing gander/row196 worktree. Plain node_modules symlink. No new package dependency.
- No live files, credentials, listeners, units, second uid or external authentication service.
- Helpers: proof envelopes only, at most 16 concurrent, one second timeout, 256-byte strict output.
- Root-owned system Python ELF at resolved /usr/bin/python3, never PATH or a home/shim path.
- console/ 0700, tester.sock 0600, Unix pathname at most 107 bytes.
- One principal and transient cap per request. R3 owns user access policy and user-cli integration.
- Mos accepted socket-only tester access. No TCP relay or control-board change.
- Single test files run freely. Ask Sage before any suite. Stop and report two failures in a gate run.
- Commit code only after applicable suites pass. Sage owns the final gate and manifest queue moves.
## Review Focus
- Connection overlap and disconnect: helpers must retain the correct Socket object and release capacity on every exit.
- OS interpreter replacement: restart records the actual safe binary, while old receipts remain unchanged.
- Long or unsafe instance paths: refuse before binding or stopping any service.
- Rollback/recovery: distinguish intentional tester disablement from restoration of an old saved TCP unit.
- CLI nonce respawn and session expiry: direct-parent provenance must survive correct Console spawning and refuse stale identity.
## Task 1: kernel credentials and interpreter evidence
Files: create `packages/bus/src/peercred.mjs`, `packages/bus/src/peercred.py`,
`packages/bus/src/interpreter.mjs`; tests in `packages/bus/tests/peercred.test.mjs` and
`packages/bus/tests/interpreter.test.mjs`, with subprocess fixtures under `packages/bus/fixtures/`.
Interfaces: `inspectInterpreter()` returns a validated immutable record of path, version,
device, inode and sha256. `recordInterpreterStart(directory, record)` appends the actual startup
identity safely. `createPeerReader({interpreter})` returns `{read(socket),close()}`. read resolves
to `{pid,uid,gid}` from that exact socket, or refuses. Test-only injected OS/process operations
do not become product flags or environment overrides.
- [ ] Write interpreter safety, receipt replacement and cap-independent helper tests (T3/T10).
- [ ] Run each new test file alone and record the expected missing-module failures.
- [ ] Implement system interpreter validation and startup receipt append with no-follow, owner/type/mode checks.
- [ ] Write T2's eight-process barrier plus racing copier, wrong-fd case and post-helper socket exchange.
- [ ] Implement fd-3 helper, strict result validation, bounded async reader and helper shutdown.
- [ ] Run `node --test packages/bus/tests/interpreter.test.mjs` and separately `node --test packages/bus/tests/peercred.test.mjs`.
- [ ] Confirm process/socket cleanup, eight distinct kernel PIDs, copier refusal and original receipt preservation.
## Task 2: principal provenance and bus dispatch
Files: modify `packages/bus/src/{human,tester,server,runtime}.mjs`, create
`packages/bus/src/principal.mjs`, add `packages/bus/tests/principal.test.mjs`, and extend
`packages/bus/tests/human.test.mjs`. Extend server/runtime test files after inspecting their fixtures.
Interfaces: `verifyPrincipal(request, {peer,...trustedPathsAndProcessReaders})` returns
`{kind,business,id}`. Human maps to the business human, tester to tester, user to its verified
Console proof id. No roles or grants. Server obtains peer metadata from Task 1 only after
envelope validation and only for proofs. Existing cap dispatch never invokes the helper.
Future user binding stays refused without R3's trusted integration.
- [ ] Write T4/T5/T6/T8 process-table tests, including changed ancestry, distinct nonce namespaces and kind confusion.
- [ ] Run the focused new file and confirm expected failure before implementing the verifier.
- [ ] Parameterize the nonce/path portion of the existing human walk and retain all marker/binary/launch checks.
- [ ] Wire peer metadata, interpreter startup receipt and one-request cleanup into runtime/server.
- [ ] Test cap requests with a failing helper spy (M22), and test async refusal/close cleanup.
- [ ] Run each affected bus test file alone. Record any base fixture changes needed for real peer identity.
## Task 3: tester Unix HTTP and Console nonce spawning
Files: modify `packages/webui/src/{cli,serve,bus}.mjs`, create
`packages/webui/src/tester-socket.mjs` and `packages/cli/src/tester-http.mjs`; add focused
`packages/webui/tests/tester-socket.test.mjs` and `packages/cli/tests/tester-http.test.mjs`.
Extend existing WebUI transport tests.
Interfaces: `startTesterSocket({dataRoot,...handlerOptions})` owns the private listener and
cleanup. `testerRequest({dataRoot,method,path,body})` uses the fixed logical origin and bounded
Unix HTTP. Console human child spawning supplies its initial nonce, preserving agent markers.
R3 reuses that spawn pattern for its user-cli.
- [ ] Write T1/T3/T9 socket permission, unsafe-path, wrong-origin and instance separation tests.
- [ ] Confirm the new focused files fail, then implement --tester-socket and refusal of --tester-port.
- [ ] Keep tester principal, write allowlist and cookie/header refusals intact. Add no browser relay.
- [ ] Write and implement the initial-nonce Console spawn test and the helper request timeout test.
- [ ] Run each new or changed test file alone, verifying cleanup and no tester TCP bind.
## Task 4: release migration and operator evidence
Files: modify `scripts/{webui-service,stack-release}.sh`, inspect
`scripts/stack-copy.sh` closure, extend `packages/cli/tests/stack-release.test.mjs` and its
render fixtures. Update `docs/TOOLS.md` and package READMEs with the implementation.
Interfaces: `activate ID BUSINESS --tester-socket` explicitly replaces inherited tester-port
flags. Pointer and unit argv agree. Candidate support and interpreter preflight run before
any unit stop. Activation gate evidence records the same interpreter as the bus startup receipt.
- [ ] Write T7 explicit conversion, inherited mismatch and unsupported-target refusal fixtures.
- [ ] Run only the affected test file, then implement flag rendering, plan output and rollback disabling unsupported tester.
- [ ] Preserve old-copy recovery behavior and report restored old security state accurately.
- [ ] Add rehearsal scratch socket and T10 interpreter gate identity comparison.
- [ ] Verify same-copy activation refusal is preserved. Document N5's next-reviewed-copy re-pin path.
- [ ] Run the affected file alone, shell syntax checks, and inspect remaining tester-port references by purpose.
## Task 5: mutants, approved suites and manifest
Files: add the row's mutation runner and receipts under `agents/gander/work/queue-196/`.
Append BUILD-LOG phase receipts. No SESSIONS or queue file edits.
- [ ] Exercise M1-M23 against isolated scratch copies. Record killer test, restored hash and cleanup for each.
- [ ] Run focused tests on Node 24 and 26, including the concurrent T2 case and socket lifetime checks.
- [ ] Send Sage the scope and estimated duration, obtain the suite slot, then run approved bus/WebUI/CLI suites.
- [ ] Let Sage own the scripts/test-*.sh gate. Stop on the repository's two-failure rule.
- [ ] Build the exact changed-path manifest with acceptance evidence, search results, limits and consumer audit.
- [ ] Commit/push the verified candidate only after applicable suites pass. Send Duckworth and Sage path, commit and hashes for manifest review.
Execution stays with Gander in this worktree. No new agent delegation. Duckworth reviews
the manifest independently. Push is only to gander/row196. No merge, re-pin or deployment
is authorized by this plan.