Skip to content

feat(records)!: send records to Kixel Quest by repository name - #767

Merged
kixelated merged 7 commits into
mainfrom
quest/m0/benchmark/records-endpoint
Nov 17, 2026
Merged

kixelated merged 7 commits into
mainfrom
quest/m0/benchmark/records-endpoint

Conversation

@kixelated

@kixelated kixelated commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m0/benchmark/records-endpoint.md, deleting it: what is left of its Goal is host work, which belongs in kixel-ai/dotfiles' quest tree (see Follow-ups).

Summary

quest sends session records, and the breakages its PRs name, to Kixel Quest's built-in URL by owner/repo, with no per-repository config.

  • Deleted the .quest.json reader (CHECKOUT_CONFIG, checkoutEndpoint) and every mention of it. The queue's Pending.endpoint is gone too, since the URL is the user's, not the checkout's.
  • New src/cli/tokens.ts holds the Kixel Quest URL (https://kixel.quest, or QUEST_KIXEL_URL), the token file, and its reader, moved out of send.ts and forge.ts so the two share them without a cycle. Records post to <url>/records with the token the file pairs with that URL, the same token the forge reads use.
  • The sender resolves each queued group's base repository (a fork's upstream, as before) and asks KixelQuest.serves() before running token-max. A repository Kixel Quest does not serve has its records dropped after a one-time notice, so it costs no GitHub requests or pending files; a GET /forge failure fails the group like any other upload failure (backoff, stays queued), except a 401 or 403, which is the token's refusal as at upload. KixelQuest takes an optional remedy so its failure text does not tell the sender to set QUEST_FORGE=github.
  • quest records incident posts to the same URL; Kixel Quest's refusal of an unindexed repository fails it loud.
  • Moved the base-repository lookup ahead of token-max, so a failing group now fails before token-max runs for it instead of after.

Public API

  • CLI: quest records sender, quest records incident, and the Stop hook read no .quest.json; their --help and the README follow. No new flags. QUEST_KIXEL_URL now also redirects records and breakages.
  • Wire: unchanged ({"records": [...], "breakages": [...]} to /records, bearer token); only the destination URL's derivation changed.
  • Breaking, hence !: a host that set a token under a .../records URL key must pair it with the bare Kixel Quest URL, as the forge reads already require; a checkout's .quest.json is ignored. Nothing in production used either. The queue's file format dropped endpoint; no migration (a leftover key is ignored).

Validation

  • just check and just test pass.
  • Ran the real sender (quest records sender from this checkout, built from source) against a stand-in Kixel Quest on 127.0.0.1 with QUEST_KIXEL_URL: the stop hook queued this very session, the sender asked GET /forge (serving only moq-dev/quest) and then posted /records with the bearer token; the upload named moq-dev/quest, branch quest/m0/benchmark/records-endpoint, PR 767, role implementing, claude-sonnet-5-5 high. The record comes from the same sessionRecords quest usage --json uses, so I did not diff it field by field.
  • The real https://kixel.quest answers POST /records with a bogus token 401, as the quest's Waiting asked, but answers GET /forge 404 (checked 2026-11-17), so it does not serve forge reads yet; a host holding a token would fail every pass until it does.
  • Unit tests: the sender asks /forge and sends only served repositories; an unserved one is dropped without token-max or a later request and is said once; a fork's origin is matched by the base its PRs open on; a /forge failure keeps the queue; the URL defaults to kixel.quest, must be HTTPS (or loopback HTTP), and ignores a trailing slash; the override redirects records and breakages. A 401 or 403 at GET /forge or at any upload marks the token refused for every group, drops the queue, and stops the pass.

Decisions

From the maintainer's /quest-run pick round, 2026-11-17:

  • Merge pick: ✅ /quest-merge (rejected: skip, /quest-delete).
  • Records for a repository Kixel Quest does not serve: ✅ dropped after a one-time notice, as the deleted quest's Plan said, so an unserved repository costs no GitHub requests or pending files (rejected: keeping them queued, first picked and then reversed once Pullfrog showed each unserved group re-resolves on GitHub every 60-second pass; keeping them with backoff and expiry).
  • The kixel-ai/dotfiles follow-up below: ✅ keep it, waiting until kixel.quest serves GET /forge (rejected: drop).

Follow-ups

For /quest-plan in kixel-ai/dotfiles (host work, not planned here):

  • Put the Kixel Quest token on each maintainer host (~/.config/quest/records.json, paired with https://kixel.quest) and start its sender with quest records install, then check one real session on a moq-dev/quest PR shows in the store equal to quest usage --json. Wait for kixel.quest to serve GET /forge (kixel-ai/kixel.quest quest/m0/read-api.md; curl -H 'Authorization: Bearer <token>' https://kixel.quest/forge must not 404): with the token present every forge read goes to Kixel Quest and fails until it answers, and the sender needs /forge too. The record format is lockstep, so the store and the hosts must run quest versions with the same record format.

Models

  • Size: S
  • Implementer: Claude Code, claude-sonnet-5-5, high effort (arm B)
  • Implementer: Claude Code, claude-sonnet-5-5, low effort (iterate, XS, arm B)

(Written by Claude Sonnet 5.5 with high effort)

🤖 Generated with Claude Code

Review

Rewritten by quest review after each round.

  • Head: a302668

  • Base: origin/main at 25bf2f8

  • Risk: high, The change automatically uploads session records without repository opt-in and drops queued records for unserved repositories or refused credentials, risking unintended data disclosure or record loss for Quest users that a revert cannot undo.

  • Classified: high by Codex, gpt-6.1-sol, low effort, session 01a1e916-222b-7fd3-b3ed-ed0e81a81f1a

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1e8dd-6125-7503-84c5-2b94d87a5a93, round 5

  • Score: 10/10, The merge preserves the reviewed routing and refusal handling while adapting correctly to the updated forge API, with no new findings.

  • Rounds: 5; first round 2 (medium 2); findings 2 (medium 2): fixed 2, refuted 0, open 0

  • Findings: none

  • Reviewer: Codex, gpt-6.1-sol, low effort, shadow

  • Session: 01a1e8dd-6125-7bb2-9bae-9051895fd353

  • Rounds: 2; first round 1 (medium 1); findings 1 (medium 1): fixed 1, refuted 0, open 0

kixelated and others added 3 commits November 17, 2026 01:20
The sender and `quest records incident` post to Kixel Quest's /records
(https://kixel.quest, or QUEST_KIXEL_URL), naming the repository from the
checkout's origin, with the token ~/.config/quest/records.json pairs with that
URL. The committed .quest.json reader is gone. The sender asks GET /forge which
repositories Kixel Quest serves and leaves the rest queued, since it refuses a
whole upload naming one it does not index.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Send records to Kixel Quest by repository name feat(records)!: send records to Kixel Quest by repository name Nov 17, 2026
…n's, for every group

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 17, 2026 09:41
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 49 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 425cb8fb-b9b0-4a68-819b-04300b9296f7
Commits

Reviewing files that changed from the base of the PR and between 25bf2f8 and a302668.

Files selected for processing: 8

  • README.md
  • quest/m0/benchmark/records-endpoint.md
  • quest/m0/github-quota/README.md
  • src/cli/forge.ts
  • src/cli/main.ts
  • src/cli/send.ts
  • src/cli/tokens.ts
  • test/send.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed head c135ba40dcf1bf5f444560edf4ec74a291772e4a.

Hold the sender rollout. Two queue changes make a config or access problem affect sessions beyond the failed request.

  1. P1: The sender can reroute an existing backlog to a different service. queue() selects and checks the configured URL but no longer stores it in Pending. sendOnce() picks up every pending entry under the same state directory and sends to its own QUEST_KIXEL_URL. If two configured endpoints both serve a repo, starting the sender against the other endpoint can upload queued session metadata and breakage records there. A token for the second endpoint authorizes that connection, not transfer of the first endpoint's backlog. Bind pending entries and their cursor/backoff state to the intended URL, or segregate the state directories. Cover a two-endpoint switch and legacy queued entries explicitly.
  2. P2: A single repository's POST 403 drains every repository's queue. refuseAll() runs on raw status codes from both /forge and each repository's upload. A repo-scoped denial or access-layer 403 is not proof of global token revocation; it discards unrelated work, including groups that never tried to upload. Pause on refusal while retaining pending records, and only mark a credential globally refused on a documented token-wide error. Add a two-repository case where the first upload gets 403.

Separately, keeping deployment blocked on a real supported /forge response is correct; the stand-in test does not establish production compatibility. Static review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Unserved repositories now pile up in the sender's queue. They are resolved through GitHub again on every pass, with no backoff and no end.

Reviewed changes

I reviewed the whole PR at c135ba4: records go to Kixel Quest by owner/repo, and the sender asks GET /forge which repositories it serves.

  • New src/cli/tokens.ts: the Kixel Quest URL, kixelUrl, tokensPath and tokenFor move here, which removes the forge.ts ↔ send.ts import cycle.
  • Refused and remedy in forge.ts: a 401 or 403 from Kixel Quest now throws a typed Refused. The sender can replace the "set QUEST_FORGE=github" hint with its own.
  • No .quest.json: queue() queues any Quest checkout with a GitHub origin as long as the user holds a token. Pending.endpoint is gone, and groups are keyed by [origin, prefix].
  • Serve check before token-max: sendOnce resolves each group's base repository and calls KixelQuest.serves() on it. An unserved group stays queued and is mentioned once.
  • A refusal stops everything: a 401 or 403 at /forge or at any upload calls refuseAll. That drops every queued stop, clears the backoffs and ends the pass.
  • reportIncident: posts to ${url}/records.
  • Docs and help: the README, --help text and quest tree now follow the new routing.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread src/cli/send.ts Resolved
@kixelated

Copy link
Copy Markdown
Collaborator Author

Maintainer decision (from the maintainer's /quest-run pick round, 2026-11-17):

  • Merge pick: ✅ /quest-merge once the change below is in.
  • Records for a repository Kixel Quest does not serve, answering Pullfrog's finding: ✅ drop them after a one-time notice, as the deleted quest's Plan said, so an unserved repository costs no GitHub requests or pending files (rejected: keeping them queued, which the maintainer first picked and then reversed; keeping them with backoff and expiry).
  • The kixel-ai/dotfiles token follow-up: ✅ keep it, waiting until kixel.quest serves GET /forge.

(Written by Claude Opus 5.5 with high effort)

…notice

An unserved repository's stops piled up in pending/ and cost a GitHub request every pass to resolve again.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed head a6d744b3d445b66b79ca6c555f3f5c0d317c314e.

Dropping records that the intended service explicitly does not serve is distinct from the earlier wrong-destination issue. This change makes that issue destructive even without a POST: a sender pointed at another URL can now see a 200 catalog that lacks the repo and remove stops queued for the original service. Keep the decided drop policy, but first bind the backlog to its intended URL and apply the policy only to that URL's queue. The repo-local 403 versus global refusal distinction is also unchanged from the prior review. Static follow-up.

pullfrog[bot]
pullfrog Bot previously approved these changes Nov 17, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Reviewed the delta since c135ba4, which addresses the earlier unserved-repository feedback.

  • Dropped unserved groups: sendOnce now settles an unserved group's pending files and clears its backoff, so it costs no later GitHub requests and nothing piles up in pending/. The notice is still said once per repository.
  • Docs and tests follow: the README, --help text, and the sender's notice and failure wording now say "dropped", and the test asserts an empty queue and a silent later stop.

Pullfrog  | View workflow run | Using claude-sonnet-5-5 | 𝕏

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
pullfrog[bot]
pullfrog Bot previously approved these changes Nov 17, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

I reviewed the delta since a6d744b. It is a single merge of origin/main.

  • Merged origin/main (CPU recording from #747): sendOnce now passes deps.calls(since) into sessionRecords, and main.ts wires calls: readCalls for the sender.
  • Resolved the conflict in quest hook help: main's sentences on the USER_ASKED prefix and cgroup CPU sampling are kept, alongside this PR's "queue the session's record for Kixel Quest" wording. No .quest.json or CHECKOUT_CONFIG reference came back.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@kixelated kixelated left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review by review (OpenAI)

Reviewed head a302668dc0f43e3cd26db7cc04d06e1617182a5f.

One integration gap after the forge-write merge: the records hook and incident command still identify only GitHub remotes via remoteRepository, unlike the shared resolver in #769. A normal Kixel-hosted checkout never queues a record; if it has a GitHub transport rewrite, the sender can instead label the record with the mirror's identity. If hosted repositories are out of scope here, explicitly refuse them using the configured forge identity and document the limitation. If they are in scope, resolve them on the hosted forge and test both hosted origins with and without a rewrite. The previously reviewed backlog-destination and global-refusal concerns are unchanged. Static review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

I reviewed the delta since 9fe30de. It is one merge of origin/main that brings in #769 (forge writes through Kixel Quest, and repositories Kixel Quest hosts).

  • Adapted to KixelQuest's new hosted argument: the sender now builds its client with hosted: false, so #failed still shows its remedy ("its records stay queued") instead of the QUEST_FORGE=github hint.
  • Kept kixelUrl in tokens.ts: main's copy in forge.ts was dropped. locate, hostedForge, and main.ts's hostedRepository wiring now import it from tokens.ts, and no import cycle came back.
  • Kept the Refused 401/403 check ahead of #769's write handling: the 400 → InputError and 409 → Refusal paths for writes follow it unchanged. The duplicated refusal helper in send.ts is also gone.

tsc --noEmit is clean, and test/send.test.ts with test/forge.test.ts passes (54 tests).

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit a27c974 Nov 17, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant