From 107dd2342c616c737a77173972d930d981837e2c Mon Sep 17 00:00:00 2001 From: Seth Carlson <66243744+sdcarlson@users.noreply.github.com> Date: Sat, 26 Sep 2026 12:39:02 -0700 Subject: [PATCH 1/5] Reduce Relay to the supervised pilot loop --- ARCHITECTURE.md | 67 +- LAUNCH.md | 16 +- README.md | 207 +-- app/about/page.tsx | 83 +- app/advanced/page.tsx | 43 - app/advanced/plan/page.tsx | 204 --- app/advanced/preferences/page.tsx | 321 ---- app/advanced/review/page.tsx | 465 ----- app/agent-session.tsx | 206 --- app/agent-tools.ts | 38 +- app/api/agents/route.ts | 122 -- app/api/drafts/route.ts | 272 --- app/api/outcomes/route.ts | 70 +- app/api/plan/route.ts | 115 -- app/api/preferences/route.ts | 156 -- app/api/readiness/route.ts | 54 - app/connections.tsx | 4 +- app/plan/page.tsx | 5 - app/preferences/page.tsx | 5 - app/privacy/page.tsx | 96 +- app/profile/page.tsx | 25 +- app/review/page.tsx | 5 - app/runtime-modals.tsx | 116 +- app/runtime-shell.tsx | 15 - app/shell.tsx | 6 +- app/track/page.tsx | 88 +- app/workspace-job-panel.tsx | 15 +- app/workspace-runtime.tsx | 194 +-- app/workspace.tsx | 18 - db/env.d.ts | 8 - db/schema.ts | 14 +- deploy/security.mjs | 7 +- docs/PUBLIC-COPY.md | 2 +- docs/abuse-controls.md | 7 +- docs/agent-applications.md | 6 +- docs/delivery.md | 2 +- docs/development/CONTEXT.md | 2 +- ...-09-07-application-runtime-plant-design.md | 6 +- .../product-trust-2026-09-06.md} | 4 +- docs/pilot-throughput.md | 4 +- docs/pilot/measurement.md | 2 +- docs/pilot/next-product-tasks.md | 4 +- docs/public-copy.json | 60 +- ...6-09-11-supervised-runtime-send-choices.md | 2 +- docs/threat-model.md | 2 +- integrations/ASSISTANT-WORKFLOW.md | 8 +- integrations/GROK_BOT.md | 125 +- integrations/OPENAI.md | 6 +- integrations/README.md | 186 +- integrations/cli.mjs | 278 +-- integrations/client.mjs | 4 +- integrations/connectors.mjs | 32 - integrations/relay.mjs | 16 +- lib/agent-runtime-admission.ts | 160 -- lib/agent-runtime-control.ts | 1188 ------------- lib/agent-runtime-memory.ts | 276 --- lib/agent-runtime-openai.ts | 290 ---- lib/agent-runtime-park.ts | 62 - lib/agent-runtime-tools.ts | 126 -- lib/agent-runtime-view.ts | 82 - lib/agent-runtime.ts | 96 -- lib/application-context.ts | 6 +- lib/nav.ts | 19 +- lib/outcomes.ts | 51 +- lib/postings.ts | 268 --- lib/profile.ts | 393 +---- lib/readiness.ts | 139 -- lib/runtime.ts | 32 - lib/scoring.ts | 111 -- lib/store.ts | 66 +- lib/utility.ts | 186 -- lib/workspace-stage.ts | 11 +- package.json | 1 - scripts/ci/run-integration.mjs | 3 +- scripts/ci/run-production.mjs | 11 - scripts/ci/run-unit.mjs | 3 +- scripts/release/config.mjs | 21 - scripts/sync-public-copy.mjs | 2 +- tests/advanced-routes.test.mjs | 77 - tests/agent-runtime-openai.test.mjs | 271 --- tests/agent-runtime.test.mjs | 1489 ----------------- tests/agent-tools-fallback.test.mjs | 2 +- tests/calibration.test.mjs | 205 --- tests/cli-live.test.mjs | 125 +- tests/cli.test.mjs | 201 +-- tests/connectors.test.mjs | 56 - tests/deployment.test.mjs | 16 - tests/e2e/advanced-routes.spec.ts | 24 - tests/e2e/agent-session-expiry.spec.ts | 154 -- tests/e2e/agent-tools.spec.ts | 2 - tests/e2e/assistant.spec.ts | 4 +- tests/e2e/page-expiry.spec.ts | 136 +- tests/e2e/pilot.spec.ts | 140 +- tests/e2e/privacy.spec.ts | 2 +- tests/e2e/runtime-plant.spec.ts | 31 +- tests/e2e/track-session.spec.ts | 11 +- tests/e2e/track.spec.ts | 4 +- tests/first-job-save.test.mjs | 3 - tests/mutation-body-cap.test.mjs | 2 +- tests/nav.test.mjs | 18 +- tests/orchestration.test.mjs | 203 +-- tests/page-session.test.mjs | 268 +-- tests/privacy-notice.test.mjs | 4 +- tests/profile.test.mjs | 300 ---- tests/public-copy.test.mjs | 18 +- tests/readiness.test.mjs | 413 ----- tests/refresh-expiry.test.mjs | 3 - tests/runtime-context.test.mjs | 782 +-------- tests/runtime-modal-session.test.mjs | 2 - tests/runtime-plant.test.mjs | 34 +- tests/runtime.test.mjs | 38 - tests/security.test.mjs | 47 +- tests/selection.test.mjs | 412 +---- tests/workspace-refresh.test.mjs | 10 - tests/workspace-split.test.mjs | 8 +- tests/workspace-stage.test.mjs | 6 +- 116 files changed, 525 insertions(+), 12417 deletions(-) delete mode 100644 app/advanced/page.tsx delete mode 100644 app/advanced/plan/page.tsx delete mode 100644 app/advanced/preferences/page.tsx delete mode 100644 app/advanced/review/page.tsx delete mode 100644 app/agent-session.tsx delete mode 100644 app/api/agents/route.ts delete mode 100644 app/api/drafts/route.ts delete mode 100644 app/api/plan/route.ts delete mode 100644 app/api/preferences/route.ts delete mode 100644 app/api/readiness/route.ts delete mode 100644 app/plan/page.tsx delete mode 100644 app/preferences/page.tsx delete mode 100644 app/review/page.tsx rename docs/{superpowers/specs => history}/2026-09-07-application-runtime-plant-design.md (86%) rename docs/{product-trust.md => history/product-trust-2026-09-06.md} (95%) delete mode 100644 lib/agent-runtime-admission.ts delete mode 100644 lib/agent-runtime-control.ts delete mode 100644 lib/agent-runtime-memory.ts delete mode 100644 lib/agent-runtime-openai.ts delete mode 100644 lib/agent-runtime-park.ts delete mode 100644 lib/agent-runtime-tools.ts delete mode 100644 lib/agent-runtime-view.ts delete mode 100644 lib/agent-runtime.ts delete mode 100644 lib/postings.ts delete mode 100644 lib/readiness.ts delete mode 100644 lib/scoring.ts delete mode 100644 lib/utility.ts delete mode 100644 tests/advanced-routes.test.mjs delete mode 100644 tests/agent-runtime-openai.test.mjs delete mode 100644 tests/agent-runtime.test.mjs delete mode 100644 tests/calibration.test.mjs delete mode 100644 tests/e2e/advanced-routes.spec.ts delete mode 100644 tests/e2e/agent-session-expiry.spec.ts delete mode 100644 tests/readiness.test.mjs diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index e43387e..f5e6996 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -1,68 +1,33 @@ # Relay architecture -Relay is a supervised application runtime for job research and drafts. **Runtime** (`/`) is the selected-job loop. **Tracker** (`/track`) is the queue and outcome history. Applications, facts, and Advanced are secondary. It stores opportunity history and records approval of exact text. Discovery, note writing, external AI generation and employer Submit remain separate activities. SyberLabs maintains the application. +Relay is a private, owner-scoped job record with explicit assistant handoffs and human-controlled application actions. Its core is one record per job: selected research, user-confirmed facts, draft wording, accepted text, state, and history. -## Runtime and persistence +## Record and ownership -The React interface runs through Vinext. The server runs on Cloudflare Workers with D1 persistence. `app/chatgpt-auth.ts` resolves the identity supplied by the trusted Sites authentication gateway. `/api/workspace` scopes reads and mutations to that owner. The local development sign-in is simulated and must not be exposed publicly. +The React application runs on Vinext and Cloudflare Workers, with D1 persistence. Production identity comes from the trusted Cloudflare Access gateway; local sign-in is a development mock and must not be exposed. -`jobs` stores canonical posting identity, status, draft, accepted text, blockers and version. `observations` preserves imported source records and revisions. `events` records workspace review actions. Database declarations are in `db/schema.ts`; ordered SQL migrations are in `drizzle/`. Obsidian adds no tables or migrations. +Every workspace read and write is scoped to the authenticated owner. Jobs hold the current application state, draft, accepted wording, receipt, and version. Observations preserve imported research; events preserve review and state changes; outcomes preserve user- and operative-reported results. Imports can add evidence, but cannot accept wording or reset existing state. -The application has no server-side access to a local Obsidian vault and requires no new provider credentials for Markdown handoffs. The repository's `.openai/hosting.json` declares logical storage bindings only; publishing to GitHub does not create a hosted Relay service. +## Draft handoff -## Data flow +The user prepares a packet for an external assistant and chooses which confirmed facts to include. Relay does not independently verify claims or automatically select facts as true for a draft. The assistant returns wording for the selected job. Relay checks job identity and the version used to create the draft; stale writes are refused. Saving a draft is not acceptance. The user reviews and accepts its exact wording, and any edit requires fresh acceptance. -```mermaid -flowchart LR - V[Selected Obsidian research notes] --> P[Local Markdown validation] - N[Notion or validated research JSON] --> R[Readable research preview] - P --> R - R --> M[Preview matches and explicit import] - M --> O[Owner-scoped jobs and observations] - O --> C[Download job context snapshot] - C --> VREF[Reference in Obsidian] - E[Relay editor and base version] --> D[Download draft note] - D --> VE[Edit body in Obsidian] - VE --> G[Check job identity and version] - G --> E - E --> A[Explicit save or exact-text acceptance] - A --> O -``` +File and local-command integrations read or write only the selected files or packet. Signed-in browser tools expose the owner's permitted Relay records. There is no background account synchronization. -## Responsibility and approval rules +## Application actions and history -Obsidian research notes own their editable source text. Relay owns the imported observations, application status and acceptance record. A downloaded context file is a dated reference copy, never a second live status authority. +Users enter application state and outcomes manually. In the fictional fixture, the included operative can also record Submitted when it reports a receipt. Relay does not independently verify employer-side action; a receipt records only what the user or operative reported. -`lib/domain.ts` validates imported rows and canonicalizes job URLs. Known Greenhouse aliases match; tracking parameters are removed from other posting identities. Different job-board URLs are not universally deduplicated. An Obsidian note uses `obsidian:` for source identity and its posting URL for job identity. Duplicate observation identity also includes owner, job, name, source status and note text; edited notes retain earlier observations. +The separate application coordination flow can prepare and freeze one exact operation. A human must review it in Inspect and choose **Accept and send** before Relay issues a one-use permit to an external browser operative. Relay itself does not POST an employer form. The included Chrome operative is demonstrated only against a fictional fixture. A lost or uncertain result is inspected; it must never be retried as a new submission without evidence that the first action did not occur. -All Obsidian research rows enter with source status Held regardless of status-like properties. Existing job status, draft and exact acceptance are preserved by the established import rules. New jobs start Held. Import advances the job version only when the upsert would change that row (merged status, blocker, accepted text, or posting fields). Exact-repeat research and new observations alone do not invalidate an outstanding draft packet. Rediscovery does not replace a stored effort estimate. +Acceptance of draft wording alone is not permission to submit. Imports, assistant output, policy settings, and chat messages cannot grant that permission. -The selected job derives heuristic hit/miss/unknown matches between required lines in source notes and user-confirmed, unexpired facts. These internal values display as Possible evidence / No matching evidence found / Not compared under **Posting comparison**. Inspect `whyPicked` quotes posting research notes. Word and number overlap does not establish meaning or qualifications, does not pick the job, and is not an Accept gate. The comparison is not stored and does not change status or acceptance. +## Compatibility and history -Runtime keeps the selected-job editor, Inspect, source history, and review history. Tracker keeps queue filters and recorded outcomes. `/advanced` links to `/advanced/review`, `/advanced/preferences`, and `/advanced/plan`. Bookmarks to `/review`, `/preferences`, and `/plan` redirect there. Those APIs and records are unchanged. Planning uses estimated reply rates in an expected-maximum calculation; the UI calls its output an experimental plan score, not an expected offer. +The SQL migration history and existing database tables are preserved. Some tables and fields belonged to removed experimental surfaces, including preference fitting, batch review, and the internal agent runtime. The current pilot does not expose those features. Keeping their historical schema avoids deleting or rewriting stored records; future schema cleanup requires a separate compatibility plan. -`lib/profile.ts` checks selected claim patterns and vocabulary overlap with cited facts, with numbers pooled across those facts. This is a heuristic, not semantic entailment. The stored `Verified` fact status records human confirmation, not independent verification. This draft-log gate is distinct from browser format/identity/version checks and from `/api/workspace` saves, which do not run it. See [product trust boundaries and follow-ups](docs/product-trust.md). +## Local development -Draft imports stage proposed text, without persisting or accepting it. `lib/editor.ts` binds an editor to its loaded job version and session and rejects late file results after selection, session, version or draft changes. Server writes use version checks; stale writes return a conflict. Changing accepted wording requires another explicit review. Submitted and Live loop records allow follow-up edits without resetting their status. Nothing in this flow submits applications or sends messages. +Use Node 24 and pnpm. `pnpm dev` starts the local app on `http://localhost:3000/`; use fictional records because local sign-in is simulated. Never expose that server publicly. -## Obsidian module boundaries - -`lib/obsidian.ts` parses bounded YAML properties using the declared `yaml` dependency and handles three file kinds: - -- `research` (or no kind for earlier notes) converts a selected Markdown body to a validated source row. It supplies templates for role research, interviews and follow-up planning. Batch conversion rejects duplicate source IDs and returns no partial batch. -- `draft` carries the Relay job ID, canonical key, posting URL and editor version. Its body converts to `relay.draft.v1` with review required. Empty or oversized drafts and inconsistent identity are rejected. -- `snapshot` exports visible job context and that job's observations for reference. It cannot be imported, preventing recursively duplicated research history. It excludes verified-facts input and review events and is not a full backup. - -`lib/integration-files.ts` shares the browser and command file-loading contract. It bounds file count and aggregate size before reading, supports Markdown research batches or a single draft/JSON result, and validates draft results against the selected editor target. Linked notes, embeds, directories and attachments are never traversed. - -`app/connections.tsx` owns file selection and downloads. It captures the editor target before asynchronous reads and hands validated research to the preview form or proposed text to the guarded editor callback. `app/workspace-import-dock.tsx` renders readable research and requires a preview of the current import data before enabling its import action. `app/workspace.tsx` composes Runtime; session callbacks live in `app/workspace-runtime.tsx`. The server validates and classifies again at import time. This UI preview gate is not an API authorization mechanism; authenticated callers can invoke the existing validated import endpoint directly. - -`integrations/relay.mjs` exposes `obsidian-pull` and `obsidian-draft` alongside existing Notion, Claude and Grok Bot commands. It reads only named input files, writes with exclusive creation, and makes no network calls for Obsidian. Normal YAML values are parsed, not executed. Note content is untrusted evidence and never changes application instructions or grants approval. - -## Failure handling and verification - -Invalid research files fail before staging the selection; imports remain subject to server validation and transactional database batches. Duplicate note IDs within one selection are errors. Snapshot imports fail with recovery guidance. Old draft notes require a fresh export and manual carry-forward of edits, not changing their version number. Research-file conversion does not claim that content is factually verified. - -The test suite covers domain validation, actual SQLite import statements and migrations, observation deduplication, editor concurrency, mocked external providers, Obsidian conversion and local command round trips. Local API tests exercise authenticated preview/import/read-back and draft/status safeguards with fictional records. Type checks, lint and the production build verify the integration compiles with the app. Installed Obsidian interaction, mobile behavior and Sync remain unverified. - -See [Obsidian workflows](integrations/OBSIDIAN.md) for setup, properties, limits and recovery, and [integration setup](integrations/README.md) for the other connectors. Automatic vault watching, two-way status synchronization, a custom Obsidian plugin and linked-note traversal are outside the implemented boundary. +The API and orchestration checks create isolated local databases and apply the full migration history. See [hosting and recovery](docs/hosting.md) for the deployment boundary and [delivery checks](docs/delivery.md) for release validation. diff --git a/LAUNCH.md b/LAUNCH.md index b60be72..11ae084 100644 --- a/LAUNCH.md +++ b/LAUNCH.md @@ -1,15 +1,11 @@ -# Relay by SyberLabs +# Relay -Keep your application work moving. +Relay keeps each job's research, selected confirmed facts, draft wording, accepted text, and manually recorded application history in one private record. -Relay helps job seekers manage applications across their preferred AI tools. Keep candidate facts available for reuse, carry job context between assistants, and preserve reviewed drafts and application history. The goal is less repeated work across applications. +Prepare a job-specific handoff for an assistant, review the returned wording, and accept the exact text yourself. Version checks refuse stale draft saves. A submitted outcome requires a receipt. -Import research from Notion or a tracker CSV, exchange packets with ChatGPT, Codex, Grok Bot, or Claude, and review the actual words before using them. Keep interview notes without resetting your application status. +Relay does not independently verify draft claims or POST an employer form. A separate application action requires human Inspect approval before an external browser receives a one-use permit. The included Chrome operative is tested only with a fictional fixture. -Available now: Runtime and Tracker, plus local command integrations. Account connections require setup. Autonomous hunting and Relay POSTing an employer form are not included in this release. +Relay is in an invited pilot. No hiring outcomes or throughput improvements have been established. -Explore the code and setup guide: https://github.com/SyberLabs/relay - -Built by Seth Carlson and Mateo Robles. - -No customer counts, hiring outcomes, or throughput improvements have been claimed. This copy is suitable for the repository; no social post has been sent. +[Repository and setup](https://github.com/SyberLabs/relay) · [Integrations](integrations/README.md) diff --git a/README.md b/README.md index 36ad436..874a764 100644 --- a/README.md +++ b/README.md @@ -1,223 +1,86 @@ # Relay by SyberLabs -**Keep your application work moving.** +**Keep each application’s facts, wording, and history together.** -Relay helps job seekers manage applications across their preferred AI tools. Keep candidate facts available for reuse, carry job context between assistants, and preserve reviewed drafts and application history. The goal is less repeated work across applications. +Relay is a private, human-reviewed workspace for carrying job context between assistants and keeping an application record current. Built by [Seth Carlson](https://github.com/sdcarlson) and [Mateo Robles](https://github.com/sykosyber). ## Available in this early release -- One history per job: matching posting URLs join the same record, and earlier research stays visible. -- Add a job from a role title, HTTP(S) posting URL, and optional notes. Matching URLs join that existing record without resetting status or accepted drafts. -- Exact draft acceptance: you approve specific wording; changing it requires review again. -- A focused question review lets you delegate routine writing choices, remember that preference, or share a short answer. Your assistant receives the direction on its next context read; required facts and exact draft acceptance remain separate. -- Interview notes and follow-ups that do not reset a submitted or live-loop application. -- Import a tracker CSV through column mapping and a record preview. Imported statuses stay research; existing Relay status and accepted drafts are preserved. -- A reusable candidate fact ledger: you confirm accuracy. Agent draft logs check selected claim patterns using word and number overlap with cited facts; unsupported claims can still pass. -- Browser draft loading checks format, job identity and version. It does not check citations or factual accuracy; workspace saves do not run the agent citation check. -- Advanced tools preserve experimental agent batch review, preference fitting and weekly planning. Planning uses estimated reply rates, not offer probabilities. Staging never accepts or sends a draft. -- Pull public Greenhouse and Lever boards onto existing job identity. Discovery arrives Held. -- Record outcomes with a receipt before a submission counts toward reply rates. Ended applications cannot be reopened by import. -- An existing assistant with local command access can retrieve saved job context and stage its own exact draft for human review without user file transfer. Staging requires the generation-time version and explicit blocker; it does not verify claims or accept wording. Separate citation-checked draft logging and its trust rules remain unchanged. The local CLI cannot accept drafts, confirm facts, or submit applications. -- Where browser WebMCP is supported, an existing assistant can retrieve one job's research, saved confirmed facts and action history, then stage a version-bound draft directly for human review without file transfer. When WebMCP is missing, the same owner-session tools are available as window.relay for JavaScript evaluation in the signed-in tab. Exact acceptance remains in the signed-in workspace. This is not a hosted MCP connection. -- A human Inspect Accept on a complete armed payload authorizes the waiting operative to send once. Relay does not POST the employer form. -- An unpacked Chrome MV3 first-party operative is the recommended send surface: it prepares and arms from a signed-in Relay tab, waits for Inspect Accept, begins once, clicks a fictional fixture Submit once, and records the observed receipt. It does not fetch Relay APIs from chrome-extension://, export cookies, or POST the employer form from Relay. Same-tab window.relay remains when the extension cannot load. +- Keep one owner-scoped record per job, with research and application history kept together. +- Import selected tracker rows or job research as evidence; imports do not accept wording or overwrite current application state. +- Maintain candidate facts that you confirm yourself. For a prompt or file handoff, include only facts relevant to that job. +- Return assistant-written wording to the same job. Relay checks the job version and refuses stale saves. +- Review and accept exact wording yourself. Editing accepted text requires fresh acceptance. +- Update application state yourself. In the fictional fixture, the included Chrome operative can record Submitted when it reports a receipt. Relay does not independently verify what the employer received. +- A separate application action requires human Inspect approval before an external browser receives a one-use permit. Relay itself does not POST the employer form. - Explore fictional example records; no real applicant data is included. ## Integrations -- **[ChatGPT](integrations/OPENAI.md)**: Prepare a job packet and prompt, then bring a JSON draft back for review. -- **[Codex](integrations/OPENAI.md)**: The same packet, plus optional local drafting through the signed-in Codex CLI. -- **[Obsidian](integrations/OBSIDIAN.md)**: Selected research notes, version-bound draft edits, and job-context exports from your vault. -- **[Notion](integrations/README.md)**: Read-only research import through a local command you run with your own credentials. -- **[Claude](integrations/README.md)**: Draft preparation from facts you supply through the Claude API, using your own key. The local relay CLI can log drafts against saved, user-confirmed facts with heuristic citation checks. -- **[Grok Bot](integrations/GROK_BOT.md)**: Validated research and draft file exchange inside the Bot's VM. In a signed-in Relay tab without WebMCP, prefer window.relay; do not export cookies. -- **[Chrome operative](extensions/operative/README.md)**: Unpacked MV3 extension that fills a fictional fixture form after Inspect Accept. Not a store listing, Autopilot, or real ATS adapter. -- **[Tracker CSV](integrations/README.md)**: Map columns, preview rows, and import a local tracker file as research. -- **[Greenhouse](integrations/README.md)**: Read-only public board pull onto existing job identity. No credentials and no application sending. -- **[Lever](integrations/README.md)**: Read-only public board pull onto existing job identity. No credentials and no application sending. +- **[ChatGPT](integrations/OPENAI.md)**: Prepare a selected-job handoff, then return the assistant's draft for review. +- **[Codex](integrations/OPENAI.md)**: Use the same handoff or the local CLI adapter with a signed-in Codex CLI. +- **[Obsidian](integrations/OBSIDIAN.md)**: Exchange selected job research and version-bound draft files. +- **[Notion](integrations/README.md)**: Import selected research through a local read-only command. +- **[Claude](integrations/README.md)**: Prepare an external draft with your own API credentials. +- **[Grok Bot](integrations/GROK_BOT.md)**: Exchange research and drafts through explicit file or local command handoffs. +- **[Tracker CSV](integrations/README.md)**: Map columns, preview selected rows, then import them as research. +- **[Chrome operative](extensions/operative/README.md)**: Optional unpacked extension for the fictional fixture; not a real ATS adapter. -Every returned draft needs human review. User confirmation and heuristic checks do not establish factual truth, qualifications or improved hiring outcomes. Acceptance records approval of exact wording. Integrations use explicit file and command handoffs, browser tools where WebMCP is supported, window.relay in the signed-in tab, or the unpacked first-party Chrome operative for a fictional fixture send; Relay does not POST the employer form, host an MCP connection, or sync accounts in the background. Human Inspect Accept authorizes the waiting operative to submit once after begin execute:true. +Assistants can prepare drafts from context the person chooses to share. They cannot confirm facts, accept wording, or infer permission to act. Accepting wording records approval of that exact text; it grants no permission to submit. Relay does not independently verify draft claims or assess qualifications. -ChatGPT uses a prompt and file handoff; Codex also supports a local CLI adapter. This release does not include a hosted ChatGPT app or MCP connection. +ChatGPT uses a prompt and file handoff; Codex also supports a local CLI adapter. Relay does not provide a hosted ChatGPT app or hosted MCP connection. [Integration setup](integrations/README.md) | [ChatGPT and Codex guide](integrations/OPENAI.md) | [Launch copy](LAUNCH.md) -## Why Relay +## Pilot status -People already use ChatGPT, Claude, Grok, Notion, and Obsidian to hunt for jobs. The work still falls apart in the gaps: a new chat forgets the last draft, a tracker overwrites a decision, an interview note resets application status. - -Relay is the record that remembers. **Runtime** (`/`) is the selected-job loop. **Tracker** (`/track`) is the queue and outcomes. Import research as evidence. Review the actual words. Accept a specific draft. Keep follow-ups on submitted jobs without losing what you already did. - -- **Research keeps its history.** Matching posting URLs join the existing opportunity; changed source notes remain separate observations. Rediscovery preserves an existing interview or submitted status. -- **Acceptance belongs to the text.** An imported Ready label does not approve a new draft. Accept it in Relay; changing the accepted text requires another review. -- **Handoffs belong to a job and version.** Draft packets and editor checks reject stale work instead of silently replacing a newer review. -- **Bring the tools you already use.** ChatGPT, Codex, Claude, Grok Bot, Notion, Obsidian, a tracker CSV, and public Greenhouse or Lever boards can supply research and drafts. Relay keeps the review record across those handoffs. - -Relay records acceptance on the selected job in Runtime. It does not POST the employer form, verify every claim, or prove which words were submitted to an employer. URL matching cannot identify every repost across different job boards. Applications, facts, and Advanced stay secondary. - -## Team - -Built by [Seth Carlson](https://github.com/sdcarlson) and [Mateo Robles](https://github.com/sykosyber) under [SyberLabs](https://github.com/SyberLabs). - -Every database read and write belongs to the authenticated user. Exact accepted text is versioned. Imports add evidence; they cannot grant approval. A stale editor or assistant packet cannot overwrite newer work. - -[Development workflow](CONTRIBUTING.md) · [Delivery and review](docs/delivery.md) · [Team board](https://github.com/orgs/SyberLabs/projects/1) +Relay is in an invited pilot. No hiring outcomes or time savings have been established. ## Stack -React 19 and Vinext on Cloudflare Workers, with D1 persistence and Drizzle migrations. TypeScript throughout. Local development uses Sites authentication; production uses a verified Cloudflare Access gateway and separate staging and production databases. - -See [architecture and data ownership](ARCHITECTURE.md) and [hosting and recovery](docs/hosting.md). - -## Using Relay with the tools you already have - -Use your preferred discovery and application tools alongside Relay. [Simplify](https://simplify.jobs/) already offers job matching, autofill, resume tailoring, and tracking. Relay's focus is preserving research and exact draft decisions across those handoffs. - -**First compatibility path: tracker CSV to Relay preview.** In Relay, open **Import a tracker CSV**, choose your file, confirm the company, role, and employer posting URL columns, and preview before saving. Optional status and notes columns are preserved as research. Every new job starts Held; source statuses never approve a draft. This is a file importer, not a tracker account connection or partnership. See the [CSV setup guide](integrations/README.md#tracker-csv--relay) and [fictional example](tests/fixtures/tracker-example.csv). - -### Obsidian - -Select a job, open **Prepare this job for an assistant**, choose the note purpose, and **Create note for selected job**. Edit the downloaded note in your vault, then load it in Relay and preview matches before importing. Use **Edit draft in Obsidian** for a version-bound draft, and **Download job context** for a source-history snapshot. No plugin, vault scanning, or background sync. - -[Complete Obsidian guide](integrations/OBSIDIAN.md) - -### ChatGPT and Codex +React and Vinext on Cloudflare Workers, with D1 persistence and Drizzle migrations. Local development uses a mock sign-in on the Vite development server; production uses the verified Cloudflare Access gateway. -Choose **Prepare for ChatGPT** or **Prepare for Codex** in **Prepare this job for an assistant**, share the selected prompt, and return the JSON result for review. Codex can also prepare drafts through its signed-in CLI. - -[Complete setup and boundaries](integrations/OPENAI.md) - -### GrokCell research templates - -The [GrokCell project](https://github.com/sdcarlson/grokcell) publishes the First Principles, Product Ideation, Red Flag, and Garbage Collector templates. They do not connect to Relay or grant access to application records. The [Relay adapter](integrations/GROK_BOT.md) remains the guide for exchanging job research and drafts. See also [context management](context-management/README.md). - -## Candidate facts and advanced batch review - -Add a posting through ordinary fields or import multiple jobs from a tracker CSV. Select a job to prepare a handoff, review the returned wording and accept exact text. Facts, source history and review history remain available as you move between applications. Experimental batch tools are under **Advanced** (`/advanced`). The [pilot reuse comparison](docs/pilot-throughput.md) tests whether that reuse reduces effort; a single-job walkthrough is a usability check, not a product limit. - -The **fact ledger** (`/profile`, **Your facts**) holds claims you confirm yourself. Stored `Verified` means user-confirmed, not independently verified by Relay. Paste resume text to propose candidates; extraction does not save or confirm them. A fact can carry an expiry for information that goes stale. The browser handoff currently uses a separate unsaved facts box; it does not select saved ledger entries. - -The **style card** holds the voice rules learned from your corrections. The agent reads both through `relay_read_profile` and never writes either. - -A writing agent can log drafts through `relay_log_draft`. Cited IDs must identify user-confirmed, unexpired facts. Selected claim patterns then undergo word-overlap checks, with numbers pooled across cited facts. A detected failure refuses the draft; passing does not establish that the evidence supports its meaning. Unsupported claims can still reach review. An agent short of a fact should use `confidence: "low"` rather than guess; this does not bypass the check. [Fictional examples and trust boundaries](docs/product-trust.md) document the limits. - -Browser draft loading separately checks format, job identity and version. It does not check citations or factual accuracy. Workspace saves do not run the agent draft-log check. Human acceptance records approval of exact wording; changed text needs fresh acceptance. - -Logged drafts accumulate for batch review (`/advanced/review`). A session opens on the first draft in an unseen role cluster, style drift, enough low-confidence drafts, or a full batch. It groups repeated openings, flags near-identical letters and proposes style rules from corrections. Review each claim and correction; batch review is separate from exact-text acceptance in Runtime. `/review` redirects to the same page. - -Automatic staging is enabled per role cluster from recent edit sizes. After enough reviewed drafts come back close to unchanged, later drafts can be placed into the matching job record. This measures editing history, not factual accuracy. Staging leaves status untouched and does not set `accepted_draft`; accepting exact text remains a human action. Changed review history or expired facts can return a cluster to batch review. - -Relay does not POST the employer form. Human Inspect Accept authorizes the waiting operative to submit once after begin execute:true. +See [architecture and data ownership](ARCHITECTURE.md), [hosting and recovery](docs/hosting.md), and [delivery checks](docs/delivery.md). ## Run locally -Node 24 and pnpm are required. From the repository root: +Use Node 24 and pnpm from the repository root: ```sh -# .nvmrc / .node-version are `24` -nvm install && nvm use # or: fnm install && fnm use -# mise use node@24 -# asdf install nodejs 24 && asdf set nodejs 24 - -node scripts/ensure-node.mjs # checks the running Node version; no Bash required -node -v # must be >= 24 +node scripts/ensure-node.mjs pnpm install --frozen-lockfile pnpm build -pnpm exec wrangler d1 execute DB --local --config dist/server/wrangler.json --persist-to .wrangler/state --file drizzle/0000_sticky_robbie_robertson.sql -pnpm exec wrangler d1 execute DB --local --config dist/server/wrangler.json --persist-to .wrangler/state --file drizzle/0001_careless_leader.sql -pnpm exec wrangler d1 execute DB --local --config dist/server/wrangler.json --persist-to .wrangler/state --file drizzle/0002_job_key_observations.sql -pnpm exec wrangler d1 execute DB --local --config dist/server/wrangler.json --persist-to .wrangler/state --file drizzle/0003_profile_calibration.sql -pnpm exec wrangler d1 execute DB --local --config dist/server/wrangler.json --persist-to .wrangler/state --file drizzle/0004_selection_and_outcomes.sql -pnpm exec wrangler d1 execute DB --local --config dist/server/wrangler.json --persist-to .wrangler/state --file drizzle/0005_record_refusals.sql -pnpm dev ``` -`pnpm dev` binds **http://localhost:3000/** (Vite `strictPort`). Use that URL. Miniflare/workerd may also print an internal `127.0.0.1:NNNN` bind - ignore it for the browser and curl. - -`pnpm start` (after `pnpm build`) binds the built Worker at **http://127.0.0.1:8787/**. - -Do not expose either server to the internet. Load fictional examples or import your own records. The product introduction is at `/about`. - -### Local sign-in - -On `pnpm dev`, the Sites Vite plugin mocks ChatGPT sign-in on the Vite URL only: - -- Browser: **Sign in with ChatGPT** → `/signin-with-chatgpt?return_to=/` -- Mock identity: `local_seedy` / `seedy@sites.test` - -`/signin-with-chatgpt` is not a Worker route. `pnpm start` and any workerd-only port return 404 for it. Send Sites identity headers instead (fictional values only): +Apply every migration in order to the local D1 database, then start the app: ```sh -curl -sS http://127.0.0.1:8787/api/workspace \ - -H 'oai-authenticated-user-id: local-dev' \ - -H 'oai-authenticated-user-email: local@example.com' +pnpm exec wrangler d1 migrations apply DB --local --config dist/server/wrangler.json --persist-to .wrangler/state +pnpm dev ``` -The Sites plugin on `pnpm dev` strips caller-supplied `oai-authenticated-user-*` headers and injects the mock user only after the sign-in cookie. Header mock is for the built Worker. Production must use the Access gateway from the delivery foundation. - -## Advanced planning and outcome history - -Preferences and weekly planning remain available under **Advanced**. They are experimental aids, with no established qualification assessment or hiring benefit. Outcome history stays on **Tracker** (`/track`). - -**Preferences** (`/advanced/preferences`) fit weights from choices between saved postings. Twelve comparisons is the interface's target, not a validated accuracy threshold. With no choices, postings receive the same preference score. `/preferences` redirects here. `/api/preferences` is unchanged. - -**The plan** (`/advanced/plan`) uses estimated reply rates, posting age, preference scores and effort estimates in an expected-maximum calculation. Greedy selection adds model score per minute within your budget. A reply is not an offer, so the result is presented as an experimental plan score, not an expected best offer or measured outcome improvement. `/plan` redirects here. The underlying `/api/plan` fields and records are preserved. - -**The read plane** pulls public Greenhouse and Lever boards through `board-pull`, normalising onto the same `jobKey` identity the workspace already uses. It reads only, needs no credentials and no account, and every posting arrives Held — discovery never implies a decision. - -**Outcomes** (`/track`) close the loop. Terminal states are local records of what actually happened and are deliberately not valid import statuses, so the existing import behaviour is unchanged and rediscovery can never reopen an application that has ended. A submission recorded here requires a receipt: the confirmation URL, reference or email subject. Imported submissions are kept and shown, but they arrive without a receipt and are excluded from the reply rates, because counting a send that may never have happened would corrupt every estimate built on it. - -Reply estimates use recorded outcomes and prior assumptions. The API includes intervals and evidence counts. These estimates do not establish that a change caused an outcome. - -**Interview preparation** can reuse recorded facts and reviewed wording. Citation records cover agent draft logs; they are not a complete or verified account of every claim in an application. - -Relay still does not submit applications. There are no write-plane adapters in this release: nothing here fills in a form, sends an email, or messages anyone, and recording a submission is you telling Relay what you already did. - -## Integration boundaries - -Connectors are local commands and explicit file import/export. Notion and Claude use your credentials. ChatGPT is a prompt/file handoff; Codex also supports a local CLI adapter; Grok Bot uses a documented command/file adapter. Agents may log and, for a graduated cluster, stage drafts; they cannot accept one. Board pulls read public endpoints only and use no account identity. A recorded submission is your own report of something you did elsewhere and needs a receipt. Citation checks are heuristic and specific to agent draft logging; every returned draft still requires human review. There is no automatic background sync, autonomous hunting, application sending, or LinkedIn messaging. Production deployment and independent user adoption remain separate from this local workflow. - -See [Local assisted browser trial](REVIEW.md#local-assisted-browser-trial) for the earlier `3b1efd7` read-only Notion, hand-transcribed Bot file, and browser acceptance, reload, and reimport evidence, still shown on a read-only reopen at `59ec7ac`. - -On `7cfec262`, a later fictional trial copied a Relay packet into the installed Grok Bot and manually pasted the returned JSON into Relay. Paste staged the draft without saving; an explicit save and reload preserved its exact text while the record remained Held and unaccepted. Automatic Bot file transfer and the Bot VM command environment remain unverified. - -On `e9e6030`, a later three-record trial imported three distinct Held jobs from historical Notion research through the connected Notion tool (read-only) into isolated local browser storage. Three actual context packets were copied into the installed native Grok Bot; the three observed JSON replies were transcribed by hand and loaded as files. Load staged drafts without persistence; an explicit save and reload preserved the exact text; stale original replies were rejected; a repeat import deduplicated. All three jobs stayed Held with no accepted draft. This is connected Notion read-only plus manually returned installed-Bot JSON, not automatic transfer or the standalone Notion command connector. See [Three-record Notion and native Bot trial](REVIEW.md#three-record-notion-and-native-bot-trial-2026-09-06). +The Vite server uses `http://localhost:3000/`. Use fictional records during development. Do not expose the local server to the internet; its sign-in is a development mock. The SQL history tables remain in migrations to preserve existing data, even where the pilot no longer exposes their former screens or APIs. ## Checks ```sh pnpm test -pnpm exec tsc --noEmit +pnpm typecheck pnpm lint pnpm public-copy:check -node tests/api.test.mjs -pnpm test:calibration +pnpm test:api pnpm test:orchestration pnpm test:cli +pnpm test:e2e +pnpm test:production ``` -The project, organization, personal profile, and website share one [maintained product description](docs/public-copy.json). [Public-copy process](docs/PUBLIC-COPY.md) explains generation, checks, and automatic refreshes. - -`pnpm test` is the unit gate. The API, calibration, orchestration, and CLI live suites each get a dedicated freshly migrated database via `pnpm test:api`, `pnpm test:calibration`, `pnpm test:orchestration`, and `pnpm test:cli`. Do not run those live suites against the same D1: calibration graduates clusters and retires facts. Connector tests mock vendor responses; they do not prove live account access. - -For an existing local database, apply every migration after the one it is already on, in order, up to the highest number in `drizzle/`. Enumerating per-version paths goes stale the moment a migration is added, so follow the rule rather than a list. Migration 0002 rebuilds the observation index. Migration 0003 adds the fact ledger, style rules and draft-review tables. Migration 0004 adds preference, choice and outcome tables and defaulted posting columns on `jobs`; existing rows stay. Migration 0005 adds the refusals table and changes no existing row. Skipping 0005 leaves `/api/readiness` and every citation refusal hitting a missing table. Imported Ready is research evidence; a new record stays Held until its exact draft is accepted in Relay. - -Domain, import, editor, profile, selection, and API tests cover status preservation, duplicate matching, exact acceptance, citation refusal, terminal outcomes that cannot be reopened by import, stale edits, and authentication rejection. A 401 on `/profile`, `/advanced/preferences`, `/advanced/review`, or `/track` expires that mounted page session before the response body is read, clears private state and edit controls, and shows the existing signed-out screen. Older in-flight reads and mutations cannot restore it. Sign-in is top-level navigation; these pages do not reauthenticate in place. Workspace expiry is unchanged. `/preferences` and `/review` still reach those pages. - -## Hosting and privacy - -Keep real imports, packets, and draft results in ignored `private-data/`. Keep API keys in environment variables. Local databases, build output, credentials, and personal records stay out of Git. The invited-pilot product describes current data practices at `/privacy`; that page is a disclosure of shipped behavior, not a waiver or hiring warranty. - -Deploy only the verified release artifact through the protected workflows. An invited pilot may use workers.dev without purchasing a domain; a custom domain remains optional. Account provisioning, live authentication, and the first production release still require verification before inviting users. - -Early release: no hiring outcomes, reliability targets, or throughput improvements have been established. +The integration runners create separate local databases. Do not run them against the same D1 state concurrently. Connector tests use mocked vendor responses; they do not prove live account access. ## License -Copyright 2026 SyberLabs. Relay is licensed under the [Apache License, Version 2.0](LICENSE). Third-party dependencies retain their respective licenses. - -When redistributing Relay or derivative works, include the license, mark modified files, retain applicable notices in distributed source, and reproduce the attribution in [NOTICE](NOTICE) as required by Section 4 of the license. Commercial use and forks are permitted under those terms. The license does not require a prominent product badge or grant ownership of the underlying idea. +Copyright 2026 SyberLabs. Relay is licensed under the [Apache License, Version 2.0](LICENSE). Third-party dependencies retain their respective licenses. See [NOTICE](NOTICE) for required attribution. diff --git a/app/about/page.tsx b/app/about/page.tsx index ac80028..23e0789 100644 --- a/app/about/page.tsx +++ b/app/about/page.tsx @@ -9,14 +9,13 @@ export default function About() {

A SYBERLABS PRODUCT · INVITED PILOT

- Keep your application + Keep each application’s
- work moving. + facts, wording, and history.

- Manage applications across your preferred AI tools. Keep candidate facts - available for reuse and preserve job research, reviewed drafts and - application history as you move between opportunities. + Relay keeps one private job record as work moves between you and the + assistants you already use.

@@ -28,67 +27,41 @@ export default function About() {
- Keep the history -

- Repeated postings join the same record. Earlier submissions stay - visible. -

+ Keep one record +

Research, wording, status, and outcomes stay with the job.

- Review the actual words -

- Edit drafts, resolve missing facts and accept a specific version. -

+ Review exact wording +

Relay refuses stale saves. You accept the text you reviewed.

- Bring your assistant -

- Import Obsidian or Notion research and exchange draft packets with - ChatGPT, Codex, Grok Bot or Claude. -

+ Carry context between tools +

Prepare a job handoff for an external assistant, then review its draft in Relay.

-

Bring your applications together.

+

How it works

- Add a posting with its title, URL and notes, or import multiple jobs - from a tracker CSV. Select a job to prepare, review and accept its - wording. Keep each application’s research and decisions available as you - move to the next. Already interviewing? Save notes and follow-ups - without resetting your application status. + Add a job or import selected research as evidence. Confirm candidate + facts yourself and include the facts needed for a draft in its assistant + handoff. Save returned wording against the current job version, review + it, then accept the exact text. Update application state yourself. In + the fictional fixture, the included Chrome operative can record + Submitted when it reports a receipt. Relay does not independently + verify what the employer received.

-

What’s available today

+

Boundaries

- Bring a tracker CSV into Relay: match the company, role and posting URL - columns, preview the records, then import them as research. Original - statuses remain in the notes; existing Relay status and accepted drafts - are preserved. No tracker account connection is required. + Relay does not independently verify draft claims or POST an employer + form. A separate application action requires human Inspect approval + before an external browser receives a one-use permit. The included + Chrome operative is demonstrated only against a fictional fixture. No + hiring outcomes or time savings have been established.

- A working review workspace, duplicate detection, source history, and - local command integrations. Obsidian notes can be selected for import, - and job snapshots downloaded into your vault. Notion imports are - read-only. Claude uses your API credentials. Grok Bot uses a documented - file handoff in its VM. ChatGPT uses a prepared prompt and JSON file - handoff. Codex supports the same handoff or a local command using your - signed-in Codex CLI. Every returned draft requires review. -

-

- Relay does not POST the employer form. A human Inspect Accept on a - complete armed payload authorizes the waiting operative to send once. - Live provider connections require setup. This early release has no - claimed hiring outcomes or proven throughput gains. -

-

What the checks mean

-

- Facts are confirmed by you. Agent draft logs use heuristic word and - number checks that can miss unsupported claims. Browser draft loading - checks format, job identity and version, not citations or factual - accuracy. Acceptance records your approval of exact wording. -

-

- Advanced tools include experimental - preference fitting, planning and agent batch review. They do not predict - offers or assess qualifications. + ChatGPT and Codex use explicit prompt and file handoffs; Codex also has + a local CLI adapter. Obsidian, Notion, Claude, and Grok Bot use their + documented local or file workflows. Live provider access depends on + your own account and setup.

diff --git a/app/advanced/page.tsx b/app/advanced/page.tsx deleted file mode 100644 index a592be0..0000000 --- a/app/advanced/page.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import { ArrowLeft } from 'lucide-react'; -import Link from 'next/link'; -import { ProductShell } from '../shell'; - -export default function Advanced() { - return ( - - - Runtime - -

Advanced

-

- Experimental tools for planning and agent batches across your job search. - Review and accept each job’s exact wording in Runtime. -

-
-

- Batch review -

-

- Review logged agent drafts and save style corrections. Staged drafts - still need your exact-text acceptance in Runtime. -

-
-
-

- Preferences -

-

Compare postings to fit experimental preference weights.

-
-
-

- This week -

-

- Explore a plan using your time budget and estimated reply rates. - Scores do not predict offers. -

-
-
Relay / SyberLabs
-
- ); -} diff --git a/app/advanced/plan/page.tsx b/app/advanced/plan/page.tsx deleted file mode 100644 index 8b7da3e..0000000 --- a/app/advanced/plan/page.tsx +++ /dev/null @@ -1,204 +0,0 @@ -'use client'; -import { useCallback, useEffect, useState } from 'react'; -import Link from 'next/link'; -import { ArrowLeft, Target, TrendingUp } from 'lucide-react'; -import { ProductShell } from '../../shell'; -type Row = { - id: string; - job_key: string; - name: string; - company: string; - status: string; - cluster: string; - u: number; - p: number; - tier: string; - effort: number; - evidence: number; - band: [number, number]; - reason: string; -}; -type Plan = { - minutes: number; - calibrated: number; - spent: number; - expected: number; - naive: number; - plan: Row[]; - rest: Row[]; - error?: string; -}; -const pct = (n: number) => (n * 100).toFixed(1) + '%'; -function Job({ row, rank }: { row: Row; rank?: number }) { - return ( -
-
- {rank !== undefined && {rank}} - {row.name} - - {row.tier === 'reach' - ? 'Lower reply estimate' - : row.tier === 'floor' - ? 'Higher reply estimate' - : 'Middle reply estimate'} - - {row.cluster} -
-
-
-
Preference score
-
{row.u.toFixed(2)}
-
-
-
Estimated reply rate
-
- {pct(row.p)} - - {row.evidence - ? ` from ${row.evidence} sent` - : ' prior, no evidence yet'} - -
-
-
-
Costs
-
{row.effort} min
-
-
-
- ); -} -export default function PlanPage() { - const [plan, setPlan] = useState(null), - [message, setMessage] = useState(''), - [signedOut, setSignedOut] = useState(false); - const refresh = useCallback(async () => { - const r = await fetch('/api/plan'); - const data = (await r.json()) as Plan; - if (r.status === 401) { - setPlan(null); - setSignedOut(true); - return; - } - if (!r.ok) throw Error(data.error); - setPlan(data); - }, []); - useEffect(() => { - void Promise.resolve() - .then(() => refresh()) - .catch((e: Error) => setMessage(e.message)); - }, [refresh]); - if (signedOut) - return ( - -

This week

-

Sign in to see your plan.

- {/* oxlint-disable-next-line next/no-html-link-for-pages -- Sites authentication requires top-level navigation. */} -
- Sign in with ChatGPT - - - ); - const lift = plan && plan.naive > 0 ? plan.expected / plan.naive - 1 : 0; - return ( - - - Runtime - - - Advanced - -

This week

-

- Experimental planning from preference weights, estimated reply rates, - posting age and your time budget. A reply is not an offer; these scores - do not predict hiring outcomes. -

- {message && ( -
- {message} -
- )} -
-
- Selected - - {(plan?.plan.length ?? 0).toString().padStart(2, '0')} - - Roles to consider -
-
- Attention spent - {plan?.spent ?? 0} - of {plan?.minutes ?? 0} minutes -
-
- Experimental plan score - {(plan?.expected ?? 0).toFixed(3)} - Uses reply estimates, not offer probabilities -
-
- - - {lift > 0.005 - ? `${(lift * 100).toFixed(0)}% higher model score` - : 'Same model score as preference ranking'} - - Compared with preference ranking at the same budget -
-
- - {plan && plan.calibrated < 12 && ( -
- -
- The value model is still thin. -

- {plan.calibrated} comparisons recorded. Until there are around a - dozen, roles are ranked mostly on reply estimates and time rather - than on what you actually want. -

-
- - Answer a few - -
- )} - -
-

Suggested for consideration

-

- Selected by added model score per estimated minute. Review each job - yourself. -

- {!plan?.plan.length && ( -

- Nothing selected. Either there are no open roles in the workspace, - or every one costs more than the remaining budget. -

- )} - {plan?.plan.map((row, i) => ( - - ))} -
- - {plan && plan.rest.length > 0 && ( -
-

Considered, not selected

-

- These added less model score per minute or did not fit the remaining - time budget. This does not assess your qualifications. -

- {plan.rest.map((row) => ( - - ))} -
- )} -
Relay / SyberLabs
-
- ); -} diff --git a/app/advanced/preferences/page.tsx b/app/advanced/preferences/page.tsx deleted file mode 100644 index d6ed673..0000000 --- a/app/advanced/preferences/page.tsx +++ /dev/null @@ -1,321 +0,0 @@ -'use client'; -import { useCallback, useEffect, useRef, useState } from 'react'; -import Link from 'next/link'; -import { ArrowLeft, RotateCcw, Timer } from 'lucide-react'; -import type { Posting, Weights } from '../../../lib/utility'; -import { - beginPageWork, - createPageSession, - pageWorkIsLive, - readAuthorizedJson, -} from '../../../lib/page-session'; -import { ProductShell } from '../../shell'; -type Pair = { a: Posting; b: Posting }; -type State = { - weights: Weights; - answered: number; - minutes: number; - pool: number; - target: number; - pair: Pair | null; - error?: string; -}; -function band(min: number | null, max: number | null) { - if (!min && !max) return 'Compensation not published'; - const money = (n: number) => '$' + Math.round(n / 1000) + 'k'; - return max && min ? `${money(min)} – ${money(max)}` : money((max ?? min)!); -} -function Card({ - posting, - onPick, - disabled, -}: { - posting: Posting; - onPick: () => void; - disabled: boolean; -}) { - return ( - - ); -} -export default function Preferences() { - const [state, setState] = useState(null), - [busy, setBusy] = useState(false), - [message, setMessage] = useState(''), - [minutes, setMinutes] = useState(120), - [signedOut, setSignedOut] = useState(false); - const sessionRef = useRef(createPageSession()); - const applyExpired = useCallback(() => { - setState(null); - setMinutes(120); - setBusy(false); - setMessage(''); - setSignedOut(true); - }, []); - const refresh = useCallback(async () => { - if (sessionRef.current.expired) return; - const started = beginPageWork(sessionRef.current); - const r = await fetch('/api/preferences'); - const reply = await readAuthorizedJson( - sessionRef.current, - started, - r, - 'Unable to load preferences.', - ); - if (reply.kind === 'expired') { - applyExpired(); - return; - } - if (reply.kind === 'ignore') return; - if (reply.kind === 'error') throw Error(reply.error); - if (!pageWorkIsLive(sessionRef.current, started)) return; - setState(reply.body); - setMinutes(reply.body.minutes); - }, [applyExpired]); - useEffect(() => { - void Promise.resolve() - .then(() => refresh()) - .catch((e: Error) => { - if (sessionRef.current.expired) return; - setMessage(e.message); - }); - }, [refresh]); - async function post(body: Record, note = '') { - if (sessionRef.current.expired) return; - const started = beginPageWork(sessionRef.current); - setBusy(true); - try { - const r = await fetch('/api/preferences', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify(body), - }); - const reply = await readAuthorizedJson<{ error?: string }>( - sessionRef.current, - started, - r, - 'Unable to save.', - ); - if (reply.kind === 'expired') { - applyExpired(); - return; - } - if (reply.kind === 'ignore') return; - if (reply.kind === 'error') throw Error(reply.error); - if (!pageWorkIsLive(sessionRef.current, started)) return; - await refresh(); - if (!pageWorkIsLive(sessionRef.current, started)) return; - setMessage(note); - } catch (e) { - if (!pageWorkIsLive(sessionRef.current, started)) return; - setMessage(e instanceof Error ? e.message : 'Unable to save.'); - } finally { - if (pageWorkIsLive(sessionRef.current, started)) setBusy(false); - } - } - if (signedOut) - return ( - -

Preferences

-

Sign in to set what a job is worth to you.

- {/* oxlint-disable-next-line next/no-html-link-for-pages -- Sites authentication requires top-level navigation. */} - - Sign in with ChatGPT - -
- ); - const answered = state?.answered ?? 0, - target = state?.target ?? 12, - ready = answered >= target; - return ( - - - Runtime - - - Advanced - -

Preferences

-

- Pick the job you would rather have. These choices fit experimental - preference weights for This week; they do not assess your - qualifications. -

- {message && ( -
- {message} -
- )} -
-
- Comparisons made - - {answered.toString().padStart(2, '0')} - /{target} - - - {ready - ? 'Comparison target reached' - : 'Toward the comparison target'} - -
-
- Postings to draw from - {(state?.pool ?? 0).toString().padStart(2, '0')} - Held in your workspace -
-
- Weekly attention - {minutes} - Minutes the plan is sized to -
-
- - {state?.pair ? ( -
-

Which of these would you rather have?

-

- Assume you would get either one. Pick the job you would actually - take — there is no wrong answer, only your answer. -

-
- - post( - { - action: 'choose', - winner: state.pair!.a.job_key, - loser: state.pair!.b.job_key, - }, - 'Recorded. The value model refits after every answer.', - ) - } - /> - or - - post( - { - action: 'choose', - winner: state.pair!.b.job_key, - loser: state.pair!.a.job_key, - }, - 'Recorded. The value model refits after every answer.', - ) - } - /> -
-
- ) : ( -
-

No comparison to offer

-

- {(state?.pool ?? 0) < 2 - ? 'Import or pull some postings first — comparisons are made over real jobs, not invented ones.' - : 'Every informative pair in the current pool has been asked. Pull more postings to keep refining.'} -

-
- )} - -
-

What the choices imply

-

- Weights are shares of one whole, so they read as relative pull. A - negative weight means you have been trading that attribute away. -

- {answered === 0 && ( -

- No comparisons yet, so every posting scores the same. -

- )} - {answered > 0 && - state && - Object.entries(state.weights).map(([name, value]) => ( -
- {name} -
-
-
- - {value >= 0 ? '+' : ''} - {value.toFixed(2)} - -
- ))} - {answered > 0 && ( -
- -
- )} -
- -
-

- Weekly attention budget -

-

Minutes available for applications this week.

-
- setMinutes(Number(e.target.value))} - /> - -
-
-
Relay / SyberLabs
-
- ); -} diff --git a/app/advanced/review/page.tsx b/app/advanced/review/page.tsx deleted file mode 100644 index aacb424..0000000 --- a/app/advanced/review/page.tsx +++ /dev/null @@ -1,465 +0,0 @@ -'use client'; -import { useCallback, useEffect, useRef, useState } from 'react'; -import Link from 'next/link'; -import { - ArrowLeft, - Check, - Copy, - GitMerge, - Layers, - Sparkles, -} from 'lucide-react'; -import { - factUsage, - openingGroups, - samenessPairs, - type DraftRow, - type Fact, -} from '../../../lib/profile'; -import { - beginPageWork, - createPageSession, - expireIfUnauthorized, - pageWorkIsLive, - readAuthorizedJson, -} from '../../../lib/page-session'; -import { ProductShell } from '../../shell'; -type Trust = { - cluster: string; - state: string; - reviewed: number; - edit: number; -}; -type Batch = { - id: string; - reason: string; - opened: string; - closed: string | null; - size: number; - rules_added: number; -}; -type PendingRule = { rule: string; scope: string }; -export default function Review() { - const [drafts, setDrafts] = useState([]), - [facts, setFacts] = useState([]), - [batches, setBatches] = useState([]), - [trust, setTrust] = useState>({}), - [trigger, setTrigger] = useState<{ reason: string; ids: string[] } | null>( - null, - ), - [edits, setEdits] = useState>({}), - [proposals, setProposals] = useState>({}), - [basket, setBasket] = useState([]), - [busy, setBusy] = useState(false), - [message, setMessage] = useState(''), - [signedOut, setSignedOut] = useState(false); - const sessionRef = useRef(createPageSession()); - const applyExpired = useCallback(() => { - setDrafts([]); - setFacts([]); - setBatches([]); - setTrust({}); - setTrigger(null); - setEdits({}); - setProposals({}); - setBasket([]); - setBusy(false); - setMessage(''); - setSignedOut(true); - }, []); - const refresh = useCallback(async () => { - if (sessionRef.current.expired) return; - const started = beginPageWork(sessionRef.current); - const session = sessionRef.current; - const watch = (request: Promise) => - request.then((r) => { - if (expireIfUnauthorized(session, r)) applyExpired(); - return r; - }); - const [d, p] = await Promise.all([ - watch(fetch('/api/drafts')), - watch(fetch('/api/profile')), - ]); - if (!pageWorkIsLive(session, started)) return; - const draftReply = await readAuthorizedJson<{ - drafts: DraftRow[]; - batches: Batch[]; - trust: Record; - trigger: { reason: string; ids: string[] } | null; - error?: string; - }>(session, started, d, 'Unable to load drafts.'); - if (draftReply.kind === 'expired') { - applyExpired(); - return; - } - if (draftReply.kind === 'ignore') return; - if (draftReply.kind === 'error') throw Error(draftReply.error); - const profileReply = await readAuthorizedJson<{ - facts: Fact[]; - error?: string; - }>(session, started, p, 'Unable to load profile.'); - if (profileReply.kind === 'expired') { - applyExpired(); - return; - } - if (profileReply.kind === 'ignore') return; - if (profileReply.kind === 'error') throw Error(profileReply.error); - if (!pageWorkIsLive(session, started)) return; - setDrafts(draftReply.body.drafts); - setBatches(draftReply.body.batches); - setTrust(draftReply.body.trust); - setTrigger(draftReply.body.trigger); - setFacts(profileReply.body.facts); - }, [applyExpired]); - useEffect(() => { - void Promise.resolve() - .then(() => refresh()) - .catch((e: Error) => { - if (sessionRef.current.expired) return; - setMessage(e.message); - }); - }, [refresh]); - async function run(body: Record, note: string) { - if (sessionRef.current.expired) return; - const started = beginPageWork(sessionRef.current); - setBusy(true); - setMessage(''); - try { - const r = await fetch('/api/drafts', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify(body), - }); - const reply = await readAuthorizedJson<{ - error?: string; - proposals?: string[]; - }>(sessionRef.current, started, r, 'Unable to complete request.'); - if (reply.kind === 'expired') { - applyExpired(); - return; - } - if (reply.kind === 'ignore') return; - if (reply.kind === 'error') throw Error(reply.error); - if (!pageWorkIsLive(sessionRef.current, started)) return; - await refresh(); - if (!pageWorkIsLive(sessionRef.current, started)) return; - setMessage(note); - return reply.body; - } catch (e) { - if (!pageWorkIsLive(sessionRef.current, started)) return; - setMessage( - e instanceof Error ? e.message : 'Unable to complete request.', - ); - } finally { - if (pageWorkIsLive(sessionRef.current, started)) setBusy(false); - } - } - async function saveCorrection(id: string) { - if (sessionRef.current.expired) return; - const result = await run( - { - action: 'correct', - id, - corrected: edits[id], - }, - 'Correction saved. Confirm which parts should always apply.', - ); - if (sessionRef.current.expired) return; - if (result?.proposals) - setProposals({ - ...proposals, - [id]: result.proposals, - }); - } - function addRule(rule: string, scope = 'global') { - if (sessionRef.current.expired) return; - if (basket.some((r) => r.rule === rule && r.scope === scope)) return; - setBasket([...basket, { rule, scope }]); - setMessage('Rule staged. It applies when you close this review.'); - } - const open = batches.find((b) => !b.closed), - batch = drafts.filter((d) => open && d.batch === open.id), - pending = drafts.filter((d) => d.verdict === 'Logged'), - groups = openingGroups(batch), - sameness = samenessPairs(batch), - usage = factUsage(batch, facts), - unreviewed = batch.filter((d) => d.verdict === 'Logged'); - async function closeSession() { - if (sessionRef.current.expired || !open) return; - await run( - { action: 'close-batch', id: open.id, rules: basket }, - `Session closed. ${basket.length} rules now apply to new drafts.`, - ); - if (sessionRef.current.expired) return; - setBasket([]); - setEdits({}); - setProposals({}); - } - if (signedOut) - return ( - -

Batch review

-

Sign in to open your review sessions.

- {/* oxlint-disable-next-line next/no-html-link-for-pages -- Sites authentication requires top-level navigation. */} - - Sign in with ChatGPT - -
- ); - return ( - - - Runtime - - - Advanced - -

Batch review

-

- Experimental agent batches. Review logged drafts and save style rules - for later drafts. -

-

- Logging checks selected claim patterns for word and number overlap with - cited facts. It can miss unsupported claims. Review every claim and - correction; batch review does not accept the job’s exact draft. -

- {message && ( -
- {message} -
- )} -
-
- Logged, unreviewed - {pending.length.toString().padStart(2, '0')} - Waiting for review -
-
- In this session - {batch.length.toString().padStart(2, '0')} - {open ? open.reason : 'No session open'} -
-
- Rules staged - {basket.length.toString().padStart(2, '0')} - Applied on close -
-
- {!open && ( -
- -
- - {trigger - ? `Review due: ${trigger.reason}.` - : 'No review due yet.'} - -

- {trigger - ? `${pending.length} drafts are waiting. Opening a session groups them so one decision can fix a repeated habit.` - : 'A session opens for a new role type, style drift, low agent confidence, or a full batch. Workspace drafts still need your review.'} -

-
- -
- )} - {open && ( - <> - {sameness.length > 0 && ( -
- - {sameness.length} near-identical pair - {sameness.length > 1 ? 's' : ''} in this batch - -

- Drafts this similar mean the profile is generating one letter - repeatedly. Vary the content, not just the voice. -

-
- )} - {groups.length > 0 && ( -
-

- Repeated habits -

-

- Each row is one decision covering several drafts. This is where - a session earns its time. -

- {groups.map((g) => ( -
- “{g.phrase}…” - {g.ids.length} drafts -
- -
-
- ))} -
- )} - {usage.length > 0 && ( -
-

Facts leaned on most

-

- A claim repeated across drafts is worth re-reading once here - rather than in every letter. -

- {usage.slice(0, 8).map((u) => ( -
- {u.fact.claim} - {u.count} drafts -
- ))} -
- )} -
-

Drafts ({unreviewed.length} unreviewed)

- {batch.map((d) => ( -
-
- {d.cluster} - {d.verdict} - {d.confidence === 'low' && ( - agent unsure - )} - profile v{d.profile_version} -
-
{d.corrected || d.body}
-