git.status() is not an array, but the machine-admin prompt tells agents to .map() it #14

Open
opened 2026-08-28 17:08:47 +09:00 by floot · 1 comment
Owner

The machine-admin system prompt gives this as the commit idiom:

const st = await E(git).status();
await E(git).add(st.map(s => s.entry));

Running it produces:

Error: st.map is not a function

Related return-shape guesses that also cost round trips in the same session:

  • git.log() entries have summary, not message. Following the obvious
    guess gives Cannot read properties of undefined (reading 'split').
  • git.filesystemAt(rev) returns a Filesystem exposing
    brands / named / root / statfs — you must then call root() before you
    have anything with list. Two calls to get a directory.

Wanted: make status() return an array (or rename it and document the
shape), and fix the prompt example. Return shapes should be discoverable
without a failed call.

The machine-admin system prompt gives this as the commit idiom: ```js const st = await E(git).status(); await E(git).add(st.map(s => s.entry)); ``` Running it produces: ``` Error: st.map is not a function ``` Related return-shape guesses that also cost round trips in the same session: - `git.log()` entries have `summary`, not `message`. Following the obvious guess gives `Cannot read properties of undefined (reading 'split')`. - `git.filesystemAt(rev)` returns a Filesystem exposing `brands / named / root / statfs` — you must then call `root()` before you have anything with `list`. Two calls to get a directory. **Wanted:** make `status()` return an array (or rename it and document the shape), and fix the prompt example. Return shapes should be discoverable without a failed call.
Author
Owner

The prompt half is fixed in 046bfeb (see #24): the machine-admin examples now destructure { entries } and stage through E(mount).entry(e.path), and the shape surprises are written down.

The interface half - this issue's actual Wanted - is untouched. status() still returns { entries, truncated } rather than an array, log() entries still carry summary where the obvious guess is message, and filesystemAt(rev) still needs a root() call before it yields anything with list. Leaving open for that.

The prompt half is fixed in 046bfeb (see #24): the machine-admin examples now destructure `{ entries }` and stage through `E(mount).entry(e.path)`, and the shape surprises are written down. The interface half - this issue's actual Wanted - is untouched. `status()` still returns `{ entries, truncated }` rather than an array, `log()` entries still carry `summary` where the obvious guess is `message`, and `filesystemAt(rev)` still needs a `root()` call before it yields anything with `list`. Leaving open for that.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
floot/endo#14
No description provided.