Skip to content

Add A2APP — make agent writes to Living UIs verifiable - #392

Open
ahmad-ajmal wants to merge 2 commits into
livingui-redesignfrom
livingui-communication-protocol
Open

Add A2APP — make agent writes to Living UIs verifiable#392
ahmad-ajmal wants to merge 2 commits into
livingui-redesignfrom
livingui-communication-protocol

Conversation

@ahmad-ajmal

Copy link
Copy Markdown
Collaborator

An agent asked to "add a todo for tomorrow" wrote due_date: "tomorrow". PocketBase returned 200, stored an empty string, and the agent told the user it was scheduled. It had to guess what the app contained, the write silently failed, and nothing stopped it claiming otherwise.

All three are now handled in the app, so any agent benefits — verified by driving an app with curl alone, after deleting .superuser.

In the app (new pb_hooks, adapter 1.6.0):

  • describe: entities, protocol types, conventions, from the live schema
  • identity: PocketBase answers 200 for unknown paths, so an "a2app" marker is the only reliable probe
  • write guard as router middleware, not a record hook — PocketBase coerces first, after which "tomorrow" and "" are indistinguishable
  • read-back backstop; errors carry a code and list every violation
  • origin guard, agent token, ops auth, rate limits, idempotency

In the CLI:

  • reads describe, not PocketBase's superuser-only admin endpoint, so it holds no privilege an outside agent lacks
  • resolves dates and labels client-side, where a clock and Intl exist
  • adapter-sync ships hooks without re-vendoring the kit
  • a valueless --flag now errors instead of becoming true
  • gate rejects e.app inside runInTransaction, which deadlocks the process while /api/health still returns 200

In CraftBot:

  • the system reports what changed, from the stored record; a false claim is withheld and handed back rather than corrected in front of the user
  • the data model is inlined into the prompt — three attempts became one
  • skills load per run, so operating an app no longer carries the build recipe that rebuilt a live app after one row insert
  • integration bridge: capability gate, destination allowlist, no redirects

adapter-sync runs at create, install, import and launch — launch is the only path reaching an app a user already had.

Adds spec/OVERVIEW.md and scripts/a2app-selfcheck.sh (21 checks).

An agent asked to "add a todo for tomorrow" wrote due_date: "tomorrow".
PocketBase returned 200, stored an empty string, and the agent told the
user it was scheduled. It had to guess what the app contained, the write
silently failed, and nothing stopped it claiming otherwise.

All three are now handled in the app, so any agent benefits — verified by
driving an app with curl alone, after deleting .superuser.

In the app (new pb_hooks, adapter 1.6.0):
- describe: entities, protocol types, conventions, from the live schema
- identity: PocketBase answers 200 for unknown paths, so an "a2app"
  marker is the only reliable probe
- write guard as router middleware, not a record hook — PocketBase
  coerces first, after which "tomorrow" and "" are indistinguishable
- read-back backstop; errors carry a code and list every violation
- origin guard, agent token, ops auth, rate limits, idempotency

In the CLI:
- reads describe, not PocketBase's superuser-only admin endpoint, so it
  holds no privilege an outside agent lacks
- resolves dates and labels client-side, where a clock and Intl exist
- adapter-sync ships hooks without re-vendoring the kit
- a valueless --flag now errors instead of becoming `true`
- gate rejects e.app inside runInTransaction, which deadlocks the process
  while /api/health still returns 200

In CraftBot:
- the system reports what changed, from the stored record; a false claim
  is withheld and handed back rather than corrected in front of the user
- the data model is inlined into the prompt — three attempts became one
- skills load per run, so operating an app no longer carries the build
  recipe that rebuilt a live app after one row insert
- integration bridge: capability gate, destination allowlist, no redirects

adapter-sync runs at create, install, import and launch — launch is the
only path reaching an app a user already had.

Adds spec/OVERVIEW.md and scripts/a2app-selfcheck.sh (21 checks).
@ahmad-ajmal ahmad-ajmal self-assigned this Jul 30, 2026
@ahmad-ajmal ahmad-ajmal added feature New feature or request priority: high Improvement Optimization and improvement over existing feature labels Jul 30, 2026
Comment thread app/agent_base.py
re.IGNORECASE,
)

def _gate_false_claims(self, session_id: str, actions_with_input: list) -> list:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this. Handling of hallucination using pattern matching might end up badly.

POST /api/collections/{entity}/records write (needs a token)
```

### 4.1 Identity

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not have the pocket base version as part of the protocol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request Improvement Optimization and improvement over existing feature priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants