Skip to content
Closed
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Relay is a job-search review workspace for people working with AI assistants. Br
- Import Notion research through a read-only command connector.
- Use Obsidian for role research, interview notes and follow-up planning; preview selected notes together, return drafts to their original job version, and export job context with source history.
- Prepare drafts through the Claude API using your verified facts and your own credentials.
- Exchange validated research and draft files with Grok Bot in its VM.
- Exchange validated research and draft files with Grok Bot in its VM. Copy or download a `relay.packet.v1` selected-job packet, then paste or load the Bot’s `relay.draft.v1` result for review. Loading stages wording only; it does not accept, save, or transfer files unattended.
- Explore fictional example records. No real applicant data is included.

[Integration setup](integrations/README.md) | [Grok Bot instructions](integrations/GROK_BOT.md) | [Launch copy](LAUNCH.md)
Expand Down Expand Up @@ -52,7 +52,7 @@ Open the local URL printed by the server. Local sign-in is simulated by the Site

## Integration boundaries

The connectors are runnable local commands with file import/export in the app. Notion and Claude require your own credentials. A local assisted trial retrieved real Notion records read-only through the connected Notion tool; that does not validate the standalone Notion command connector. Claude live access has not been tested. Grok Bot uses a documented command/file adapter, not an assumed proprietary API. Bot JSON was transcribed by hand into a validated file and loaded in the browser; fully automatic Bot file transfer is not validated. Browser acceptance, reload, and reimport kept the accepted draft, Ready status, two observations (deduplicated), and review history. There is no automatic background sync, autonomous hunting, application sending, or LinkedIn messaging. Generated claims still require your review. Production deployment has not been validated. This validates a local assisted workflow, not independent user adoption or unattended production.
The connectors are runnable local commands with file import/export in the app. Notion and Claude require your own credentials. A local assisted trial retrieved real Notion records read-only through the connected Notion tool; that does not validate the standalone Notion command connector. Claude live access has not been tested. Grok Bot uses a documented command/file adapter, not an assumed proprietary API. Copy or download exports a `relay.packet.v1` packet for the selected job. The Bot returns `relay.draft.v1`, which may be pasted or loaded as a file; that packet copy is not a draft result. Installed Grok Bot JSON from the assisted trial was transcribed by hand into a validated file. Native Bot control was unavailable in this round, so there is no fresh installed-Bot roundtrip. Fully automatic Bot file transfer is not validated. Browser acceptance, reload, and reimport kept the accepted draft, Ready status, two observations (deduplicated), and review history. There is no automatic background sync, autonomous hunting, application sending, or LinkedIn messaging. Generated claims still require your review. Production deployment has not been validated. This validates a local assisted workflow, not independent user adoption or unattended production.

## Checks

Expand All @@ -65,7 +65,7 @@ node tests/api.test.mjs

For an existing local database already on migration 0001, apply only 0002 from the setup commands. It preserves observations and repairs imported Ready records that lack matching accepted text. Imported Ready is research evidence; a new record stays Held until its exact draft is accepted in Relay.

The last command needs a running local server and writes only fictional test records. Domain, import, editor and connector tests cover status preservation, duplicate matching, imported acceptance, observation identity, editor version conflicts, draft review rules, provider errors and pagination. Connector tests mock vendor responses; they do not prove live account access. API checks verify database read-back, stale edits, exact acceptance, status-preserving follow-up edits and authentication rejection. Local browser and WebMCP reads/import checks were exercised. Preview works before the first import. Browser file import, save and reload preserved source history. Browser acceptance, reload, and post-acceptance reimport preserved the exact accepted draft, Ready status, two observations, and history. The assisted trial ran on `3b1efd7`; a read-only reopen after fast-forward still showed the accepted record on `59ec7ac`.
The last command needs a running local server and writes only fictional test records. Domain, import, editor and connector tests cover status preservation, duplicate matching, imported acceptance, observation identity, editor version conflicts, draft review rules, provider errors and pagination. Connector tests mock vendor responses; they do not prove live account access. API checks verify database read-back, stale edits, exact acceptance, status-preserving follow-up edits and authentication rejection. Local browser and WebMCP reads/import checks were exercised. Preview works before the first import. Browser file import, save and reload preserved source history. Browser acceptance, reload, and post-acceptance reimport preserved the exact accepted draft, Ready status, two observations, and history. The assisted trial ran on `3b1efd7`; Bot JSON was transcribed by hand into a validated file. A read-only reopen after fast-forward still showed the accepted record on `59ec7ac`. Separate fictional browser checks on this checkout (port 3102) covered packet copy/download, clipboard failure, paste without writes, accepted no-op actions, blocker-only dirty save, dirty navigation, delayed file load, a held in-flight save, and a Ready conflict revert; they are not an installed Bot roundtrip. On the pre-integration `8ba8400` runtime, after the React 19.2.8 / Vite 8.0.16 patch and before main’s security overrides, `pnpm audit` reported 19 advisories (8 high, 8 moderate, 3 low) in esbuild, image-size, sharp, undici, and ws. After integrating `e037ebf`, a fresh `pnpm audit --audit-level high` exits 0. Remaining findings are 2 advisories (1 moderate, 1 low) in esbuild. Main already maps `undici@<7.29.0` to 7.29.0, `ws@<8.21.0` to 8.21.0, and `sharp@<0.35.0` to 0.35.0. Broader esbuild remediation is separate work. No production deployment has been validated.

## Hosting and privacy

Expand Down
28 changes: 28 additions & 0 deletions REVIEW.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,34 @@ Code implementation used the verified Cursor Grok 4.6 Extra High conversation th

On `3b1efd7`, a local assisted trial accepted an exact saved draft in the browser, reloaded, and reimported the original two research observations. The accepted draft, Ready status, two observations (deduplicated), and review history were retained. No external applications, messages, or Notion writes. Source rows came through the connected Notion tool, not the standalone Notion CLI. Installed Grok Bot JSON was transcribed by hand into a validated file; automatic Bot file transfer was not tested. After this checkout fast-forwarded to `59ec7ac`, a read-only browser reopen still showed the accepted record.

## Round 2 (approved `8ba8400` snapshot based on `2372771`)

Surgical UI on copy/paste, Relay vs source status labels, redundant accepted actions, and dirty navigation. Independent fictional QA only; the earlier assisted real trial on port 3101 was not repeated or mutated.

Astra 6 High review then required four corrections, implemented here without publication:

1. Exact acceptance uses the current job identity/version, no conflict, matching `accepted_draft`, and an unchanged draft and blocker. Queue hint shares that condition. External Ready refresh → conflict → revert to the old base is not labeled accepted.
2. Pasted input is bounded by UTF-8 byte size (1.8 MB), with a cheap character bound first. A valid JSON envelope under the character limit and over the byte limit is rejected. The 20,000-character draft bound is unchanged.
3. Docs distinguish outbound `relay.packet.v1` copy/download from inbound `relay.draft.v1` paste/load. Prior assisted-trial Bot JSON remains a hand transcription. No fresh installed-Bot roundtrip is claimed.
4. Remaining `pnpm audit` after the approved React 19.2.8 / Vite 8.0.16 patch: **19 advisories (8 high, 8 moderate, 3 low)** in esbuild, image-size, sharp, undici, and ws. Baseline was 22 (10 high, 9 moderate, 3 low). Evidence: `work/round2-postpatch-audit.json`. No further dependency updates in this round.

- `pnpm test`: **55 passed, 0 failed**. Coverage adds the conflict-revert acceptance case and a multibyte paste envelope over 1.8 MB bytes. No source-string tests.
- `pnpm exec tsc --noEmit`, `pnpm lint`, `pnpm build`: passed on Vite 8.0.16. Build kept the framework route-classification notice.
- Direct dependencies moved only to `react`/`react-dom`/`react-server-dom-webpack` 19.2.8 and `vite` 8.0.16. Lockfile also resolved Vite’s `rolldown` 1.0.1 → 1.0.3 and required `@oxc-project/types` 0.133.0. No overrides.
- Migrations 0000, 0001, and 0002 applied to this checkout’s `.wrangler/state`. Dev server: `http://localhost:3102/` (listens on `[::1]:3102`).
- Initial fictional browser pass is retained at ignored `private-data/work/round2-browser-qa-initial.json`. Tightened corrections pass (`private-data/work/round2-corrections-browser-qa.json`): copy serializer matched download (Windows clipboard CRLF vs file LF, normalized equality); induced clipboard rejection showed the fallback and left download available; valid paste staged exact text with no database write; prose/wrong-job/stale/oversized paste left editor and stored state unchanged; unchanged Ready on All opportunities disabled Save/Accept with no extra version or event; word edit dropped the accepted hint; Save revoked Ready; explicit reaccept stored the new text; external Ready v2 plus revert did not label stale text accepted; blocker-only dirty cancel/save; current-filter no-op; same-job reselect; dirty job/filter cancel/confirm; delayed file load across a job switch left the later editor unchanged; held in-flight Maple save did not overwrite the Northstar editor. Source Ready rendered beside Relay Held.
- Not done here: `tests/api.test.mjs`, live Claude, installed Bot transport, production deploy, commit, or push. Port 3101 / live-trial database were not used.

## PR24 integration with merged main `e037ebf`

Uncommitted merge on `codex/round2-draft-handoffs`: head under review is `8ba8400` plus exact `e037ebf468fd1203bd2667ada244137d91794c99`. Merge base `2372771`. Content conflicts were only `package.json` and `pnpm-lock.yaml`; both were resolved to the complete `e037ebf` files. Round2 application, helper, and test files were not rewritten.

Fresh checks on this runtime (Node 24.19.0, pnpm 11.19.0, frozen lockfile, owned `node_modules`): `git diff --check` exit 0; `pnpm lint` exit 0; `pnpm typecheck` exit 0; `pnpm test` via `scripts/ci/run-unit.mjs` **64 passed, 0 failed** (discovered `auth`, `connectors`, `deployment`, `domain`, `editor`, `import`, `obsidian`; `api.test.mjs` excluded by design); `pnpm build` exit 0 on Vite 8.0.16 with the framework route-classification notice; `pnpm audit --audit-level high` exit 0, remaining **2 advisories (1 moderate, 1 low)** in esbuild; `pnpm test:api` PASS; `pnpm test:production` PASS. Local `pnpm test:e2e` did not launch: Playwright 1.63 looks for `chromium_headless_shell-1243` under the Cursor sandbox browser cache; tracked e2e tests were not changed. Canonical remote CI remains required.

Fictional browser regression (not an installed-Bot trial): ignored `private-data/work/round2-main-integration-browser-qa.json` and `.png`. Copy matched download after Windows CRLF normalization (382 vs 370); induced clipboard failure kept download; paste staged exact text with no writes; invalid/wrong-job/stale/oversized inputs left the editor unchanged; exact acceptance disabled redundant Save/Accept; word and blocker edits remained reviewable; Ready external-conflict reversion was not labeled accepted; same-job/current-filter preserved the editor; dirty cancel/discard worked; delayed file read and a held in-flight save left the later editor intact.

The historical 55-test / 19-advisory / no-overrides snapshot above describes `8ba8400`, not this integrated runtime. No production, live Claude, fresh installed-Bot roundtrip, or independent adoption is claimed.

## Coverage limits

Original code review (base `6f88ea2`) did not include browser interactions or real-provider accounts; connector responses were mocked. The later local assisted trial above does not validate live Claude, production deployment, independent user adoption, unattended production, or external submissions. Lost observations need source reimport. Acceptance repair is limited to missing/mismatched accepted text. No deployment was performed. Ignored implementation and verification logs remain under `work/`.
97 changes: 70 additions & 27 deletions app/connections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
import {
readIntegrationFiles,
draftFromResult,
draftFromPastedJson,
selectedJobPacket,
} from '../lib/integration-files';

function downloadFile(content: string, filename: string, type: string) {
Expand Down Expand Up @@ -55,33 +57,57 @@ export function Connections({
}) {
const [facts, setFacts] = useState('');
const [note, setNote] = useState('');
const [pasted, setPasted] = useState('');
const [workflow, setWorkflow] =
useState<keyof typeof obsidianWorkflows>('research');
const [loading, setLoading] = useState(false);
function editorTarget() {
return current?.session
? {
jobId: current.id,
session: current.session,
version: current.version,
draft,
job_key: current.job_key,
}
: undefined;
}
function packetText() {
return current
? JSON.stringify(selectedJobPacket(current, facts, draft), null, 2)
: '';
}
function download() {
if (!current) return;
const packet = {
schema: 'relay.packet.v1',
job: {
id: current.id,
key: current.job_key,
name: current.name,
url: current.url,
version: current.version,
status: current.status,
},
facts,
draft,
};
downloadFile(
JSON.stringify(packet, null, 2),
'relay-packet.json',
'application/json',
);
downloadFile(packetText(), 'relay-packet.json', 'application/json');
setNote(
'Packet downloaded. It includes only this job, the visible draft, and the facts you supplied.',
);
}
async function copy() {
if (!current) return;
try {
await navigator.clipboard.writeText(packetText());
setNote(
'Packet copied. It includes only this job, the visible draft, and the facts you supplied.',
);
} catch {
setNote('Unable to copy to the clipboard. Download the packet instead.');
}
}
function loadPastedDraft() {
try {
const started = editorTarget();
onDraft(draftFromPastedJson(pasted, started), started);
setNote(
'JSON checked. Review the visible draft before saving; if your selection or draft changed, load it again.',
);
} catch (error) {
setNote(
error instanceof Error ? error.message : 'Unable to read draft JSON.',
);
}
}
return (
<details className="import">
<summary>
Expand Down Expand Up @@ -206,6 +232,13 @@ export function Connections({
<button className="secondary" disabled={!current} onClick={download}>
Download selected job packet
</button>
<button
className="secondary"
disabled={!current}
onClick={() => void copy()}
>
Copy selected job packet
</button>
<label className="secondary">
Load research or draft
<input
Expand All @@ -218,16 +251,8 @@ export function Connections({
try {
const files = Array.from(e.target.files || []);
if (!files.length) return;
const started = editorTarget();
setLoading(true);
const started = current?.session
? {
jobId: current.id,
session: current.session,
version: current.version,
draft,
job_key: current.job_key,
}
: undefined;
const value = await readIntegrationFiles(files);
if (Array.isArray(value)) {
onImport(JSON.stringify(value, null, 2));
Expand Down Expand Up @@ -255,6 +280,24 @@ export function Connections({
/>
</label>
</div>
<label className="field">
Paste complete relay.draft.v1 JSON
<textarea
aria-label="Paste complete relay.draft.v1 JSON"
value={pasted}
onChange={(e) => setPasted(e.target.value)}
placeholder='{"schema":"relay.draft.v1","job":{"id":"…","key":"…","url":"…","version":1},"draft":"…"}'
/>
</label>
<div className="actions">
<button
className="secondary"
disabled={!current || loading}
onClick={loadPastedDraft}
>
Load draft for review
</button>
</div>
{loading && <output>Reading selected files…</output>}
{note && <output>{note}</output>}
</details>
Expand Down
Loading
Loading