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
11 changes: 8 additions & 3 deletions KNOWLEDGE_BASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ This file documents the platform's features, stack, and stories. Feature entries
- [Signed API and devices](#signed-api-and-devices)
- [Terminal app](#terminal-app)
- [Bug reports and feature requests](#bug-reports-and-feature-requests)
- [Guilds](#guilds)
- [Exporting your data](#exporting-your-data)
- [Deleting your account](#deleting-your-account)
- [Moderation](#moderation)
Expand Down Expand Up @@ -657,9 +658,13 @@ Successful issue creation is limited to **ten issues per day per user**, shared

Sources: [issue command UI](resources/js/components/issue-command.tsx), [issue validation](app/Http/Requests/CreateIssueRequest.php), [issue controller](app/Http/Controllers/IssueController.php), [daily limit](app/Http/Middleware/ThrottleIssues.php), [API issue controller](app/Http/Controllers/Api/IssueController.php).

### Guilds (preview)
### Guilds

Guilds are public groups around hashtags and are not generally available yet. In the preview, matching hashtags become small clickable guild labels; ordinary hashtags still open search. Create a guild from the Guilds overview or a hashtag's search page. From the overview, its display name determines the hashtag: “Laravel 4ever” becomes `#laravel4ever`. Display names and handles each allow up to 60 characters. When claiming a hashtag, the display name must match its letters, numbers and underscores, ignoring case; spaces, punctuation and decorative symbols are ignored, so `/dev/null` is valid for `#devnull`. Accents and underscores remain significant. Its creator joins automatically and maintains its display name, icon and description; a new display name must still match the hashtag, so `#adhd` can become “ADHD” but never another hashtag. Each person can create up to 100 guilds. A guild's name, description and icon pass the same automated moderation as commits before the guild is published or edited. When the moderation flags a new guild or an edit, it waits for an admin to review it instead: nothing of it is public until it is approved, the guild keeps its current details meanwhile, and a rejected submission is discarded. Submitting again for the same hashtag replaces the one still waiting, and new guilds waiting for review count toward the creation limit.
Guilds are public groups around hashtags, where matching hashtags become small clickable guild labels; ordinary hashtags still open search. Create a guild from the Guilds overview or a hashtag's search page.

From the overview, a guild's display name determines the hashtag: “Laravel 4ever” becomes `#laravel4ever`. Display names and handles each allow up to 60 characters. When claiming a hashtag, the display name must match its letters, numbers and underscores, ignoring case; spaces, punctuation and decorative symbols are ignored, so `/dev/null` is valid for `#devnull`. Accents and underscores remain significant.

The guild's creator joins automatically and maintains its display name, icon and description; a new display name must still match the hashtag, so `#adhd` can become “ADHD” but never another hashtag. Each person can create up to 100 guilds. A guild's name, description and icon pass the same automated moderation as commits before the guild is published or edited. When the moderation flags a new guild or an edit to an existing guild, it waits for an admin to review it instead: nothing of it is public until it is approved, the guild keeps its current details meanwhile, and a rejected submission is discarded. Submitting again for the same hashtag replaces the one still waiting, and new guilds waiting for review count toward the per-user guild creation limit.

The Guilds page lists groups by member count, with 24 guilds per page. Search matches keywords in guild names, handles, and descriptions, ignoring case; a leading `#` is optional. This directory search is keyword-based, not semantic. Click a guild's member count to browse its members: the moderator appears first, labeled “(moderator)”, followed by newest joins, with 50 people per page and Load more for the next page. Joining adds matching commits to Following without following every author and clears any existing mute. When a commit appears only because of a joined guild, it says “because you joined” beside the guild label. Leave a guild to reveal its Mute control. Muting hides matching commits from logs and search, including commits by followed authors. You can still open the guild or a commit directly.

Expand Down Expand Up @@ -700,7 +705,7 @@ You can sign in with GitHub again later, but start from a new account rather tha

As the privacy policy explains, timeout and ban records retain your GitHub account id, reason, and dates after account deletion, so deleting and recreating an account cannot evade those restrictions. Your GitHub account id is also kept until you sign in again, only so that your page doesn't come back as one of a developer not on /dev/null yet. Deleted content may also remain in backups and logs for a period.

For guilds, which are not generally available yet, a moderator removal retains only the GitHub account ID, hashtag and removal date after account deletion, so the same GitHub account cannot reclaim that guild. Guild descriptions, icons and reports are not retained by that restriction.
For guilds, a moderator removal retains only the GitHub account ID, hashtag and removal date after account deletion, so the same GitHub account cannot reclaim that guild. Guild descriptions, icons and reports are not retained by that restriction.

Sources: [account deletion confirmation](resources/js/components/delete-user.tsx), [account deletion](app/Actions/DeleteUser.php), [privacy policy](resources/js/pages/privacy/show.tsx).

Expand Down
2 changes: 1 addition & 1 deletion PRODUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ What exists, one line each (details in the knowledge base):
- **Remotes:** private one-to-one and group messages (orgs), and calls, one-to-one or in an org.
- **Notifications:** in-app activity and on-site Remotes alerts by default; off-site browser and PWA notifications require a separate opt-in. Sound is controlled independently and plays while the site is open.
- **Search:** developers by name, commits by meaning.
- **Guilds (preview):** public communities around hashtags; creators maintain their display name, icon and description. Not generally available yet.
- **Guilds:** public communities around hashtags; creators maintain their display name, icon and description.
- **Emails:** an occasional update the admins write to everyone, or to a filtered audience, with one-click unsubscribe. Never per-activity notifications.
- **Safety:** mute, block, reports, and moderation.
- **Bots:** Tom answers questions about /dev/null from the knowledge base, the public repository, and aggregate community statistics; World answers "hello world". They use @tom and @world until those GitHub owners sign in, then keep working as @devnull-tom and @devnull-world.
Expand Down
16 changes: 14 additions & 2 deletions app/Services/Features.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Illuminate\Support\Facades\DB;

/**
* Only explicit overrides are stored; guilds default to an admin preview, other features to everyone.
* Only explicit overrides are stored; every feature defaults to everyone, unless adminOnlyByDefault() lists it.
*/
final readonly class Features
{
Expand All @@ -24,7 +24,7 @@ public function enabled(Feature $feature): bool

public function adminOnly(Feature $feature): bool
{
return $this->switched()[$feature->value]['admin_only'] ?? $feature === Feature::Guilds;
return $this->switched()[$feature->value]['admin_only'] ?? in_array($feature, $this->adminOnlyByDefault(), true);
}

public function available(Feature $feature, ?User $user): bool
Expand Down Expand Up @@ -53,6 +53,18 @@ public function update(Feature $feature, bool $enabled, ?bool $adminOnly = null)
Cache::memo()->forget(self::CACHE_KEY);
}

/**
* Features that default to admins only until an override opens them.
*
* @return list<Feature>
*/
private function adminOnlyByDefault(): array
{
return [
// e.g. Feature::Guilds
];
}

/** @return array<string, array{enabled: bool, admin_only: bool}> */
private function switched(): array
{
Expand Down
2 changes: 1 addition & 1 deletion resources/js/pages/operations/features.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const FEATURES: Record<
guilds: {
label: 'guilds',
description:
'Public guild pages, creation, editing, and inline hashtag chips. Choose who can use the preview.',
'Public guild pages, creation, editing, and inline hashtag chips. Choose who can use them.',
},
};

Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Controllers/Api/CommitControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@

return [];
}],
'admin preview' => [function (): array {
'admins only' => [function (): array {
resolve(Features::class)->update(Feature::Guilds, true, adminOnly: true);

return [];
Expand Down
6 changes: 3 additions & 3 deletions tests/Feature/Controllers/Api/GuildControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@

signedApiRequest($this->keyPair, 'GET', route('api-guild.index'))->assertNotFound();
})->with([
'admin preview' => [true, true],
'admins only' => [true, true],
'switched off' => [false, false],
]);

it('lists guilds for admins during the admin preview', function (): void {
it('lists guilds for admins while guilds are admin-only', function (): void {
config(['app.admins' => [$this->user->handle]]);
resolve(Features::class)->update(Feature::Guilds, true, adminOnly: true);
Guild::factory()->create(['handle' => 'rust']);
Expand Down Expand Up @@ -248,7 +248,7 @@
signedApiRequest($this->keyPair, 'GET', route('api-guild.show', $handle))->assertNotFound();
})->with([
'unknown guild' => [false, 'go'],
'admin preview' => [true, 'rust'],
'admins only' => [true, 'rust'],
]);

it('creates a guild from its display name, with the user as its moderator and first member', function (): void {
Expand Down
28 changes: 21 additions & 7 deletions tests/Feature/Controllers/FeatureControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
->assertOk()
->assertInertia(fn ($page) => $page
->component('operations/features')
->where('features', [['name' => 'translations', 'enabled' => true, 'admin_only' => false], ['name' => 'guilds', 'enabled' => true, 'admin_only' => true]]));
->where('features', [
['name' => 'translations', 'enabled' => true, 'admin_only' => false],
['name' => 'guilds', 'enabled' => true, 'admin_only' => false],
]));
});

it('hides the features from non admins', function (): void {
Expand All @@ -37,7 +40,7 @@
$admin = User::factory()->create(['handle' => 'admin']);

$this->actingAs($admin)->get(route('feature.index'))
->assertInertia(fn ($page) => $page->where('features', [['name' => 'translations', 'enabled' => true, 'admin_only' => false], ['name' => 'guilds', 'enabled' => true, 'admin_only' => true]]));
->assertInertia(fn ($page) => $page->where('features', [['name' => 'translations', 'enabled' => true, 'admin_only' => false], ['name' => 'guilds', 'enabled' => true, 'admin_only' => false]]));

$this->fromRoute('feature.index')
->put(route('feature.update', 'translations'), ['enabled' => false])
Expand All @@ -46,7 +49,7 @@
expect(resolve(Features::class)->enabled(Feature::Translations))->toBeFalse();
$this->assertDatabaseHas('features', ['name' => 'translations', 'enabled' => false]);
$this->get(route('feature.index'))
->assertInertia(fn ($page) => $page->where('features', [['name' => 'translations', 'enabled' => false, 'admin_only' => false], ['name' => 'guilds', 'enabled' => true, 'admin_only' => true]]));
->assertInertia(fn ($page) => $page->where('features', [['name' => 'translations', 'enabled' => false, 'admin_only' => false], ['name' => 'guilds', 'enabled' => true, 'admin_only' => false]]));

$this->put(route('feature.update', 'translations'), ['enabled' => true])->assertRedirect();

Expand Down Expand Up @@ -91,21 +94,32 @@
$guild = Guild::factory()->create();
Event::fake([UsersUpdated::class]);

// Open by default
$this->actingAs($member)->get(route('guild.show', $guild->handle))->assertOk();

// Switch to Admins only
$this->actingAs($admin)->put(route('feature.update', Feature::Guilds), ['enabled' => true, 'admin_only' => true])->assertRedirect();
$this->get(route('guild.show', $guild->handle))->assertOk();
$this->actingAs($member)->get(route('guild.show', $guild->handle))->assertNotFound();

// Switch off, keeping Admins for when it's back on
$this->actingAs($admin)->put(route('feature.update', Feature::Guilds), ['enabled' => false])->assertRedirect();
$this->get(route('guild.show', $guild->handle))->assertNotFound();
$this->assertDatabaseHas('features', ['name' => 'guilds', 'enabled' => false, 'admin_only' => true]);

// Switch back to everyone (reopened)
$this->actingAs($admin)->put(route('feature.update', Feature::Guilds), ['enabled' => true, 'admin_only' => false])->assertRedirect();
$this->actingAs($member)->get(route('guild.show', $guild->handle))->assertOk();
$this->post(route('guild.store'), ['name' => 'New Guild', 'description' => 'Open to everyone.', 'emoji' => '💻'])->assertRedirectToRoute('guild.show', 'newguild');
$this->assertDatabaseHas('guilds', ['handle' => 'newguild', 'user_id' => $member->id]);
Event::assertDispatched(UsersUpdated::class, fn (UsersUpdated $event): bool => $event->update === UserUpdate::Guilds && in_array($member->id, $event->userIds, true));
Event::assertDispatched(UsersUpdated::class, fn (UsersUpdated $event): bool => $event->update === UserUpdate::Relationships && in_array($member->id, $event->userIds, true));

$this->actingAs($admin)->put(route('feature.update', Feature::Guilds), ['enabled' => true, 'admin_only' => true])->assertRedirect();
$this->get(route('guild.show', $guild->handle))->assertOk();
$this->actingAs($member)->get(route('guild.show', $guild->handle))->assertNotFound();
// Switch to Disabled
$this->actingAs($admin)->put(route('feature.update', Feature::Guilds), ['enabled' => false])->assertRedirect();
$this->get(route('guild.show', $guild->handle))->assertNotFound();
$this->actingAs($member)->get(route('guild.show', $guild->handle))->assertNotFound();
$this->assertDatabaseHas('features', ['name' => 'guilds', 'enabled' => false, 'admin_only' => true]);
$this->assertDatabaseHas('features', ['name' => 'guilds', 'enabled' => false, 'admin_only' => false]);
});

it('rejects an invalid audience without changing access', function (): void {
Expand Down
27 changes: 21 additions & 6 deletions tests/Feature/Controllers/GuildControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use App\Models\ScheduledCommit;
use App\Models\User;
use App\Queries\LogCommitsQuery;
use App\Services\Features;
use Illuminate\Database\Events\QueryExecuted;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\DB;
Expand Down Expand Up @@ -91,6 +92,11 @@
});

it('does not let bulletin board context bypass validation', function (string $route, array $payload, bool $admin, string $field): void {
if (! $admin) {
// Guilds default to everyone; make them admin-only to check that setting still keeps members out.
resolve(Features::class)->update(Feature::Guilds, true, true);
}

Guild::factory()->create(['handle' => 'rust']);
$this->actingAs(User::factory()->create(['handle' => $admin ? 'admin' : 'member']))
->postJson(route($route), ['body' => 'Hello', 'guild_handle' => 'rust', 'scheduled_at' => now()->addHour()->toIso8601String(), ...$payload])
Expand All @@ -102,7 +108,7 @@
'empty text' => [['body' => ''], true, 'body'],
'missing guild' => [['guild_handle' => 'missing'], true, 'guild_handle'],
'invalid context' => [['guild_handle' => ['rust']], true, 'guild_handle'],
'not available' => [[], false, 'guild_handle'],
'admins only' => [[], false, 'guild_handle'],
]);

it('creates a public guild and gives only its creator moderation controls', function (): void {
Expand All @@ -126,7 +132,9 @@
->get(route('guild.show', 'jobs'))->assertOk()->assertInertia(fn ($page) => $page->where('canModerate', false));
});

it('hides guild data and every guild endpoint from ordinary members', function (): void {
it('hides guild data and every guild endpoint from ordinary members while guilds are admin-only', function (): void {
// Guilds default to everyone; make them admin-only to check that setting still keeps members out.
resolve(Features::class)->update(Feature::Guilds, true, true);
$user = User::factory()->create();
$guild = Guild::factory()->create(['user_id' => $user->id]);

Expand Down Expand Up @@ -173,7 +181,7 @@
$this->putJson(route('guild.update', $guild->handle), [])->assertUnauthorized();
});

it('switches off the entire preview even for its admin creator', function (): void {
it('switches off guilds entirely, even for an admin creator', function (): void {
$admin = User::factory()->create(['handle' => 'admin']);
$guild = Guild::factory()->create(['user_id' => $admin->id]);
$this->actingAs($admin)->put(route('feature.update', Feature::Guilds), ['enabled' => false])->assertRedirect();
Expand Down Expand Up @@ -468,8 +476,13 @@
$this->assertDatabaseCount('guilds', 0);
});

it('gates reporting removal and review behind the admin preview', function (bool $disabled): void {
it('gates reporting removal and review behind guild access', function (bool $disabled): void {
$user = User::factory()->create(['handle' => $disabled ? 'admin' : 'ordinary']);
if (! $disabled) {
// Guilds default to everyone; make them admin-only to check that setting still keeps members out.
resolve(Features::class)->update(Feature::Guilds, true, true);
}

$guild = Guild::factory()->create();
resolve(CreateGuildReport::class)->handle($user, $guild, 'Unrelated description.');
$report = GuildReport::query()->sole();
Expand Down Expand Up @@ -710,7 +723,9 @@
'large page' => [['page' => 10001], 'page'],
]);

it('guards guild discovery and preferences with the preview flag and validates boolean inputs', function (): void {
it('guards guild discovery and preferences with the guilds flag and validates boolean inputs', function (): void {
// Guilds default to everyone; make them admin-only to check that setting still keeps members out.
resolve(Features::class)->update(Feature::Guilds, true, true);
$guild = Guild::factory()->create();
$this->get(route('guild.index'))->assertRedirectToRoute('home');
$this->putJson(route('guild-membership.update', $guild), ['joined' => true])->assertUnauthorized();
Expand Down Expand Up @@ -1083,7 +1098,7 @@
Storage::assertMissing('guild-icons/pending.webp');
})->with(['removed moderator' => true, 'claimed by someone else' => false]);

it('leaves reviewing guild submissions to admins with the preview', function (bool $disabled): void {
it('leaves reviewing guild submissions to admins while guilds are on', function (bool $disabled): void {
Storage::fake();
$admin = User::factory()->create(['handle' => 'admin']);
$user = $disabled ? $admin : User::factory()->create(['handle' => 'ordinary']);
Expand Down
7 changes: 6 additions & 1 deletion tests/Feature/Controllers/GuildMembershipControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

declare(strict_types=1);

use App\Enums\Feature;
use App\Models\Guild;
use App\Models\User;
use App\Services\Features;

beforeEach(function (): void {
config(['app.admins' => ['admin']]);
Expand Down Expand Up @@ -57,10 +59,13 @@
->assertOk()->assertInertia(fn ($page) => $page->has('users.data', 1)->where('users.data.0.id', $viewer->id)->where('users.data.0.is_moderator', false));
});

it('requires sign in and the guild preview feature to list members', function (): void {
it('requires sign in and guild access to list members', function (): void {
$guild = Guild::factory()->create();

$this->get(route('guild-membership.index', $guild->handle))->assertRedirectToRoute('home');

// Guilds default to everyone; make them admin-only to check that setting still keeps members out.
resolve(Features::class)->update(Feature::Guilds, true, adminOnly: true);
$this->actingAs(User::factory()->create())->get(route('guild-membership.index', $guild->handle))->assertNotFound();
});

Expand Down
Loading