Skip to content
Merged
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: 1 addition & 5 deletions .github/workflows/quality-line.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ name: Quality line
# its answer no longer matches the spec Flyspace ships. A red run is the
# signal to fix the spec before a person's block breaks.
#
# Keys are optional repository secrets (FRED_API_KEY, ALPHA_VANTAGE_API_KEY,
# NEWSAPI_KEY, METACULUS_API_KEY). Without one, that API's keyed operations
# ALPHA_VANTAGE_API_KEY is an optional repository secret. Without it, that API's keyed operations
# are reported as skipped, not failed. The report is kept as an artifact;
# committing public/curated-quality.json stays a person's step.

Expand All @@ -28,10 +27,7 @@ jobs:
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
FRED_API_KEY: ${{ secrets.FRED_API_KEY }}
ALPHA_VANTAGE_API_KEY: ${{ secrets.ALPHA_VANTAGE_API_KEY }}
NEWSAPI_KEY: ${{ secrets.NEWSAPI_KEY }}
METACULUS_API_KEY: ${{ secrets.METACULUS_API_KEY }}
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-node@v7.1.0
Expand Down
5 changes: 3 additions & 2 deletions APEX_PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ database, so everything behind those facts went. Last present at `8a21350`:
engine, kernel, crystallize, run lineage, the Think result modal, markdown
rendering of answers. A turn now commits the preview's refusal.
- Postgres, migrations, the inference ledger, hosted OIDC auth.
- The capability broker's server side and data plant (house keys). A brokered
block still runs and shows the broker's 503.
- The capability broker and data plant (house keys), and the curated APIs that
need them because they refuse browser calls: FRED, NewsAPI, Metaculus. Keyed
APIs that accept browser calls keep working with a visitor's own key.
- OAuth sign-in. A Google block still says sign-in is not set up.
- Remote speech (OpenAI Realtime). The browser recognizer remains.
- Jev and Kev persona suggestions and meaning search. Keyword search remains.
Expand Down
8 changes: 4 additions & 4 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ browser's IndexedDB unless the visitor saves an account backup (below).
| `GET /api/polymarket` | Polymarket markets |
| `POST /api/llm`, `POST /api/jev-persona`, `POST /api/capability-broker`, `POST /api/registry-intent`, `GET /api/inference-runs` | always 503 |

The 503 routes are one-line stubs. They stay because
The 503 routes are one-line stubs that no client calls. They stay only because
`.github/workflows/deploy-preview.yml` asserts those answers after every deploy
and rolls back otherwise; the client calls only the capability broker one. Remove
a stub only together with its check in that workflow.
and rolls back otherwise. Remove a stub only together with its check in that
workflow.

## Deploying the preview

Expand Down Expand Up @@ -83,7 +83,7 @@ Every push and PR, three jobs (`.github/workflows/ci.yml`):
| **Dependency audit** | Production dependencies block on `high`; dev-only advisories are reported, not blocking |

The bundle scan does not grep for variable *names* - a name proves nothing, and
CI has no real keys. It builds with `FRED_API_KEY=OMNI-CANARY-FRED_API_KEY-<run id>`
CI has no real keys. It builds with `ALPHA_VANTAGE_API_KEY=OMNI-CANARY-ALPHA_VANTAGE_API_KEY-<run id>`
and friends, then looks for those exact values in what a browser is served.

Run it locally against your own `.env`:
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
"test:watch": "vitest",
"test:e2e": "playwright test",
"scan:bundle": "npx tsx scripts/scan-client-bundle.ts",
"dev:vinext": "vinext dev --port 3001",
"build:vinext": "npm run build",
"start:vinext": "wrangler dev --config dist/server/wrangler.json",
"deploy:vinext": "vinext-cloudflare deploy --config dist/server/wrangler.json",
"catalog:build": "tsx scripts/build-api-index.ts",
Expand Down
42 changes: 0 additions & 42 deletions public/curated-quality.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,6 @@
"version": 1,
"checkedAt": "2026-10-12T21:31:53.965Z",
"results": [
{
"api": "omni:fred",
"operationId": "getSeriesObservations",
"title": "Values of an economic series over time",
"status": "skipped",
"detail": "no key (set FRED_API_KEY)"
},
{
"api": "omni:fred",
"operationId": "searchSeries",
"title": "Find economic series by keyword",
"status": "skipped",
"detail": "no key (set FRED_API_KEY)"
},
{
"api": "omni:fred",
"operationId": "getSeries",
"title": "Describe one economic series",
"status": "skipped",
"detail": "no key (set FRED_API_KEY)"
},
{
"api": "omni:bls",
"operationId": "getSeries",
Expand All @@ -38,27 +17,6 @@
"title": "Stock quote or price history",
"status": "skipped",
"detail": "no key (set ALPHA_VANTAGE_API_KEY)"
},
{
"api": "omni:newsapi",
"operationId": "topHeadlines",
"title": "Top headlines now",
"status": "skipped",
"detail": "no key (set NEWSAPI_KEY)"
},
{
"api": "omni:newsapi",
"operationId": "everything",
"title": "Search news articles",
"status": "skipped",
"detail": "no key (set NEWSAPI_KEY)"
},
{
"api": "omni:metaculus",
"operationId": "listPosts",
"title": "Forecasting questions",
"status": "skipped",
"detail": "no key (set METACULUS_API_KEY)"
}
]
}
3 changes: 1 addition & 2 deletions scripts/lib/verifySpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ function sampleInput(manifest: CapabilityManifest): { ok: true; input: Record<st

/**
* Run every operation once. Without a key a keyed operation is "skipped",
* never "failed". In Node there is no CORS, so the provider is called
* directly: this checks the provider and the spec, not the server broker.
* never "failed".
*/
export async function verifySpec(apiId: string, spec: unknown, sourceLocator: string, keyEnv?: string): Promise<QualityResult[]> {
const results: QualityResult[] = [];
Expand Down
4 changes: 1 addition & 3 deletions scripts/verify-curated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
// no example is reported as untestable rather than guessed at.
//
// Keys come from the environment (each curated entry's `keyEnv`); without
// one, a keyed operation is "skipped", never "failed". In Node there is no
// CORS, so a broker-routed API is called directly here: this verifies the
// provider and the spec, not the broker.
// one, a keyed operation is "skipped", never "failed".
//
// Exit 1 when any operation failed. Nothing is written without --write.
// ============================================
Expand Down
10 changes: 1 addition & 9 deletions src/blocks/capability/CapabilityBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import { KeyField, keySlotOf, useHasKey } from '@/components/apis/KeyField';
import { useRememberingKeys } from '@/components/apis/RememberKeys';
import { SignInPrompt } from '@/components/apis/SignIn';
import { signInSlotOf } from '@/core/capabilities/connect';
import { ProviderAttribution } from '@/components/apis/ProviderAttribution';
import { attributionFor } from '@/core/capabilities/curatedApis';
import { argumentsFrom, CapabilityInputs, constantOf, inputSummaryOf, missingInputs } from './CapabilityInputs';
import { CapabilityResult } from './CapabilityResult';

Expand Down Expand Up @@ -48,7 +46,7 @@ function isUnboundKeyError(error: string): boolean {

/**
* An API that may be saying no to the credential: worth offering to change
* the key. Some report a bad key as 400 (FRED does), not 401 or 403.
* the key. Some report a bad key as 400, not 401 or 403.
*/
function isRefusal(error: string): boolean {
return /\bHTTP (400|401|403)\b/.test(error);
Expand Down Expand Up @@ -97,8 +95,6 @@ export function CapabilityBlockView({ instanceId }: { instanceId: string }) {
const signIn = signInSlotOf(manifest);
const needsSignIn = signIn !== null;
const needsCredential = needsKey || needsSignIn;
// A provider whose terms require a notice on every app screen that uses it (FRED).
const attribution = attributionFor(manifest);

const sideEffect = manifest?.effect === 'write' || manifest?.effect === 'destructive';
const params = isPlainParams(block?.params) ? block.params : {};
Expand Down Expand Up @@ -185,9 +181,6 @@ export function CapabilityBlockView({ instanceId }: { instanceId: string }) {
<div className="flex items-center gap-2 text-[11px] text-[var(--text-muted)]">
{manifest ? <EffectPill effect={manifest.effect} /> : <span>not installed</span>}
{destination ? <span className="min-w-0 truncate font-mono" title={destination}>{destination}</span> : null}
{manifest?.transport.kind === 'http' && manifest.transport.access === 'server_broker' ? (
<span className="shrink-0" title="Sent from Flyspace's own server: this API refuses browser calls">via server</span>
) : null}
{sideEffect ? (
<span className="ml-auto shrink-0">{manifest?.approval === 'approved' ? 'approved' : 'needs approval'}</span>
) : null}
Expand Down Expand Up @@ -260,7 +253,6 @@ export function CapabilityBlockView({ instanceId }: { instanceId: string }) {
</p>
) : null}
</div>
{attribution ? <ProviderAttribution attribution={attribution} /> : null}
{previewError ? (
<p className="text-xs text-[var(--truth-red)]">{previewError}</p>
) : null}
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/capability/CapabilityInputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ export function coerceInput(input: CapabilityInput, draft: unknown): unknown {
}

/**
* A required input with exactly one allowed value is not a choice: FRED's
* `file_type` must be `json`. It is sent without a field.
* A required input with exactly one allowed value is not a choice. It is
* sent without a field.
*/
export function constantOf(input: CapabilityInput): { value: unknown } | null {
const options = input.schema.enum;
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/capability/CapabilityResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function rowsOf(value: unknown): unknown[] | null {

/**
* The one list a response carries, found through wrappers: a record holding
* exactly one list (FRED's `observations`, a search's `results`), a
* exactly one list (a search's `results`), a
* one-element array around a record (BLS's `series`), or a map of rows.
* Plain values and flat records beside it are kept as details.
*/
Expand Down
51 changes: 0 additions & 51 deletions src/blocks/capability/ProviderAttribution.component.test.tsx

This file was deleted.

11 changes: 2 additions & 9 deletions src/components/ShellPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useState, useEffect, useId, useRef } from 'react';
import { motion, AnimatePresence } from 'framer-motion';
import { useShellStore, useBlockStore } from '@/core/stores';
import { ShellConfig } from '@/core/schemas/shell.schema';
import { SHELL_TEMPLATES, keyedProvidersForTemplate, type ShellTemplate } from '@/core/shells/templates';
import { SHELL_TEMPLATES, type ShellTemplate } from '@/core/shells/templates';

interface ShellPanelProps {
isOpen: boolean;
Expand Down Expand Up @@ -257,7 +257,7 @@ export function ShellPanel({ isOpen, onClose }: ShellPanelProps) {
{template.description}
</p>
<p className="text-[10px] text-[var(--text-muted)] mb-2">
{keyedProvidersLine(template)}
Works without API keys
</p>
<div className="flex items-center justify-between gap-2">
<div className="flex flex-wrap gap-1">
Expand Down Expand Up @@ -408,13 +408,6 @@ export function ShellPanel({ isOpen, onClose }: ShellPanelProps) {
);
}

function keyedProvidersLine(template: ShellTemplate): string {
const keyed = keyedProvidersForTemplate(template);
if (keyed.length === 0) return 'Works without API keys';
const names = keyed.map(p => p.envVar).filter((name): name is string => Boolean(name));
return `Needs ${names.join(', ')}`;
}

// ============================================
// SHELL SECTION COMPONENT
// ============================================
Expand Down
39 changes: 18 additions & 21 deletions src/components/apis/AddApiDialog.component.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,36 +104,33 @@ afterEach(() => {
// Find → review → install & place
// ============================================

describe('AddApiDialog: a curated API (FRED)', () => {
it('finds FRED beside the directory, says its calls go through Flyspace, and installs it as broker reads', async () => {
describe('AddApiDialog: a curated API (Alpha Vantage)', () => {
it('finds Alpha Vantage beside the directory, says its calls go to the provider, and installs it as a browser read', async () => {
render(<Harness />);
fireEvent.change(await screen.findByLabelText('Search APIs'), { target: { value: 'unemployment inflation' } });
const fred = screen.getByRole('button', { name: 'Review FRED Economic Data' });
expect(fred.textContent).toContain('· curated by Flyspace');
fireEvent.click(fred);
fireEvent.change(await screen.findByLabelText('Search APIs'), { target: { value: 'stock quotes' } });
const alpha = screen.getByRole('button', { name: 'Review Alpha Vantage Stocks' });
expect(alpha.textContent).toContain('· curated by Flyspace');
fireEvent.click(alpha);

expect(await screen.findByText(/Spec written by Flyspace from the provider/)).toBeTruthy();
expect(screen.getByText(/Sends requests to/).textContent).toContain('https://api.stlouisfed.org through Flyspace’s own server');
expect(screen.getByText(/refuses calls from a browser/)).toBeTruthy();
// FRED's terms: its notice and terms link, shown before installing.
expect(screen.getByTestId('provider-attribution').textContent).toContain('is not endorsed or certified by the Federal Reserve Bank of St. Louis');
// Where to get the key, from FRED's own pages, and the documented format checked on paste.
expect(screen.getByText(/Sends requests to/).textContent).toContain('https://www.alphavantage.co');
// Where to get the key, from Alpha Vantage's own pages.
const guide = screen.getByTestId('key-guide');
expect(guide.textContent).toContain('Get a key at fredaccount.stlouisfed.org/apikeys');
expect(guide.textContent).toContain('A free FRED account');
expect(guide.textContent).toContain('Get a key at www.alphavantage.co/support');
expect(guide.textContent).toContain('what describes you, your organization, and your email');
expect(guide.querySelector('a')!.getAttribute('rel')).toBe('noopener noreferrer');

fireEvent.change(screen.getByLabelText('Key for https://api.stlouisfed.org'), { target: { value: 'abc123' } });
expect(screen.getByText(/does not look like the documented key format \(32 lowercase letters and digits\)/)).toBeTruthy();
fireEvent.change(screen.getByLabelText('Key for https://www.alphavantage.co'), { target: { value: 'abc123' } });
fireEvent.click(screen.getByRole('button', { name: 'Install & place' }));

const installed = allCapabilities().filter(m => m.source.locator === 'omni:curated/fred');
expect(installed).toHaveLength(3);
for (const manifest of installed) expect(manifest.transport.kind === 'http' && manifest.transport.access).toBe('server_broker');
expect(placedCapabilityBlocks()[0].schema.display_name).toBe('Values of an economic series over time');
expect(calls().some(url => url.includes('stlouisfed'))).toBe(false); // nothing fetched for the spec
const installed = allCapabilities().filter(m => m.source.locator === 'omni:curated/alpha-vantage');
expect(installed).toHaveLength(1);
for (const manifest of installed) expect(manifest.transport.kind === 'http' && manifest.transport.access).toBe('browser_direct');
expect(placedCapabilityBlocks()[0].schema.display_name).toBe('Stock quote or price history');
expect(calls().some(url => url.includes('alphavantage'))).toBe(false); // nothing fetched for the spec
});

});
});

describe('AddApiDialog: from search to the canvas', () => {
it('opens on search, and reviews nothing until an API is chosen', async () => {
Expand Down
Loading
Loading