Skip to content

Safer + usable: one hardened registry, real CLI, e2e proof, accurate README#44

Merged
noisyloop merged 4 commits into
mainfrom
claude/review-codebase-docs-wyk1U
May 19, 2026
Merged

Safer + usable: one hardened registry, real CLI, e2e proof, accurate README#44
noisyloop merged 4 commits into
mainfrom
claude/review-codebase-docs-wyk1U

Conversation

@noisyloop

@noisyloop noisyloop commented May 19, 2026

Copy link
Copy Markdown
Owner

Summary

Makes EverythingOS both safer and approachable without weakening any security control. Four commits, one per task; all verified (typecheck clean, 126/126 tests, STRIDE claim gate green, e2e proof 7/7).

  • 211dd62 refactor(security): consolidate the two AgentRegistry implementations. There were two registries with disjoint capabilities: the wired class registry (core/registry/AgentRegistry — used by index.ts, the API server, demos) had a bare-throw collision guard and no preflight/emergency-stop; the hardened object registry (core/AgentRegistry) had the STRIDE E-5 audited collision rejection + HIGH-tier ApprovalGate preflight but was imported only by compliance.ts + 2 tests — so the hardened controls never ran on the real start path. Ported all hardened properties into the wired registry, repointed compliance.ts + both tests (assertions unchanged), deleted src/core/AgentRegistry.ts, and corrected the STRIDE E-5 location.
  • 60b50ed feat(cli): real bin + eos new. package.json had no bin and bin.js imported a non-existent compiled file, so npx everythingos did nothing. Added bin (everythingos/eos), made bin.js launch via local tsx, and wired eos new <name> to the _scaffold template (Zod manifest + explicit per-channel allowlists). Removed writeAgentFile, which emitted agents with no riskConfig → wildcard * channels (an ACL escape hatch). Made prompts EOF-safe. Fixed a wrong m0rs3c0d3 GitHub handle in the CLI.
  • 6d3920f test(e2e): real proof-of-life example. examples/e2e-proof.ts + npm run e2e:proof: a custom MEDIUM-tier agent goes registry → subscribe ACL → real injection-sanitization → observable file side effect → act() (publish ACL + DecisionLedger) → independent ledger + audit chain verification. No mocks; names the broken layer and exits non-zero if anything fails.
  • f05344b docs: README matches the code. "Build your first agent" section on the real CLI, Glasswally surfaced from the top, clone URL/dir case fixed, broken cp .env.example .env step replaced (no such file in repo).

Constraint compliance

No security control removed or weakened for ergonomics — the opposite: Task 1 moved hardening onto the live path, Task 2 removed an ACL escape hatch. Generated/custom agents go through the identical pipeline as built-in ones; HIGH-tier still requires a registered ApprovalGateAgent.

Test plan

  • npm run typecheck — clean
  • npm test — 126/126 pass, 10/10 suites
  • npm run check:stride — green (E-5 still test-backed)
  • npm run e2e:proof — 7/7 stages pass with real chain verification
  • eos new verified end-to-end (piped + non-TTY): generated agents load, manifest validates, channel ACL non-wildcard

claude added 4 commits May 19, 2026 00:52
There were two registries with disjoint capabilities: the class-based
core/registry/AgentRegistry (auto-discovery, manifest querying — the one
actually wired into index.ts, the API server, and the demos) and an
object-literal core/AgentRegistry that held the hardened security
properties (STRIDE E-5 audited collision rejection, HIGH-tier
ApprovalGate preflight, emergency stop, compliance status) but was
imported only by compliance.ts and two tests.

The hardened controls therefore did not run on the real runtime start
path. This ports all of them into the wired class registry:
- register() now rejects id collisions with a safety.violation audit
  event instead of a bare throw (STRIDE E-5)
- startAgent() (and the start() alias used by the API server) runs the
  HIGH-tier ApprovalGate + riskJustification + genAIRisks preflight
- emergencyStop(), complianceStatus(), list(), registerAndStart() added
- compliance.ts and the two integration/security tests repointed to the
  single registry; test bodies and assertions unchanged
- redundant src/core/AgentRegistry.ts deleted
- STRIDE E-5 now credits the runtime registry, not the unwired twin

Typecheck clean, 126/126 tests pass, STRIDE claim gate green.

https://claude.ai/code/session_01Ds4diwEnvZ863CUoNCQEkY
The CLI claimed "NOW FULLY FUNCTIONAL" but package.json had no `bin`
entry and cli/bin.js imported a non-existent ./index.js (the build is
noEmit and never compiles cli/), so `npx everythingos` did nothing.

- package.json: add bin (`everythingos`, `eos`)
- cli/bin.js: launch cli/index.ts via the local tsx runtime, so the
  CLI works from a cloned repo after `npm ci` with no build step
- `eos new <name>`: prompts for risk tier + description and generates an
  agent from src/agents/_scaffold — preserving the explicit Zod manifest
  and per-channel allowlists. It substitutes identity/tier/channels
  only; it never widens channels to wildcards, so a generated agent
  goes through the same security pipeline as a built-in one
- interactive "Create Agent" rerouted to the same scaffold generator;
  removed writeAgentFile, which emitted an agent with no riskConfig
  (wildcard `*` channels — an ACL escape hatch the constraints forbid)
- ask()/select() are now EOF-safe (default LOW + default description on
  non-TTY/EOF) instead of hanging forever
- openDocs(): corrected the wrong `m0rs3c0d3` GitHub handle to noisyloop

Verified end-to-end via the bin launcher (piped + non-TTY): generated
agents load, validateManifest passes, the constructor's channel ACL
runs with explicit non-wildcard channels. Typecheck clean, 126/126
tests pass.

https://claude.ai/code/session_01Ds4diwEnvZ863CUoNCQEkY
examples/e2e-proof.ts registers a custom MEDIUM-tier agent through the
consolidated AgentRegistry and exercises every layer for real:
  - register/start runs the compliance preflight
  - untrusted input arrives over the EventBus (subscribe channel ACL)
  - input goes through the real sanitizeInput injection pipeline
  - the agent performs an observable side effect (writes JSON files)
  - act() enforces the publish channel ACL and records a tamper-evident
    DecisionLedger entry
  - the driver independently verifies the ledger entry + chain and the
    audit-log chain

No mocks anywhere. Each layer is asserted and, on failure, the script
names the broken layer and exits non-zero (it does not work around a
broken layer). Run via `npm run e2e:proof`. Audit/ledger/output
artifacts are isolated under a gitignored .e2e-proof/ dir.

Verified: proof passes end-to-end (7/7 stages); 126/126 tests still pass.

https://claude.ai/code/session_01Ds4diwEnvZ863CUoNCQEkY
- Add a "Build your first agent" section using the now-real CLI
  (`npx everythingos new` / `eos new`), the register/run snippet, and
  `npm run e2e:proof` as the no-mocks proof of life
- Surface the Glasswally integration from "What It Is" with an anchor
  link — it was a real differentiator buried at the bottom
- Quick Start fixes: the clone URL/dir used lowercase `everythingos`
  (clone creates `EverythingOS`; `cd everythingos` fails on a
  case-sensitive FS) → corrected to the canonical case; the GitHub
  handle was already correct (noisyloop)
- Replace the broken `cp .env.example .env` step — there is no
  .env.example in the repo — with a direct .env creation that sets
  EOS_AGENT_SECRET
- Surface `npm run e2e:proof` in Quick Start

The architecture diagram already reflects the real wired components
(updated earlier in this branch); after the registry consolidation its
"risk-tier preflight" claim is now literally accurate.

https://claude.ai/code/session_01Ds4diwEnvZ863CUoNCQEkY
@noisyloop noisyloop merged commit 35bb03a into main May 19, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants