You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9057552
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/adr/0016-active-session-script-publication.md
+23-9Lines changed: 23 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,15 +87,27 @@ the serialized guard before filesystem work and never relies on repair-only bare
87
87
`session save-script` refuses publication without this **destination guard** and tells the author to
88
88
record one. V1 does not infer a screen identity from a snapshot or synthesize an implicit guard.
89
89
90
-
The initial guard is selector-level. `wait` does not yet carry recorded-landmark identity through its
91
-
polling resolution, so the guard proves that an element matching its selector exists, not that it is the
92
-
same landmark element observed while authoring. Authors must choose a selective destination-specific
93
-
landmark; a reshuffled screen containing the same weak label elsewhere can false-pass.
94
-
[#1349](https://github.com/callstack/agent-device/issues/1349) owns the identity design for waits and
95
-
remaining read-only steps. It must preserve polling: ADR 0012's current pre-action `target-v1`
90
+
> **Amendment (#1349, shipped).** The guard is now identity-level, not merely selector-level. A
91
+
> selector wait recorded while ARMED captures landmark-mode `target-v1` evidence for the matched
92
+
> element (ADR 0012's read-only-step amendment), and a qualifying destination guard is exactly a
93
+
> selector wait whose annotation is `verification: "verified"` — a selector wait on an identity-empty
94
+
> element (no id and no label) records no annotation and does not qualify, so publication refuses it
95
+
> with a recovery hint naming a labeled/id-bearing landmark. On replay, polling is preserved: the wait
96
+
> keeps polling until a selector match carries the recorded identity (local identity + leaf-anchored
97
+
> ancestry prefix), and a deadline reached with only same-selector impostors fails closed as an
98
+
> `identity-mismatch``REPLAY_DIVERGENCE` before the wait reports success. The reshuffled-screen
99
+
> false-pass below is covered by a provider-scenario regression (record → publish → replay against a
100
+
> reshuffled tree whose same-label node sits under a different id/ancestry).
101
+
102
+
The original selector-level caveat, retained as context: the guard proved that an element matching its
103
+
selector exists, not that it is the same landmark element observed while authoring, so a reshuffled
104
+
screen containing the same weak label elsewhere could false-pass.
105
+
[#1349](https://github.com/callstack/agent-device/issues/1349) owned the identity design for waits and
106
+
remaining read-only steps. It preserves polling: ADR 0012's pre-action `target-v1`
96
107
verification cannot be attached to a wait unchanged because a not-yet-present landmark is the expected
97
-
starting condition. Any identity check for a wait happens after its selector resolves, before the wait
98
-
reports success, or uses a distinct guard-specific mechanism.
108
+
starting condition, so the identity check runs after the wait's selector resolves and before the wait
109
+
reports success (see ADR 0012's #1349 amendment for the mechanism and the read-only-step coverage
110
+
classification).
99
111
100
112
The phrase "last mutating action" is derived from a request-sensitive recording-effect trait on the
101
113
central `CommandDescriptor`, required for every command that records session actions and guarded by a
@@ -203,7 +215,9 @@ executing that script, not the artifact being saved.
203
215
- The artifact replays from a cold start, completes its destination guard, returns the live session id,
204
216
and accepts a subsequent command on that session.
205
217
- Every action in ADR 0012's existing target-binding command set has canonical identity evidence and no
206
-
unresolved `@ref` reaches disk; the destination guard remains selector-level until #1349 lands.
218
+
unresolved `@ref` reaches disk; since #1349 the destination guard additionally requires verified
219
+
recorded landmark identity, with a reshuffled-screen false-pass regression proving replay fails
220
+
closed.
207
221
- Existing-target refusal preserves the original bytes; `--force` replaces atomically; a failed publish
208
222
remains retryable.
209
223
- After PUBLISHED, later ordinary actions remain usable, repeated `session save-script` fails, plain
session save-script [path] [--force] publishes the sole recorded open through the destination guard, omits close, and leaves the session active. A duration wait, wait stable, or wait @ref is not a destination guard. A second successful open aborts publication; start a fresh session to author again.
237
+
session save-script [path] [--force] publishes the sole recorded open through the destination guard, omits close, and leaves the session active. The guard is a selector wait on a labeled or id-bearing landmark: its recorded identity is captured while armed, and replay verifies that identity after the wait's selector resolves, so a reshuffled screen with the same label elsewhere fails closed instead of false-passing. A duration wait, wait stable, wait @ref, or a selector wait on an unlabeled element is not a destination guard. A second successful open aborts publication; start a fresh session to author again.
238
238
Recorded fill/type inputs are written literally to the .ad file. Do not record passwords, tokens, or other secrets; use pre-authenticated test state or non-secret fixture credentials until parameterized input authoring is available.
0 commit comments