Operate the Armin Ronacher lessons

Canonical HTML: https://onyx-orbit-keh8.here.now/agent-interface.html

Use window.ArminGuide only in the main JavaScript realm of the main guide. This documentation page does not initialize a second instance. The actual API exposes discover(), inspect({targetId?}), query({within?,role?,name?}), act(request), wait({pageInstanceId,requestId}) and diagnose(). There is no HTTP action endpoint, MCP server or remote execution service.

Discover before acting

Call discover() with no arguments and require ready: true. Extract its five identity fields explicitly. Publication is arminronacher-field-guide; interface, content and fixture versions are 1.0.0. These versions are this guide’s, not upstream software versions. Root region: arminronacher-guide.

inspect({targetId}) returns detached data.state, fixture definitions, related controls, outputs, provenance and limitations. Omit targetId for root state. Module regions are armin-lesson-map, armin-lesson-feedback and armin-lesson-boundary. query accepts optional string within, role and name filters; within must be a registered region. Matching is exact and case-sensitive. Querying Reset lesson at the root returns three controls, so select an exact ID rather than the first result.

Send an exact envelope

const api = window.ArminGuide;
const d = api.discover();
if (!d.ready) throw new Error('Guide is not ready');
const request = {
  publicationId: d.publicationId,
  interfaceVersion: d.interfaceVersion,
  contentVersion: d.contentVersion,
  fixtureVersion: d.fixtureVersion,
  pageInstanceId: d.pageInstanceId,
  requestId: 'map.reset.1',
  expectedRevision: d.revision,
  target: { id: 'map-reset' },
  action: 'reset',
  args: {}
};
const first = api.act(request);
const replay = api.act(request); // replayed: true
const receipt = api.wait({
  pageInstanceId: d.pageInstanceId,
  requestId: request.requestId
}); // receipt directly, not a wrapper
const current = api.inspect({ targetId: 'armin-lesson-map' });

Every displayed envelope field is required, and extra fields are refused. Do not spread discover() into a request. target is either {id} or {match:{within,role,name}}, never both. requestId uses 1 to 80 ASCII letters, digits, periods, underscores, colons or hyphens. expectedRevision is a nonnegative safe integer. args is an exact object with no extra keys: buttons use {}, selects and textarea use {value:string}. Each control additionally supports focus with {}.

Plain JSON-shaped data is required. Cycles, getters, symbols, class instances, non-finite numbers and functions are refused. No coercion, ignored keys or silent aliases are supported. This validation is not isolation against scripts already running in the page.

Read the receipt, then the lesson state

act returns {replayed,receipt}. wait returns the retained receipt directly and synchronously; there is no pending job queue. A receipt has identity, requestId, action, expectedRevision, targetId, status, ok, executed, beforeRevision, afterRevision, lessonChanged, result, error and scope. status is settled after dispatch and binding, not a promise that a browser paint occurred.

An admitted domain refusal has executed:true and ok:false. The root revision advances once for every admitted action, including refusals and focus. Admission failures do not advance it. focus changes real browser focus without changing lesson state. Read methods and ordinary navigation do not advance the revision. The boundary lesson’s approved result is only a fictional policy result, never evidence of real isolation.

Replay, stale state and cleanup

An exact replay includes the original expectedRevision and returns the original receipt without restoring old state. Altered reuse of a requestId refuses with REQUEST_ID_REUSE. To act after another action, discover or inspect the current revision and use a new ID. Keep the original request intact if recovering its receipt.

The page retains up to 4096 distinct same-instance valid-envelope request IDs, including retained admission failures, without eviction. Existing replays and reads remain available at capacity; new IDs receive REQUEST_LIMIT. Malformed envelopes, foreign identities, altered reuse and capacity refusals are not retained. A lesson reset advances its epoch and clears that lesson while preserving the root revision and receipt ledger. Reload clears all lessons and receipts and creates a new pageInstanceId. No state is persisted.

Control catalog

Output IDs: map-status (status, map.status); map-result (log, map.report); feedback-status (status, feedback.status); feedback-result (log, feedback.report); boundary-status (status, boundary.status); boundary-result (log, boundary.report). Every output has one matching DOM element. Complex evidence is rendered in preformatted text. Input changes invalidate corresponding results. Include policy module is available only for an indirect layout not already expanded. Stop fixture service is available only while its fictional service is running. Check and Attempt actions remain enabled so domain refusals can be demonstrated through native controls.

Errors and recovery

Transport errors include INVALID_REQUEST (use exact shapes), WRONG_PUBLICATION and WRONG_INSTANCE (rediscover the intended page), VERSION_MISMATCH (use discovered versions), UNKNOWN_TARGET and UNKNOWN_ACTION (consult the catalog), AMBIGUOUS_TARGET (choose an exact ID), INVALID_ARGUMENTS (match the schema), STALE_REVISION (inspect and issue a new ID), CONTROL_UNAVAILABLE (inspect availability), REQUEST_ID_REUSE (preserve the original request or use a new ID), REQUEST_LIMIT (reload after recording needed work), UNKNOWN_REQUEST (use a retained ID), DISPATCH_FAILED and RENDER_FAILED (inspect diagnostics, then reload). Rendering failure may follow committed state; no rollback is promised.

Admission order is shape, identity, replay, capacity, versions, target, action and arguments, revision, availability, then the lesson reducer. Domain errors and recovery:

Three reproducible paths

Diagnostics and limits

diagnose() reports DOM identity and revision binding, availability, receipt retention, runtime faults and three meaningful lesson invariants: plans retain a visible tenant check from current trace inputs; accepted feedback has a current useful healthy observation; approved boundary decisions require declared local scope and never claim real isolation. healthy means these listed relationships passed, not source accuracy, accessibility or security certification.

The guide and fixtures are free without accounts or payment. External services have independent terms. Free access, privacy, contact, source catalog, Agent Skills discovery. The skill is an instruction package for this existing interface, not a new service.