Skip to content

Add public guide: designing state for agents to consume - #395

Merged
TennyZhuang merged 1 commit into
mainfrom
docs/agent-native-state-delta
Jul 31, 2026
Merged

Add public guide: designing state for agents to consume#395
TennyZhuang merged 1 commit into
mainfrom
docs/agent-native-state-delta

Conversation

@TennyZhuang

@TennyZhuang TennyZhuang commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Problem

Hands is agent-native: agents poll for what changed and act without a person in the loop. That places requirements on a change feed that a human-facing list does not have — a missed row is a missed action, an extra row is a duplicate one. Nothing documented that, so each new feed would re-derive it.

Requested by @artin for the public docs site.

Changes

Adds docs/public/agent-native-state-delta.md, public guidance for anyone building an agent-consumable feed or an integration mirroring Hands state:

  1. Exact cursor, not a timestampupdated_at drops same-millisecond changes and is moved by unrelated internal writes. Use a database-assigned monotonic sequence, and measure the write cost before choosing whether it lives on the record or in an append-only side table.
  2. Advance only on material change — housekeeping that moves the cursor wakes the agent with noise from your own system and causes the duplicate reporting the cursor exists to prevent.
  3. Keep consumer progress out of the source of truth — a "needs processing" flag is one consumer's state, and field-level history duplicates a diff the consumer can already compute from the snapshot it holds.
  4. Keep internal-only values out of every externally visible carrier — including event payloads, webhooks and pagination cursors, and including the gap between two values. Base64 is encoding, not concealment.
  5. Scope the sequence per tenant — functionally identical, but bounds what an accidental exposure reveals.

Also registers the page in admin/scripts/build-docs.mjs. Files in docs/public/ are not discovered by directory scan — an unregistered page builds nothing and silently never appears on the site.

Testing

  • node admin/scripts/build-docs.mjsBuilt 15 docs pages + 14 markdown twins + docs.md index
  • Page renders with <title>Designing State for Agents - Hands Docs</title> and appears in the generated index and sidebar under "For agents"
  • Build output under admin/public/docs is gitignored and not committed

Documentation only — no code, schema, or behaviour change.

🤖 Generated with Claude Code

Hands is agent-native, so a change feed has to guarantee more than a
human-facing list does: a missed row is a missed action and an extra row
is a duplicate action.

Documents the pattern as public guidance — exact monotonic cursors rather
than timestamps, material-change semantics, keeping consumer progress out
of the source of truth, keeping internal-only values out of every
externally visible carrier including pagination cursors, and scoping the
sequence per tenant.

Registers the page in admin/scripts/build-docs.mjs; docs/public files are
not picked up by directory scan.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Rhea Rafferty <hands-rhea@mail.build>
@TennyZhuang
TennyZhuang force-pushed the docs/agent-native-state-delta branch from cdc3808 to 32ecd71 Compare July 30, 2026 18:52
@TennyZhuang TennyZhuang changed the title Document the agent-native state-delta principles Add public guide: designing state for agents to consume Jul 30, 2026
@TennyZhuang
TennyZhuang merged commit 9c52baa into main Jul 31, 2026
5 checks passed
@TennyZhuang
TennyZhuang deleted the docs/agent-native-state-delta branch July 31, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant