# Operate the lessons

Canonical HTML: https://rising-sierra-36ys.here.now/agent-interface.html

The supported interface is `window.JdxGuide` in the **main JavaScript realm of the canonical field-guide page**. This documentation page does not start a second lesson instance. Native buttons and selects call the same dispatcher as agent requests.

These are deterministic local teaching fixtures, not live fnox, mise, pitchfork or communique integrations. No model, shell, credential, repository, MCP server or HTTP action endpoint exists here. State and receipts stay in page memory.

## Discover before acting

```js
const guide = window.JdxGuide;
const d = guide.discover();
// Require d.ready === true.
const local = guide.inspect({ targetId: "jdx-lesson-broker" });
const matches = guide.query({
  within: "jdx-guide", role: "button", name: "Reset lesson"
});
// Three matches. Choose one exact target, not the first match.
```

Publication ID: `jdx-field-guide`. Interface, content and fixture versions: `1.0.0`. These are this publication’s versions, not upstream package versions. Reload creates a fresh opaque `pageInstanceId`. Discovery returns all 20 controls, four regions and three outputs with current values and DOM availability.

## Send an exact request

```js
const d = guide.discover();
const request = {
  publicationId: d.publicationId,
  interfaceVersion: d.interfaceVersion,
  contentVersion: d.contentVersion,
  fixtureVersion: d.fixtureVersion,
  pageInstanceId: d.pageInstanceId,
  requestId: "broker.exposure.1",
  expectedRevision: d.revision,
  target: { id: "broker-run" },
  action: "run",
  args: {}
};
const first = guide.act(request);
const replay = guide.act(request); // replayed: true
const receipt = guide.wait({
  pageInstanceId: d.pageInstanceId,
  requestId: request.requestId
});
```

All ten envelope fields are required, with no extras. A target is either `{id}` or `{match:{within,role,name}}`, never both. Match is exact and case-sensitive; ambiguous results are refused with candidate IDs. Request IDs are 1–80 characters from letters, digits, period, underscore, colon and hyphen. Expected revision is a nonnegative safe integer.

Select actions use `action: "set"` and `{value: "documented-option"}`. Buttons use their declared action and `{}`. Every registered control also supports `focus` with `{}`. Arguments are exact and typed; no coercion, ignored keys or silent defaults. The JSON contract includes each option and schema.

Requests must be plain JSON-shaped data. Accessors, cycles, functions, symbols, class instances and non-finite numbers are refused; getters are not invoked during request admission. This in-process API is not a security boundary against other scripts already executing in the page.

## Read domain results as well as transport results

- `act()` returns `{replayed, receipt}`. The receipt identifies the exact page, request, action, target and before/after revision.
- `executed: true` means the request reached the local dispatcher. A domain refusal can still have `ok: false`.
- `ok: true` means the operation completed. A release evidence check can still report `supported: false`; inspect the result.
- An admitted attempt advances the root revision once, including a domain refusal or focus action. Admission refusals do not advance it.
- `lessonChanged` distinguishes actual fixture-state changes from focus. Calling a read method, scrolling or ordinary Tab navigation does not change the revision.
- `settled` means synchronous dispatch and DOM binding finished, not that the browser painted. Wait for a frame before visual inspection.
- `RENDER_FAILED` is not success. State may already be committed; inspect it and reload. Rollback is not promised.

## Read, query, wait and diagnose

- `inspect({targetId})` defaults to `jdx-guide`. It returns detached state, descendant controls and outputs, source IDs and limits.
- `query({within,role,name})` accepts optional string filters. `within` must name a registered region. No selectors or arbitrary page text are interpreted.
- `wait({pageInstanceId,requestId})` immediately returns the retained receipt. There is no queue. Unknown IDs return `UNKNOWN_REQUEST` and foreign instances return `WRONG_INSTANCE`.
- `diagnose()` reports specific DOM/revision, control binding, receipt, runtime-fault and accepted-check relationships. `healthy` applies only to those checks, not to source accuracy, security or general accessibility.

## Replay and recovery

Exact replay compares the entire request with object keys sorted recursively. Reusing an ID with changed arguments, target or revision returns `REQUEST_ID_REUSE`. Existing replays return their original receipt after later actions and resets without restoring old state. To act on a stale page revision, inspect the new state and issue a new ID with the current revision.

The page retains up to 4096 distinct same-instance valid-envelope request IDs, including stored admission failures. It evicts nothing. At capacity, new IDs receive `REQUEST_LIMIT`; reads and existing replays continue. Malformed envelopes, foreign identities, changed-ID reuse and capacity refusals are not stored. Reload is the explicit recovery and discards all teaching work.

Admission order is shape, identity, replay, capacity, versions, target, action/arguments, revision, DOM availability and domain preconditions. Do not rebuild an old request with a new expected revision and call that replay.

A lesson reset advances its epoch and restores initial fixture values. This prevents check and capture IDs from being recycled inside the page. Reset all preserves the root revision and receipt ledger. There is no localStorage, sessionStorage, IndexedDB, cookie or server-side persistence for lesson state or reading preferences.

## Three concrete paths

- **Broker:** inspect literal output, select `broker-output` value `encoded`, inspect again; compare redaction with isolation. Select `broker-secret` value `NPM_TOKEN` under the `github` allowlist and compare exec with get_secret.
- **Release:** check title-only evidence, observe unsupported; set evidence to `diff`, check and accept. Change claim and attempt acceptance to observe `STALE_CHECK`. Use the benchmark packet for the speed claim; a previous release range still fails.
- **Contract:** capture defaults, evaluate blockers; set readiness to `healthy` and permission to `deploy`, observe stale capture; capture again and evaluate. A missing tool or `stagin` argument remains a blocker.

## Coverage and permissions

All lesson selects, buttons, reset actions and control focus are registered. All state-changing native lesson controls use the same dispatcher. Source links, Contents links, support links, scrolling, text selection and browser reload are ordinary browser operations outside the API. These are the documented coverage gaps, not hidden action endpoints.

There is no authentication or privilege escalation in the fictional lessons. Selecting “Deployment permitted” changes only a local fixture input; it grants no real deployment authority. Accepting a note records a string in memory; it does not publish to GitHub. No file is saved.

## Agent Skills discovery and free access

The [Agent Skills discovery index](https://rising-sierra-36ys.here.now/.well-known/agent-skills/index.json) identifies the supported [Jeff Dickey field-guide skill](https://rising-sierra-36ys.here.now/.well-known/agent-skills/jeff-dickey-field-guide/SKILL.md?raw=true) and its exact SHA-256 digest. The skill documents when to use this guide, how to read its sources, how to operate the existing JdxGuide interface, and how to recover. It is an instruction package, not a new remote action API or MCP server.

This public guide and its local fixtures are free to read and use without an account or payment. The [machine-readable free-access statement](https://rising-sierra-36ys.here.now/pricing.md?raw=true) scopes that claim to this publication. External projects, model providers and hosting services retain their own terms.

Canonical entrypoint: [Jeff Dickey field guide](https://rising-sierra-36ys.here.now/). Full machine contract: [agent-interface.json](https://rising-sierra-36ys.here.now/agent-interface.json). [Privacy and hosting](https://rising-sierra-36ys.here.now/privacy/).
