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: 11 additions & 0 deletions KNOWLEDGE_BASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This file documents the platform's features, stack, and stories. Feature entries
- [Following, Latest, and Trending logs](#following-latest-and-trending-logs)
- [Searching developers, organizations, and commits](#searching-developers-organizations-and-commits)
- [Writing commits](#writing-commits)
- [Contributor requests](#contributor-requests)
- [Translating commits](#translating-commits)
- [Code, emoji, and mentions](#code-emoji-and-mentions)
- [Draft previews](#draft-previews)
Expand Down Expand Up @@ -229,6 +230,16 @@ Sources: [search page](resources/js/pages/search/index.tsx), [commit search quer

Livestream history: the team agreed to build semantic search on [day two at 2:57:59](https://www.youtube.com/watch?v=nfmVdXZfzUE&t=10679s). The discussion connects immutable commits with simpler embeddings: editing would require re-embedding, versioning, and reconsidering notifications. At the time they deferred editing and versioning “for now”; the decision is now final: commit editing will never be added.

### Contributor requests

The **Help wanted** board at `/help-wanted` lists requests for coding, testing, documentation, design, or feedback on GitHub projects. Guests can read approved requests. Filter by kind and open, filled, or all requests; pages contain up to 12 items, newest first.

Signed-in developers post a request at `/help-wanted/create` with a description and an HTTPS `github.com/owner/repository` or issue URL. The description and project link become an ordinary immutable commit, subject to the same commit validation, rules acceptance, shared posting rate limit, timeouts, moderation, mutes, and blocks. Pending or rejected requests are visible only to their author on the board. Linking a project does not establish ownership or verify its visibility on GitHub. Replies use the normal commit thread.

Only the author can mark a request filled or reopen it. Its description, kind, and project link cannot be edited. Deleting its commit hides the request; deleting the account removes its request records. Private JSON exports include the account's request metadata in schema version 10.

The JSON API exposes `GET /api/v1/help-wanted` with optional `kind` and `status` filters, and signed `POST /api/v1/help-wanted` and `PUT /api/v1/help-wanted/{contributorRequest}` for creation and status changes. These use the same validation, visibility, and ownership rules as the web.

### Writing commits

A **commit** is a post on /dev/null, not a Git commit in a repository. Open the composer or press **c**, write your update, and choose **Commit** or press **⌘/Ctrl+Enter**. Text-only commits accept 1–4,000 characters; as you type, the ring around your avatar in the composer fills toward that limit. On the web and in the app, an image attachment makes the text optional (terminal commits still need text), but the 4,000-character maximum still applies. Runs of blank lines outside code collapse to one before the length is checked. Lists fold posts longer than 280 characters or 8 lines behind **Show more**. When a commit starts with a code block too long to fit, its first lines fade out to show that the code continues. **Show more** reveals the full snippet, and the copy control copies the whole block even while folded. Commits can be created and deleted, but not edited after publication. There are no plans to add commit editing, and it will never be added: to change a commit, delete it and post a new one.
Expand Down
1 change: 1 addition & 0 deletions PRODUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ What exists, one line each (details in the knowledge base):

- **Commits:** text with code, images, link cards and embedded players, or a poll; replies, quotes, threads, scheduling, translation.
- **Logs:** Following, Latest, and Trending.
- **Help wanted:** public contributor requests for GitHub projects, grouped by the kind of help needed, with owner-managed open and filled status.
- **Engagement:** follows, stars, saved commits, pins, mentions, and pastéis (an opt-in daily allowance of pastries).
- **Profiles:** mirrored from GitHub, with an activity graph, streaks, achievements, a Unix rank, and a live marker while you stream on YouTube.
- **Link pages:** every https link has a page listing the commits that use it as their card; once two people talk about a link, its cards and commit pages lead there.
Expand Down
26 changes: 26 additions & 0 deletions app/Actions/CreateContributorRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace App\Actions;

use App\Enums\ContributorHelp;
use App\Models\ContributorRequest;
use App\Models\User;
use Illuminate\Support\Facades\DB;

final readonly class CreateContributorRequest
{
public function __construct(private CreateCommit $commits) {}

public function handle(User $user, string $body, string $projectUrl, ContributorHelp $kind): ContributorRequest
{
return DB::transaction(function () use ($user, $body, $projectUrl, $kind): ContributorRequest {
$commit = $this->commits->handle($user, $body, linkPreview: false);

return ContributorRequest::query()->create([
'user_id' => $user->id, 'commit_id' => $commit->id, 'project_url' => $projectUrl, 'kind' => $kind,
]);
});
}
}
19 changes: 18 additions & 1 deletion app/Actions/CreateExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use App\Models\Commit;
use App\Models\CommitImage;
use App\Models\CommitReport;
use App\Models\ContributorRequest;
use App\Models\Conversation;
use App\Models\ConversationParticipant;
use App\Models\Device;
Expand Down Expand Up @@ -43,6 +44,7 @@
* schema_version: int,
* exported_at: string,
* profile: array<string, bool|int|string|null>,
* contributor_requests: Generator<int, array{commit_id: string, project_url: string, kind: string, status: string, filled_at: string|null, created_at: string}>,
* active_days: Generator<int, ExportActiveDay>,
* commits: Generator<int, array<string, mixed>>,
* organization_commits: Generator<int, array<string, mixed>>,
Expand Down Expand Up @@ -86,7 +88,7 @@
public function handle(User $user): array
{
return [
'schema_version' => 9,
'schema_version' => 10,
'exported_at' => now()->toIso8601String(),
'profile' => [
'github_id' => $user->github_id,
Expand Down Expand Up @@ -128,6 +130,7 @@ public function handle(User $user): array
'updated_at' => $user->updated_at->toIso8601String(),
],
'active_days' => $this->activeDays($user),
'contributor_requests' => $this->contributorRequests($user),
'commits' => $this->commits($user),
'organization_commits' => $this->organizationCommits($user),
'polls' => $this->polls($user),
Expand Down Expand Up @@ -226,6 +229,20 @@ public function handle(User $user): array
];
}

/**
* @return Generator<int, array{commit_id: string, project_url: string, kind: string, status: string, filled_at: string|null, created_at: string}>
*/
private function contributorRequests(User $user): Generator
{
foreach (ContributorRequest::query()->where('user_id', $user->id)->oldest()->oldest('id')->cursor() as $item) {
yield [
'commit_id' => $item->commit_id, 'project_url' => $item->project_url,
'kind' => $item->kind->value, 'status' => $item->status->value,
'filled_at' => $item->filled_at?->toIso8601String(), 'created_at' => $item->created_at->toIso8601String(),
];
}
}

/**
* @return Generator<int, array<string, mixed>>
*/
Expand Down
21 changes: 21 additions & 0 deletions app/Actions/UpdateContributorRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

declare(strict_types=1);

namespace App\Actions;

use App\Enums\ContributorRequestStatus;
use App\Models\ContributorRequest;

final readonly class UpdateContributorRequest
{
public function handle(ContributorRequest $request, ContributorRequestStatus $status): void
{
// Change availability, never the already moderated commit or project description.
ContributorRequest::query()->whereKey($request->id)->where('status', '!=', $status)->update([
'status' => $status,
'filled_at' => $status === ContributorRequestStatus::Filled ? now() : null,
]);
$request->refresh();
}
}
19 changes: 19 additions & 0 deletions app/Enums/ContributorHelp.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

declare(strict_types=1);

namespace App\Enums;

enum ContributorHelp: string
{
case Coding = 'coding';
case Testing = 'testing';
case Documentation = 'documentation';
case Design = 'design';
case Feedback = 'feedback';

public function label(): string
{
return ucfirst($this->value);
}
}
11 changes: 11 additions & 0 deletions app/Enums/ContributorRequestStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

namespace App\Enums;

enum ContributorRequestStatus: string
{
case Open = 'open';
case Filled = 'filled';
}
44 changes: 44 additions & 0 deletions app/Http/Controllers/Api/ContributorRequestController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

declare(strict_types=1);

namespace App\Http\Controllers\Api;

use App\Actions\CreateContributorRequest;
use App\Actions\UpdateContributorRequest;
use App\Enums\ContributorHelp;
use App\Enums\ContributorRequestStatus;
use App\Http\Requests\CreateContributorRequestRequest;
use App\Http\Requests\ListContributorRequestsRequest;
use App\Http\Requests\UpdateContributorRequestRequest;
use App\Http\Resources\ContributorRequestResource;
use App\Models\ContributorRequest;
use App\Models\User;
use App\Queries\ContributorRequestsQuery;
use Illuminate\Container\Attributes\CurrentUser;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;

final readonly class ContributorRequestController
{
public function index(ListContributorRequestsRequest $request, #[CurrentUser] ?User $user, ContributorRequestsQuery $requests): AnonymousResourceCollection
{
return ContributorRequestResource::collection($requests->builder(
$user, $request->enum('kind', ContributorHelp::class), $request->string('status', 'open')->value(),
)->paginate(12)->withQueryString());
}

public function store(CreateContributorRequestRequest $request, #[CurrentUser] User $user, CreateContributorRequest $action, ContributorRequestsQuery $requests): JsonResponse
{
$item = $action->handle($user, $request->string('body')->value(), $request->string('project_url')->value(), ContributorHelp::from($request->string('kind')->value()));

return ContributorRequestResource::make($requests->builder($user, status: 'all')->findOrFail($item->id))->response()->setStatusCode(201);
}

public function update(UpdateContributorRequestRequest $request, #[CurrentUser] User $user, ContributorRequest $contributorRequest, UpdateContributorRequest $action, ContributorRequestsQuery $requests): ContributorRequestResource
{
$action->handle($contributorRequest, ContributorRequestStatus::from($request->string('status')->value()));

return ContributorRequestResource::make($requests->builder($user, status: 'all')->findOrFail($contributorRequest->id));
}
}
60 changes: 60 additions & 0 deletions app/Http/Controllers/ContributorRequestController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php

declare(strict_types=1);

namespace App\Http\Controllers;

use App\Actions\CreateContributorRequest;
use App\Actions\UpdateContributorRequest;
use App\Enums\CommitStatus;
use App\Enums\ContributorHelp;
use App\Enums\ContributorRequestStatus;
use App\Http\Requests\CreateContributorRequestRequest;
use App\Http\Requests\ListContributorRequestsRequest;
use App\Http\Requests\UpdateContributorRequestRequest;
use App\Http\Resources\ContributorRequestResource;
use App\Models\ContributorRequest;
use App\Models\User;
use App\Queries\ContributorRequestsQuery;
use Illuminate\Container\Attributes\CurrentUser;
use Illuminate\Http\RedirectResponse;
use Inertia\Inertia;
use Inertia\Response;

final readonly class ContributorRequestController
{
public function index(ListContributorRequestsRequest $request, #[CurrentUser] ?User $user, ContributorRequestsQuery $requests): Response
{
$kind = $request->enum('kind', ContributorHelp::class);
$status = $request->string('status', 'open')->value();

return Inertia::render('contributor-request/index', [
'requests' => $requests->builder($user, $kind, $status)->paginate(12)->withQueryString()
->through(fn (ContributorRequest $item): array => ContributorRequestResource::make($item)->resolve($request)),
'filters' => ['kind' => $kind?->value, 'status' => $status],
]);
}

public function create(): Response
{
return Inertia::render('contributor-request/create');
}

public function store(CreateContributorRequestRequest $request, #[CurrentUser] User $user, CreateContributorRequest $action): RedirectResponse
{
$item = $action->handle($user, $request->string('body')->value(), $request->string('project_url')->value(), ContributorHelp::from($request->string('kind')->value()));
$pending = $item->commit?->status === CommitStatus::Pending;
Inertia::flash('toast', ['type' => $pending ? 'info' : 'success', 'message' => $pending
? 'Request posted. Only you can see it until moderation approves it.' : 'Contributor request posted.']);

return to_route('contributor-request.index');
}

public function update(UpdateContributorRequestRequest $request, ContributorRequest $contributorRequest, UpdateContributorRequest $action): RedirectResponse
{
$action->handle($contributorRequest, ContributorRequestStatus::from($request->string('status')->value()));
Inertia::flash('toast', ['type' => 'success', 'message' => $contributorRequest->status === ContributorRequestStatus::Filled ? 'Request marked as filled.' : 'Request reopened.']);

return back();
}
}
2 changes: 1 addition & 1 deletion app/Http/Middleware/ThrottleCommits.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private function slowDown(Request $request, int $retryAfter): Response
}

// The mobile app reads JSON with a code...
if ($request->routeIs('api-commit.store')) {
if ($request->routeIs('api-commit.store', 'api-contributor-request.store')) {
return new ApiException(ApiErrorCode::RateLimited, $message, ['Retry-After' => $retryAfter])->render();
}

Expand Down
41 changes: 41 additions & 0 deletions app/Http/Requests/CreateContributorRequestRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

namespace App\Http\Requests;

use App\Enums\ContributorHelp;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Illuminate\Validation\Rules\Enum;

/** Web and signed API creation share normalization, commit limits, and GitHub URL validation. */
final class CreateContributorRequestRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}

public function prepareForValidation(): void
{
CreateCommitRequest::normalizeBody($this);
$url = $this->input('project_url');

// The project link also belongs in the immutable commit, including in ordinary logs and threads.
if (is_string($url) && mb_strlen($url) <= 255 && is_string($this->input('body')) && mb_trim($this->string('body')->value()) !== '') {
$this->merge(['body' => $this->string('body')->value()."\n\n".mb_trim($url), 'project_url' => mb_trim($url)]);
}
}

/** @return array<string, list<string|ValidationRule|Enum>> */
public function rules(): array
{
return [
'body' => CreateCommitRequest::bodyRules(),
'project_url' => ['required', 'string', 'max:255', 'regex:~\Ahttps://github\.com/[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}/(?!\.{1,2}(?:/|$))[a-z\d_.-]+(?:/issues/[1-9]\d*)?/?\z~i'],
'kind' => ['required', Rule::enum(ContributorHelp::class)],
];
}
}
28 changes: 28 additions & 0 deletions app/Http/Requests/ListContributorRequestsRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace App\Http\Requests;

use App\Enums\ContributorHelp;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Illuminate\Validation\Rules\Enum;
use Illuminate\Validation\Rules\In;

final class ListContributorRequestsRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}

/** @return array<string, list<string|Enum|In>> */
public function rules(): array
{
return [
'kind' => ['nullable', Rule::enum(ContributorHelp::class)],
'status' => ['sometimes', 'required', Rule::in(['open', 'filled', 'all'])],
];
}
}
29 changes: 29 additions & 0 deletions app/Http/Requests/UpdateContributorRequestRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace App\Http\Requests;

use App\Enums\ContributorRequestStatus;
use App\Models\ContributorRequest;
use App\Models\User;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Illuminate\Validation\Rules\Enum;

final class UpdateContributorRequestRequest extends FormRequest
{
public function authorize(): bool
{
$item = $this->route('contributorRequest');
$user = $this->user();

return $item instanceof ContributorRequest && $user instanceof User && $item->user_id === $user->id && $item->commit !== null;
}

/** @return array<string, list<string|Enum>> */
public function rules(): array
{
return ['status' => ['required', Rule::enum(ContributorRequestStatus::class)]];
}
}
Loading