# Continuity Ledger (branch)

## Goal (incl. success criteria):
- Remove the old **App-scope API key** implementation (protocol + giselle + http routes) after migrating to **Team-scope API keys** in Studio.
- Success: no remaining imports/exports/routes for App-scope API keys; `pnpm format`, `pnpm build-sdk`, `pnpm check-types`, `pnpm test` all pass.

## Constraints/Assumptions:
- API key feature is not public yet; no migration/mitigation needed.
- Team-scope token format is `Authorization: Bearer <apiKeyId>.<secret>` (no `gsk_` prefix).

## Key decisions:
- Delete `App.apiPublishing` from `@giselles-ai/protocol` schema rather than keeping unused fields.
- Keep `GiselleConfig.apiSecretScrypt` since Studio Team-scope API keys reuse scrypt hashing config.

## State:
- App-scope API key code removed from `packages/protocol` and `packages/giselle`.
- `@giselles-ai/http` JSON routes for App-scope API key APIs removed.
- `@giselles-ai/sdk` docs/tests updated to the Team-scope token format.

## Done:
- Deleted `packages/protocol/src/api-publishing/*` and removed export from `packages/protocol/src/index.ts`.
- Removed `apiPublishing` from `packages/protocol/src/app/app.ts`.
- Deleted `packages/giselle/src/api-publishing/*`, removed exports and removed `apiSecretPath` from `packages/giselle/src/path.ts`.
- Removed App-scope API key routes from `packages/http/src/router.ts`.
- Updated `packages/sdk` to stop mentioning/using `gsk_` token prefix.
- Verified: `pnpm format`, `pnpm build-sdk`, `pnpm check-types`, `pnpm test` are passing.

## Now:
- Nothing pending for this request.

## Next:
- If desired, consider renaming the `apiPublishingFlag` description/keys UI copy (still used to gate Team API keys + public runs endpoints) to something like `publicApiFlag` for clarity.

## Open questions (UNCONFIRMED if needed):
- Should `apiPublishingFlag` be renamed now that the scope is team-level (not app-level)?

## Working set (files/ids/commands):
- Files:
  - `packages/protocol/src/app/app.ts`
  - `packages/protocol/src/index.ts`
  - `packages/giselle/src/giselle.ts`
  - `packages/giselle/src/index.ts`
  - `packages/giselle/src/path.ts`
  - `packages/http/src/router.ts`
  - `packages/sdk/src/sdk.ts`
  - `packages/sdk/src/sdk.test.ts`
  - `packages/sdk/README.md`
- Commands:
  - `pnpm format`
  - `pnpm build-sdk`
  - `pnpm check-types`
  - `pnpm test`

