Skip to content

feat: PHI-safe observe and one-OK admit on AuthoringSession - #468

Merged
abrichr merged 1 commit into
mainfrom
feat/authoring-observe-admit
Sep 4, 2026
Merged

feat: PHI-safe observe and one-OK admit on AuthoringSession#468
abrichr merged 1 commit into
mainfrom
feat/authoring-observe-admit

Conversation

@abrichr

@abrichr abrichr commented Sep 4, 2026

Copy link
Copy Markdown
Member

openadapt-agent serve --authoring already constructs AuthoringSession when the module is importable. This fills the two remaining holes for a real session: observe() and one-OK admit().

observe() returns openadapt.authoring.observe/v1. Window titles, field values, screenshots, URLs, and backend pixels stay off that payload. Pixel bounds stay on the session, so a later click(node_id=...) still hits the remembered center. Windows / RDP / Citrix still raise CoachOnlyError at construct. web / macos / linux stay agent-drive when the window is pinned.

compile() is unchanged. It wraps compile_recording and returns needs_human_admit. An agent click still can't paint VERIFIED.

admit(confirm=None) is the human step. Empty, ok, yes, and True all succeed. The operator doesn't re-enter schema, authority, effect contract, environment, or digest. Those come from the compiled draft. The method writes admit.json next to the bundle (kind=local_operator_accept) and returns {status: accepted, workflow_id, digest?}. It doesn't mint a Seal or a Production admission.

Continue still uses Recorder.record_observed. It never calls type_text on the pause target.

Reviewer checklist

  • observe() payload has none of: value, text, title, screenshot, url, backend_pixels.
  • click(node_id=...) after observe() uses remembered pixels.
  • admit() with None / "" / "ok" / "yes" / True writes admit.json and returns accepted.
  • admit("no") and admit(False) refuse. admit() before compile() refuses.
  • Source still does not import backends, qualification_admission, or bundle_sealing.
  • No ToolDraft compiler, no CUA adapter, no generated Python tools.

Tests: tests/test_authoring.py (unit, fakes). The existing MockMed Playwright gate is untouched.

Opened by an agent session, not the founder.

Agent-led demonstration already wraps Recorder and compile_recording.
observe() now returns a projected tree without titles, values, screenshots,
URLs, or backend pixels. Click still uses remembered pixel bounds.
admit() records that a local operator accepted the compiled draft
(empty/ok/yes/True). It does not mint a production admission.
@abrichr
abrichr enabled auto-merge (squash) September 4, 2026 16:43
@abrichr
abrichr merged commit 3b40a9a into main Sep 4, 2026
16 checks passed
@abrichr
abrichr deleted the feat/authoring-observe-admit branch September 4, 2026 17:14
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