Geoffrey Huntley field guide: agent interface
Canonical HTML: https://open-hutch-b2hd.here.now/agent-interface.html
Operate the three fictional lessons through window.GeoffreyGuide on the main page, in its browser main JavaScript realm. There is no HTTP mutation endpoint, MCP server, model call, real shell or Ralph runner. Native UI events and agent calls share one dispatcher.
Discovery and reads
Call discover() without arguments and require ready: true. Extract only publicationId, interfaceVersion, contentVersion, fixtureVersion and pageInstanceId. Do not spread the entire discovery result into an action.
inspect({targetId?})returns detached state underdata.stateand its controls, outputs, fixtures, source IDs and limits. Omit targetId for rootghuntley-guide.query({within?,role?,name?})returns exact case-sensitive matches within a registered region. No CSS selectors or fuzzy names.wait({pageInstanceId,requestId})returns the retained receipt directly, not{receipt}. It is a synchronous lookup, not job polling.diagnose()returns listed runtime and lesson invariants. Readhealthy; not security or accessibility certification.
Operational main-realm example
This resets the context lesson, replays the exact request and retrieves its receipt. Each changed action requires a new request ID.
const api = window.GeoffreyGuide;
const d = api.discover();
if (!d.ready) throw new Error('Page is not ready');
const identity = {
publicationId: d.publicationId,
interfaceVersion: d.interfaceVersion,
contentVersion: d.contentVersion,
fixtureVersion: d.fixtureVersion,
pageInstanceId: d.pageInstanceId
};
const request = {
...identity,
requestId: 'example.' + crypto.randomUUID(),
expectedRevision: api.inspect({targetId: 'ghuntley-lesson-context'}).revision,
target: {id: 'context-reset'},
action: 'reset',
args: {}
};
const first = api.act(request);
if (!first.receipt.ok) throw new Error(first.receipt.error.code);
const replay = api.act(request); // No second mutation.
const receipt = api.wait({pageInstanceId: d.pageInstanceId, requestId: request.requestId});
const lesson = api.inspect({targetId: 'ghuntley-lesson-context'});
const health = api.diagnose();
Exact action envelope
Unknown keys, invalid JSON data, accessors and mismatched identities are rejected. Every control also supports focus with {}, moving actual DOM focus and incrementing revision without changing lesson state.
{
"type": "object",
"properties": {
"publicationId": {
"type": "string",
"const": "ghuntley-field-guide"
},
"interfaceVersion": {
"type": "string",
"const": "1.0.0"
},
"contentVersion": {
"type": "string",
"const": "1.0.0"
},
"fixtureVersion": {
"type": "string",
"const": "1.0.0"
},
"pageInstanceId": {
"type": "string"
},
"requestId": {
"type": "string",
"pattern": "^[A-Za-z0-9._:-]{1,80}$"
},
"expectedRevision": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"target": {
"oneOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string"
}
},
"required": [
"id"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"match": {
"type": "object",
"properties": {
"within": {
"type": "string"
},
"role": {
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"within",
"role",
"name"
],
"additionalProperties": false
}
},
"required": [
"match"
],
"additionalProperties": false
}
]
},
"action": {
"type": "string",
"enum": [
"set-load",
"set-task",
"pack",
"reset",
"set-mode",
"step",
"record",
"restart",
"set-patch",
"set-suite",
"check",
"accept",
"focus"
]
},
"args": {
"type": "object",
"description": "Use the exact resolved control schema; focus takes {}."
}
},
"required": [
"publicationId",
"interfaceVersion",
"contentVersion",
"fixtureVersion",
"pageInstanceId",
"requestId",
"expectedRevision",
"target",
"action",
"args"
],
"additionalProperties": false
}
Control catalog and argument schemas
context-load
Region: ghuntley-lesson-context. Accessible name: Context packet. Role: combobox. Native event: change. Action: set-load. State field: load.
{
"type": "object",
"properties": {
"value": {
"type": "string",
"enum": [
"focused",
"history",
"missing-spec"
]
}
},
"required": [
"value"
],
"additionalProperties": false
}
focused: Focused packethistory: Old transcript includedmissing-spec: Specification omitted
context-task
Region: ghuntley-lesson-context. Accessible name: One task for this iteration. Role: textbox. Native event: input. Action: set-task. State field: task.
{
"type": "object",
"properties": {
"value": {
"type": "string",
"maxLength": 1200
}
},
"required": [
"value"
],
"additionalProperties": false
}
context-pack
Region: ghuntley-lesson-context. Accessible name: Assemble packet. Role: button. Native event: click. Action: pack.
{
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}
context-reset
Region: ghuntley-lesson-context. Accessible name: Reset lesson. Role: button. Native event: click. Action: reset.
{
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}
progress-mode
Region: ghuntley-lesson-progress. Accessible name: Checkpoint contents. Role: combobox. Native event: change. Action: set-mode. State field: mode.
{
"type": "object",
"properties": {
"value": {
"type": "string",
"enum": [
"chat",
"plan",
"evidence"
]
}
},
"required": [
"value"
],
"additionalProperties": false
}
chat: Chat onlyplan: Plan claim onlyevidence: Evidence checkpoint
progress-step
Region: ghuntley-lesson-progress. Accessible name: Run fixture step. Role: button. Native event: click. Action: step.
{
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}
progress-record
Region: ghuntley-lesson-progress. Accessible name: Record checkpoint. Role: button. Native event: click. Action: record.
{
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}
progress-restart
Region: ghuntley-lesson-progress. Accessible name: Start fresh iteration. Role: button. Native event: click. Action: restart.
{
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}
progress-reset
Region: ghuntley-lesson-progress. Accessible name: Reset lesson. Role: button. Native event: click. Action: reset.
{
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}
pressure-patch
Region: ghuntley-lesson-pressure. Accessible name: Candidate implementation. Role: combobox. Native event: change. Action: set-patch. State field: patch.
{
"type": "object",
"properties": {
"value": {
"type": "string",
"enum": [
"placeholder",
"count-all",
"unique"
]
}
},
"required": [
"value"
],
"additionalProperties": false
}
placeholder: Placeholder zerocount-all: Count all occurrencesunique: Distinct count
pressure-suite
Region: ghuntley-lesson-pressure. Accessible name: Feedback coverage. Role: combobox. Native event: change. Action: set-suite. State field: suite.
{
"type": "object",
"properties": {
"value": {
"type": "string",
"enum": [
"smoke",
"contract"
]
}
},
"required": [
"value"
],
"additionalProperties": false
}
smoke: One smoke casecontract: Contract cases
pressure-check
Region: ghuntley-lesson-pressure. Accessible name: Evaluate fixture. Role: button. Native event: click. Action: check.
{
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}
pressure-accept
Region: ghuntley-lesson-pressure. Accessible name: Attempt acceptance. Role: button. Native event: click. Action: accept.
{
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}
pressure-reset
Region: ghuntley-lesson-pressure. Accessible name: Reset lesson. Role: button. Native event: click. Action: reset.
{
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}
Output catalog
context-status: role status, modulecontext, state fieldstatus.context-output: role log, modulecontext, state fieldreport.progress-status: role status, moduleprogress, state fieldstatus.progress-output: role log, moduleprogress, state fieldreport.pressure-status: role status, modulepressure, state fieldstatus.pressure-output: role log, modulepressure, state fieldreport.
Status outputs are live regions. Complex evidence appears in preformatted logs. Null output means no current result; changing an input invalidates its corresponding observation.
Results and refusals
act returns {replayed,receipt}. A domain refusal can have executed: true and ok: false and still advance revision. Evaluate fixture succeeds as an operation even if case results fail. Attempt acceptance enforces sufficient coverage and passing cases. Inspect check.passed rather than confusing transport success with domain acceptance.
Run fixture step becomes disabled after its single step completes or parser becomes next. Disabled native controls emit no new receipt. Other explicit attempt buttons stay enabled to demonstrate missing prerequisites. Three Reset lesson controls are ambiguous at root scope; use an ID or narrow the region.
INVALID_REQUEST: Supply only the exact JSON-shaped fields, without accessors, cycles or extra keys.WRONG_PUBLICATION: Use this publication identity.WRONG_INSTANCE: Discover the new page after reload.VERSION_MISMATCH: Use current discovery versions and a new request ID.REQUEST_ID_REUSE: Replay exactly or use a new ID for changed data.REQUEST_LIMIT: 4096 IDs retained. Reads and exact replay still work; reload clears state and ledger.UNKNOWN_TARGET: Discover an exact registered target.AMBIGUOUS_TARGET: Use an exact ID or narrower region; Reset lesson has three root matches.UNKNOWN_ACTION: Use an action advertised by the control.INVALID_ARGUMENTS: Follow the exact control schema without extra keys or coercion.STALE_REVISION: Inspect current state and use a new ID and revision.CONTROL_UNAVAILABLE: Read availability; a completed fixture step is disabled.UNKNOWN_REQUEST: wait retrieves only retained IDs in this page instance.DISPATCH_FAILED: Inspect diagnostics and reload. No successful effect is claimed.RENDER_FAILED: State may already be committed. Inspect diagnostics and reload; no rollback is promised.TASK_REQUIRED: Enter a task and assemble again.SPEC_REQUIRED: Select Focused packet.CONTEXT_OVER_BUDGET: Select Focused packet to remove old history.NO_VERIFIED_PROGRESS: Run the fixture step first.CHECKPOINT_NOT_DURABLE: Choose Evidence checkpoint and record again.PROGRESS_LOST: Re-run the step, record an Evidence checkpoint and restart.CHECKPOINT_UNSUPPORTED: Re-run the step and record evidence, artifact and rationale.STEP_ALREADY_COMPLETE: Reset the single-step fixture; native UI disables the completed step.CHECK_REQUIRED: Evaluate the current candidate and suite.INSUFFICIENT_BACKPRESSURE: Select Contract cases, evaluate and attempt acceptance.CHECK_FAILED: Choose Distinct count, evaluate and attempt acceptance.
Revisions, replay and cleanup
All lessons share a revision. Each admitted action, including focus and domain refusal, advances it once. Exact replay returns the retained receipt without another mutation even after the revision changes. Altered reuse of a request ID is rejected. A stale request requires new inspection and a new ID, not a modified replay.
The ledger retains up to 4096 IDs without eviction. At capacity, reads and prior replay still work. Reset lesson increments its epoch and restores initial lesson state but keeps the ledger. Reload erases all lesson state and receipts and creates a new pageInstanceId. Rediscover afterward. No rollback, durable storage or cross-page receipt recovery is promised. There are no background jobs or external effects to clean up. Reset or reload when finished.
Limits
- Three deterministic fictional fixtures, not a live model, shell, compiler or repository.
- Context units are invented teaching units, not measured tokens or model performance.
- A checkpoint survives only the simulated iteration inside this page. There is no filesystem, browser storage or other persistence.
- Reload resets every lesson and the receipt ledger and creates a new pageInstanceId.
- No asynchronous jobs, network actions, model calls, credential access, real permissions or security isolation. Initial document and asset requests still reach hosting.
- No autonomous repeat loop. Every teaching transition requires an explicit action; no deployment, purchasing or publishing.
- Fixture checks cover only the named finite cases; passing is not a proof of compiler correctness or permission to run a real agent.
A checkpoint is only simulated external memory, not a file or localStorage. Context units are invented. Four passing cases are not compiler validation. Read Privacy for ordinary hosting requests and Sources for attribution.