Skip to content

feat(alexandria): collect and send per-call feedback tokens - #373

Merged
nickscamara merged 5 commits into
mainfrom
capy/collect-and-send-per
Nov 6, 2026
Merged

nickscamara merged 5 commits into
mainfrom
capy/collect-and-send-per

Conversation

@nickscamara

@nickscamara nickscamara commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Adds per-call feedback tokens so Alexandria ratings are attributed to the calls they are about.

  • Alexandria call results can carry a feedbackToken. The CLI keeps up to 20 of them for 24 hours in its config directory (deduped, written atomically, mode 0600, scoped to the API key) and prints a short Feedback ref c3: provider/capability line to stderr per call. JSON output is unchanged and still contains the token as returned.
  • firecrawl alexandria feedback sends the stored tokens, so the overall rating covers the calls in the session, and clears them after a successful submission. Repeatable --call-rating <ref>=<good|partial|bad> rates individual calls by ref; repeatable --token <token> passes tokens explicitly for scripted use (replacing the stored ones). An unknown ref fails before anything is sent.
  • rejectedTokens from the API is shown in the output. With no stored tokens the request body is unchanged.

Tests

Store (dedupe, cap, TTL, scoping, file mode, write failures), recording and ref printing, sending, clearing, call ratings, explicit tokens, unknown refs, rejected tokens and argument parsing.

Open in Capy


Summary by cubic

Adds per-call feedback tokens so Alexandria ratings are attributed to the calls they are about.

  • Alexandria call results can carry a feedbackToken; the CLI stores up to 20 per API key for 24 hours in its config directory (deduped, written atomically with mode 0600, updates serialized across processes) and prints a Feedback ref cN: provider/capability line to stderr per call. Tokens from the firecrawl provider are not stored, missing results are ignored, and JSON output is unchanged and still contains the token as returned.
  • firecrawl alexandria feedback sends the stored tokens so the session rating covers those calls, and clears the stored ones it sent after a successful submission. Repeatable --call-rating <ref>=<good|partial|bad> rates individual calls by ref; repeatable --token <token> passes tokens explicitly, replacing the stored ones and scoping refs to those tokens. An unknown ref fails before anything is sent; rejectedTokens from the API is shown in the output. With no stored tokens, the request body is unchanged. Expired tokens are pruned from disk on read.

Written for commit b6c1956. Summary will update on new commits.

View guided diff Turn on auto-fix

nickscamara and others added 2 commits November 6, 2026 02:51
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review completed against the latest diff

Shadow auto-approve: would not auto-approve because issues were found.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread src/utils/alexandria-feedback-tokens.ts Resolved
Comment thread src/commands/feedback.ts Resolved
Comment thread src/utils/alexandria-feedback-tokens.ts Resolved
Comment thread src/utils/alexandria-feedback-tokens.ts Resolved
Comment thread README.md Resolved
Comment thread src/__tests__/commands/feedback.test.ts Resolved
…t tokens, prune expired tokens on read

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 8 files

Shadow auto-approve: would not auto-approve because issues were found.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread src/commands/alexandria.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 6 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would not auto-approve. Auto-approval blocked by 3 unresolved P0–P2 issues from previous reviews.

View guided diff | Turn on auto-fix | Re-trigger cubic

…skip mode check on Windows

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 3 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Adds per-call Alexandria feedback token collection and submission with a scoped local store and explicit rating/token flags; the change is additive and backward-compatible, and its lifecycle and edge cases are covered by focused tests.

View guided diff | Turn on auto-fix | Re-trigger cubic

Release per-call feedback tokens for Alexandria feedback (--call-rating, --token).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. Adds per-call Alexandria feedback token collection and submission with a scoped, atomic local store and explicit token/call-rating flags. The change is additive and backward-compatible, and its lifecycle, security properties, and edge cases are covered by focused tests.

View guided diff | Turn on auto-fix | Re-trigger cubic

@nickscamara
nickscamara merged commit 5533ea9 into main Nov 6, 2026
13 of 15 checks passed
@nickscamara
nickscamara deleted the capy/collect-and-send-per branch November 6, 2026 22:24
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.

2 participants