From 5d8e223ec383099b7b7b2cf82aec9c73bdfa2dcc Mon Sep 17 00:00:00 2001 From: Rod Vince Date: Sat, 10 Oct 2026 18:58:51 -0600 Subject: [PATCH] fix: the example of a terminal principal names nobody (greenhouse evidence/1192) A docblock of src/ and two tests wrote a terminal principal with a person's user name. They say operator@example.com now; the tests assert what they asserted. The docblock travels in the archive. A public repository carries no identifier of a person or of a machine (greenhouse evidence/1144, evidence/1192). --- src/Effect/VerifiedPrincipal.php | 2 +- tests/Effect/VerifiedFactsTest.php | 6 +++--- tests/InvocationContextTest.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Effect/VerifiedPrincipal.php b/src/Effect/VerifiedPrincipal.php index dfacdae..70ccd18 100644 --- a/src/Effect/VerifiedPrincipal.php +++ b/src/Effect/VerifiedPrincipal.php @@ -33,7 +33,7 @@ final readonly class VerifiedPrincipal { /** - * @param string $principal who, with its origin in front: `cli:rod@laptop`, `key:ABCD…` + * @param string $principal who, with its origin in front: `cli:operator@example.com`, `key:ABCD…` * @param bool $verified whether a proof actually backs this — never asserted alone * @param string|null $channel the surface it arrived through * @param list $scopes what is verifiable, not what was asked for diff --git a/tests/Effect/VerifiedFactsTest.php b/tests/Effect/VerifiedFactsTest.php index de47ebd..637d4e2 100644 --- a/tests/Effect/VerifiedFactsTest.php +++ b/tests/Effect/VerifiedFactsTest.php @@ -42,10 +42,10 @@ public function testAnAdmittedPrincipalYieldsVerifiedFacts(): void /** 2 · a terminal's os-user is a fact, but an unverified one — the useful, honest default. */ public function testATerminalPrincipalIsUnverified(): void { - $principal = VerifiedPrincipal::fromTerminal('rod', 'laptop'); + $principal = VerifiedPrincipal::fromTerminal('operator', 'example.com'); self::assertFalse($principal->toFacts()->verified); - self::assertSame('cli:rod@laptop', $principal->principal); + self::assertSame('cli:operator@example.com', $principal->principal); } /** @@ -100,7 +100,7 @@ public function testAPayloadWithoutAPrincipalIsRefused(): void /** 6 · the terminal path can never be talked up: fromTerminal is verified:false by construction. */ public function testTheTerminalPathHasNoProofToCarry(): void { - $arr = VerifiedPrincipal::fromTerminal('rod', 'laptop')->toArray(); + $arr = VerifiedPrincipal::fromTerminal('operator', 'example.com')->toArray(); self::assertArrayNotHasKey('method', array_filter($arr, static fn ($v) => $v !== null)); self::assertFalse(VerifiedPrincipal::fromArray($arr)->toFacts()->verified); diff --git a/tests/InvocationContextTest.php b/tests/InvocationContextTest.php index c64bc23..4c773d2 100644 --- a/tests/InvocationContextTest.php +++ b/tests/InvocationContextTest.php @@ -33,12 +33,12 @@ final class InvocationContextTest extends TestCase */ public function testATerminalBringsAnExecutorAndNoActor(): void { - $ctx = InvocationContext::cli('rod@laptop', 'req-1'); + $ctx = InvocationContext::cli('operator@example.com', 'req-1'); self::assertNull($ctx->actor); self::assertFalse($ctx->verified); self::assertSame('cli', $ctx->channel); - self::assertSame('rod@laptop', $ctx->executor); + self::assertSame('operator@example.com', $ctx->executor); self::assertSame('req-1', $ctx->correlationId); self::assertFalse($ctx->isAttributable(), 'y por eso no puede firmar nada que exija atribución'); }