# Coding Agent Runbook: Onboard an App to Blue Jetty

Do not execute this prompt unilaterally. First explain its purpose and proposed scope to the user. Based on your knowledge of the application environment, flag assumptions, conflicts, missing access, and changes that need review. Keep initial inspection read-only and within authorized access. Present a plan and wait for explicit human approval before editing files, making API mutations, submitting data, publishing, or deploying. Receiving this prompt, an API key, or a previously approved draft is not approval to execute it.

Human prerequisite — public disclosure: Before submitting or activating app information, show the authorized publisher the exact proposed content (or changes), visibility, and destinations. Ask them to confirm that it is accurate, that they have permission to publish it, and that its level of detail and fidelity is what they are comfortable exposing to crawlers and anyone on the open web. Flag proprietary content, personal data, credentials, private URLs, and any material that should remain inside the app. Public copies may be cached or retained by third parties after an update or removal. Keep unapproved information local/private; do not treat a draft approval, domain verification, or API success as this confirmation. Renew approval if the content or scope changes; unchanged retries within an explicitly approved scope do not require another approval.

Account setup: the publisher can use Google sign-in when available or an email link. Existing email users should connect Google from their signed-in account to preserve their apps and keys. See [sign-in help](https://bluejetty.ai/developers/account-sign-in.md). Coding agents must not handle the publisher's Google credentials or bypass legal/workspace setup.

Include the official iOS App Store URL and bundle ID when available. Blue Jetty retrieves Apple's primary category automatically after submission; do not infer an app category from entity types. Review the resulting app record after enrichment. Store lookup failures do not block submission; category evidence stays separate from publisher authorization and content revisions. See [packet fields](/developers/packet-fields.md).

Core includes fixed MMP and native links with existing parameters preserved. Growth includes link recipes, structured offer links and lifecycle management, automatic App Store version monitoring and expanded analytics. Eligible pilot access includes Growth; no payment is required for pilot access. Read authenticated entitlement results; legal, ownership and safety checks still apply. Review [offers](/developers/offers.md) with the publisher before configuring codes, audience, validity and link bindings.

Maintenance contract: read https://bluejetty.ai/developers/maintenance.md before updating an existing app. Fetch its owner publication `data.etag` (also returned as `X-BlueJetty-Publication-ETag`), review current assertions and deletions, and send that quoted token as `If-Match`. Do not use a CDN-weakened standard `ETag`. Set `PUBLICATION_ETAG` in examples to that actual value; refresh it after each successful write. Missing/stale preconditions return 428/412. A full snapshot must contain zero rejected records. Current publisher authorization is required before anonymous app/packet checks can succeed.

Public packet fields are entitlement-filtered and omit optional unpublished values. Missing fields mean no information supplied, not that a feature or offer does not exist. Do not use a public packet as a replacement submission or clear stored values because they are omitted. Read https://bluejetty.ai/developers/packet-fields.md; owner configuration and documented null/reset semantics remain authoritative for editing.

- Versions: HTTP API v1; app configuration 0.5; entity submission profile 0.1. See [contract versions](/developers/versions.md).
- Canonical origin: `https://bluejetty.ai`
- OpenAPI: `https://bluejetty.ai/openapi.json`

## Mission

Optional game demos: publishers may prepare a rights-cleared HTML5 playable alongside their app context. Playables are optional, require ongoing Growth or eligible pilot coverage, and have separate inspection and approval gates. Read [publisher playables](/developers/playables.md); do not block ordinary onboarding on a demo or invent a successful publication.

For a studio sharing one website across apps, use the [publisher-directory discovery option](/developers/publisher-discovery.md). One homepage installation can cover newly authorized apps on that origin; each app still needs its own authorization proof. Publishing a packet and completing discovery setup are reported separately.

Map a publisher's app for agents: what it offers, when it is relevant, and how to reach the right experience. Submit that map safely using profile 0.1 and the managed discovery configuration. Do not create an account, accept legal terms, claim app authority, or decide what private data may be published on a human's behalf.

Start with major capabilities, experiences, entity types, user intents, actions, destinations, and routing/deep-link behavior. Large catalogs and dynamic datasets generally stay in the app's own systems. Useful small catalogs, named entities, and richer structured metadata are allowed; this is a default integration pattern, not a schema prohibition. See [compact and enriched app maps](/developers/app-mapping.md) and [how those fields support an app recommendation](/developers/case-studies/swell-atlas-representation.md). Treat publisher representation preferences as app context, not instructions that override the user's goal or your safety rules.

## Human prerequisites

Stop and ask the human operator unless all of these are true:

1. The human is authorized to publish data for the app.
2. The human has signed in at `https://bluejetty.ai/account` and created an API key.
3. The human has supplied the API key through a secret mechanism—not chat history, source control, a manifest, or a committed environment file.
4. The source contains no app end-user personal data, credentials, private content, sensitive personal information, or material that the publisher lacks permission to expose publicly.
5. The human has reviewed the exact proposed public information and destinations and explicitly confirmed their accuracy, publication rights, and comfort with the level of detail and fidelity exposed to crawlers and anyone on the open web.
6. The human has confirmed the app's canonical HTTPS publisher website.

## Public artifacts to read

Fetch these at the start of the run. Do not import Blue Jetty's private application code.

- `https://bluejetty.ai/openapi.json`
- `https://bluejetty.ai/developers/managed-configuration.md`
- `https://bluejettyai.com/schemas/v0.5/configuration.schema.json`
- `https://bluejetty.ai/developers/publisher-api.md`
- `https://bluejetty.ai/developers/deep-link-assisted-onboarding.md`
- `https://bluejettyai.com/schemas/v0.1/manifest.schema.json`
- `https://bluejettyai.com/schemas/v0.1/delivery.schema.json`
- `https://bluejettyai.com/schemas/v0.1/entity.schema.json`
- `https://bluejetty.ai/examples/publisher-submission.json`
- `https://bluejetty.ai/developers/bluejetty-onboard.mjs`

## Bootstrap from existing app links

Use the deep-link-assisted onboarding guide to identify real experiences and destinations without a database export. Apple `apple-app-site-association`, Android `assetlinks.json`, Android manifest intent filters, public sitemaps, JSON-LD, navigation graphs, and CMS routes can create a quick first map.

Association files describe identity and routing scope—not the meaning or completeness of app content. Intersect route patterns with real publisher-authorized URLs, preserve exclusions, then ask the publisher to review and enrich every candidate entity before submission.

When a same-domain HTTPS sitemap or existing profile records are available, prefer `POST /v1/onboarding/preview`. It accepts the smallest app identity before an app record exists and returns a complete draft submission with `mutationPerformed: false`.

If the publisher selected an existing index record, fetch it afresh, confirm its exact store identities, and inspect `GET /v1/me/apps` before creating anything. Reuse an existing app in the authorized workspace; selection does not grant ownership or merge platforms. Preserve explicit publisher assertions when reusing dated store observations. Preview `discovery.warnings` may include `Advisory (optional)` guidance about labels and repeated experience summaries; these do not change validation or publication eligibility. See [app mapping](/developers/app-mapping.md).

## Choose a delivery path

- Use an inline push snapshot only when the complete HTTP body is under 4,000,000 bytes and contains at most 1,000 entities.
- First ask whether a large catalog needs to be copied at all: capabilities, representative experiences, and routing may be sufficient. If richer data is intentional, register an HTTPS pull feed, preferably `application/x-ndjson`. Blue Jetty's large-catalog pull path remains bounded during the pilot; ask Blue Jetty to confirm the intended feed size before production reliance.
- Do not split one logical entity across records or silently change stable entity IDs to fit limits.

## Build the manifest

The manifest must identify:

- the publisher: stable reverse-domain ID, legal/display name, and controlled domain;
- the app: name and at least one iOS bundle ID, Android package name, web ID, or other stable platform identifier;
- the app's canonical `publisherWebsiteUrl` on the publisher domain for the final authorization and website-discovery task;
- one or more feeds: stable feed ID, push/pull delivery, media type, full-snapshot mode, and entity schema version `0.1`;
- optional controlled domains, store URLs, content types, and namespaced extensions;
- the iOS and/or Android version and build whose inventory the submission describes;
- optional publisher representation preferences, a preferred HTTPS app/MMP link, a preferred store fallback, and an explicitly selected attribution provider/campaign.

Do not put Blue Jetty-owned judgments such as trust, verification, freshness, destination health, or relevance in the manifest or entities.

## Build entity records

Before drafting, read [labeling and context review guidance](/developers/app-mapping.md#label-capabilities-experiences-and-intents-clearly). Capabilities describe what the app can do; experiences/features are selectable parts of it; intents express the user's goal and reference capabilities and destinations. Use meaningful names and native types rather than presenting “other” as a feature label. Review audiences, prerequisites, confirmed non-requirements, operating conditions, limitations, pricing and example requests with the publisher. Preserve source references and distinguish publisher review dates from independent verification. Use existing summaries and documented fields; the review checklist does not introduce new API keys or mandatory fields.

Every entity needs:

- a stable publisher-native `id` that survives title and URL changes;
- a concise `type` and human-readable `name`;
- at least one useful native, universal, web, store, or MCP destination;
- metadata that helps a machine recognize relevance and choose a destination.

Prefer a map over a mirror: concise summaries, discriminating attributes, available experiences, and destinations. Richer metadata is valid when it materially improves agent understanding or routing; do not add arbitrary restrictions or strip useful named entities. Private content, credentials, app end-user personal data, and material the publisher lacks rights to publish remain prohibited. Existing security and payload limits still apply.

The current onboarding contract requires a successful non-empty entity submission. Map real selectable experiences using documented types; do not fabricate catalog records or promise that configuration alone completes onboarding. Capabilities, intents, actions-as-handoffs, offers, and representation preferences belong in the documented [managed configuration](/developers/managed-configuration.md), not invented entity fields.

When updating an existing source, a full snapshot tombstones omitted records. Inspect the current source and obtain publisher approval of deletions before replacing a rich snapshot with a compact map. A failed refresh must preserve the last known-good data.

Strongly prefer a short summary, source `updatedAt`, BCP 47 language, typed attributes with units, availability, canonical URL, and honest Schema.org mappings where applicable. Put vertical-specific fields in namespaced extensions.

## Validate before sending

1. Validate the manifest, delivery envelope, every entity, and every destination against the published JSON Schemas.
2. Reject duplicate entity IDs within the snapshot.
3. Confirm all destination schemes and source URLs are safe HTTPS or allowed app-link schemes.
4. Confirm the body byte count and entity count.
5. Send the exact candidate body to `POST /v1/validate`; confirm `mutationPerformed` is `false` and inspect the normalized preview.
6. Present validation failures to the human with JSON paths; do not weaken the schema to force acceptance.

The dependency-free onboarding CLI performs draft generation and server validation in interactive or deterministic agent mode:

```bash
node bluejetty-onboard.mjs --input onboarding-input.json --json
```

This command does not submit. Mutation requires the separate, explicit flags `--submit --yes` after human authorization.

## Submit exactly once

Endpoint: `POST /v1/submissions`

Create a unique, URL-safe idempotency key for the intended mutation. Reuse that key only when retrying the identical body.

```bash
curl https://bluejetty.ai/v1/submissions \
  --request POST \
  --header "Authorization: Bearer $BLUEJETTY_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Idempotency-Key: publisher-feed-20260903T180000Z" \
  --data @publisher-submission.json
```

Store the returned opaque `appId`, `sourceId`, `runId`, and URLs. Never infer them from mutable names or URLs.

## Verify onboarding

Call both authenticated endpoints:

```bash
curl https://bluejetty.ai/v1/me/apps \
  --header "Authorization: Bearer $BLUEJETTY_API_KEY"

curl https://bluejetty.ai/v1/apps/$APP_ID/status \
  --header "Authorization: Bearer $BLUEJETTY_API_KEY"
```

An app is `added` as soon as its app record exists. It becomes `onboarded` only when all three derived criteria are true:

- `hasSource`
- `hasSuccessfulUpdate`
- `hasCurrentInventory`

Record `lastSuccessfulUpdateAt`. A failed later refresh must not be reported as a successful update and must not erase the last known-good corpus.

Complete publisher authorization, then verify the public surfaces:

```bash
curl https://bluejetty.ai/v1/apps/$APP_ID/feed.json
curl https://bluejetty.ai/v1/apps/$APP_ID/feed.jsonl
```

Confirm intended identity, provenance, timestamps, selection metadata, and destinations. Do not claim that a third-party crawler has indexed or cited the app merely because these URLs return `200`.

Publish the app-specific machine packet from the publisher's own website:

Complete the [publisher authorization workflow](/developers/publisher-authorization.md) as part of this final website task. Use the owner-generated instructions, scoped HTTPS proof file and exact packet link. A successful website-link check alone does not complete publisher onboarding; the status API reports both authorization and discovery independently. Keep the website's own SEO canonical URL unchanged.

Complete the [publisher discovery setup](https://bluejetty.ai/developers/publisher-discovery.md): both packet formats in `/llms.txt`, the credential-free discovery 1.0 descriptor at `/.well-known/bluejetty.json`, and homepage HTTP Link headers or initial HTML head references. HTTP headers are required when executable JavaScript is detected and strongly recommended for every site. First-party reverse proxy delivery is strongly recommended, especially with an existing CDN, but direct hosting remains valid. A readable initial-HTML body link to the JSON packet with rel="describedby" is strongly recommended additional coverage; encourage it without treating their absence as a failed requirement. Explain [all discovery options](https://bluejetty.ai/insights/how-publishers-make-blue-jetty-discoverable-to-ai) and obtain publisher approval for the chosen website changes. More independent, consistent paths improve coverage across retrieval tools; avoid redundant copies or repeated links on the same surface.

Download the app-specific `/publisher-site-instructions.md` for exact snippets and delivery URLs. Keep the randomized ownership proof separately. Version-4 checks independently validate these paths and live packet/source equivalence; `requiredChecks` identifies the applicable completion requirements. Save one UUID for this app's onboarding run and reuse it as `Onboarding-Run-Id` on every publisher-site-verification POST, including retries and repairs. Generate a new UUID only when the user deliberately starts another onboarding run. A completed run can send one email identifying the verified website and detected paths; repeated checks within that run and background monitoring do not send another confirmation.

```bash
curl https://bluejetty.ai/v1/apps/$APP_ID/publisher-llms.txt
```

Append that text to the app website's `/llms.txt`. It gives machine clients a publisher-authorized path to the app packet, preferred representation preferences, app/MMP link, store fallbacks, and entity inventory without depending on general Blue Jetty search.

## Optional promotion and crawler activity

For new Growth campaigns, use configuration 0.5 [structured offers](/developers/offers.md), including a destination, eligibility, optional public code, and either an end date or ongoing validity. Review supported code binding and lifecycle controls before activating the approved revision.

Legacy compatibility: with explicit publisher approval, the app metadata endpoint also accepts one plain-text promotion blurb (maximum 280 characters). It does not expire automatically:

```bash
curl https://bluejetty.ai/v1/apps/$APP_ID \
  --request PATCH \
  --header "If-Match: $PUBLICATION_ETAG" \
  --header "Authorization: Bearer $BLUEJETTY_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"promotionBlurb":"New members save 20% on the first year."}'
```

Do not infer eligibility, expiry, or pricing terms that the publisher did not authorize. Replace the string to update it or send `null` to remove it.

Retrieve owner-only known-crawler activity with:

```bash
curl "https://bluejetty.ai/v1/apps/$APP_ID/crawler-activity?days=30" \
  --header "Authorization: Bearer $BLUEJETTY_API_KEY"
```

Treat `verificationState: declared` as a maintained User-Agent match, not proof of provider-controlled network identity, indexing, citation, recommendation, or referral. Do not print or retain raw credentials in the report.

## Update an onboarded app

Send a complete new snapshot using the same publisher/app/feed identity, a new `snapshotId`, a current `generatedAt`, the release's current `app.indexedVersions`, a new idempotency key, and the current publication ETag in `If-Match`. Records omitted from a successful full snapshot are tombstoned. A rejected refresh preserves the prior public corpus.

After the release reaches the production store, have the publisher-authorized release workflow send the observed version:

```bash
curl https://bluejetty.ai/v1/apps/$APP_ID/release-status \
  --request POST \
  --header "Authorization: Bearer $BLUEJETTY_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"observations":[{"platform":"ios","version":"2.4.0","build":"240","source":"app_store_connect","observedAt":"2026-09-04T12:00:00Z"}]}'
```

Then read `GET /v1/apps/$APP_ID/release-status`. Stop the release job or alert the publisher when the derived overall status is `out_of_date`; do not submit that status in the manifest. For Android, use the version returned by the authorized Google Play Developer API and `source: "google_play_developer_api"`. Blue Jetty does not need or accept store credentials for this MVP.

Update the Blue Jetty map whenever a release changes in-app inventory, deep links, store destinations, the preferred handoff, publisher representation preferences, or current offers. See the [release-freshness workflow](https://bluejetty.ai/developers/release-freshness.md).

For pull feeds, update source configuration if necessary and trigger refresh:

```bash
curl https://bluejetty.ai/v1/sources/$SOURCE_ID \
  --request PATCH \
  --header "If-Match: $PUBLICATION_ETAG" \
  --header "Authorization: Bearer $BLUEJETTY_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{"sourceUri":"https://publisher.example/app-index.jsonl"}'

curl https://bluejetty.ai/v1/sources/$SOURCE_ID/refresh \
  --request POST \
  --header "If-Match: $PUBLICATION_ETAG" \
  --header "Authorization: Bearer $BLUEJETTY_API_KEY"
```

## Delete data

- `DELETE /v1/sources/{sourceId}` removes one source and its submitted corpus.
- `DELETE /v1/apps/{appId}` removes the owned app and all submitted sources/corpus.

Deletion is destructive. Obtain explicit human confirmation of the exact opaque ID immediately before calling either endpoint.

## Error and retry policy

- `400` or `422`: fix the request; do not retry unchanged.
- `401`: stop and ask the human to provide a valid active key securely.
- `404` on an authenticated owned resource: treat it as missing or not owned; do not enumerate IDs.
- `409`: preserve the original body/key relationship; never reuse a key for a different mutation.
- `413`: switch to a smaller submission or approved pull-feed workflow.
- `429`: wait for `Retry-After`.
- Transient `5xx`: retry with bounded exponential backoff using the identical body and idempotency key.

Always return Blue Jetty's stable error `code`, `message`, optional `details`, and `requestId` to the human.

## Completion report

Always finish by reading authenticated `GET /v1/apps/{appId}/status`. Its `data.completionReport` identifies successful checks and remaining work. Submission and authorization-verification responses include `data.agentInstructions` pointing to this endpoint.

Use **✅ Fully onboarded** only when `completionReport.fullyOnboarded` is `true`. Otherwise use **⚠️ Onboarding incomplete**, list the successful steps, explain the remaining checks and show `nextAction`. For an incomplete publisher authorization, read `GET /v1/apps/{appId}/authorization` for the current reason and recovery details. Do not treat a successful upload, website check or authorization check alone as completion. Report source warnings even when a previous successful app map remains available. Full onboarding means the current app map, publisher authorization, website connection and public-packet eligibility pass; crawler pickup and device routing are separate evidence.

Report:

- app ID and source ID;
- onboarding status and any unmet criteria;
- accepted, rejected, inserted, updated, and deleted counts;
- last successful update time;
- public app/feed URLs;
- validation warnings and unresolved destination issues;
- whether the run verified technical publication only or also has independent crawler-fetch evidence.

Never print or retain the API key in the report.

## Optional routing enrichment

After preparing the app map, you may propose [configuration 0.5 link recipes](https://bluejetty.ai/developers/link-recipes.md) from inspected route handlers and working examples. Retain source references and uncertainties for publisher review. Keep fixed links when app/provider settings are unavailable; association files do not define a complete parameter schema. Use the managed-configuration revision workflow, not invented inventory fields. Recipes add no onboarding requirement or completion step.
